diff --git a/src/app/tests/suites/certification/Test_TC_CC_3_3.yaml b/src/app/tests/suites/certification/Test_TC_CC_3_3.yaml index 7f9ef03a8e1482..54cb5f84db893a 100644 --- a/src/app/tests/suites/certification/Test_TC_CC_3_3.yaml +++ b/src/app/tests/suites/certification/Test_TC_CC_3_3.yaml @@ -39,14 +39,14 @@ tests: response: value: 1 - - label: - "Check current hue attribute value matched the value sent by the last - command" - disabled: true + - label: "Reads CurrentHue attribute from DUT" command: "readAttribute" attribute: "current hue" response: - value: 150 + constraints: + type: uint8 + minValue: 0 + maxValue: 254 - label: "Step hue up command" command: "StepHue" @@ -63,14 +63,23 @@ tests: - name: "optionsOverride" value: 0 - - label: - "Check current hue attribute value matched the value sent by the last - command" - disabled: true + #delay step is necessary to let the attribute value change over time + - label: "Wait 25ms" + cluster: "DelayCommands" + command: "WaitForMs" + arguments: + values: + - name: "ms" + value: 25 + + - label: "Over TransitionTime,Read CurrentHue attribute from DUT" command: "readAttribute" attribute: "current hue" response: - value: -1 + constraints: + type: uint8 + minValue: 0 + maxValue: 254 - label: "Step hue down command" command: "StepHue" @@ -87,14 +96,22 @@ tests: - name: "optionsOverride" value: 0 - - label: - "Check current hue attribute value matched the value sent by the last - command" - disabled: true + - label: "Wait 25ms" + cluster: "DelayCommands" + command: "WaitForMs" + arguments: + values: + - name: "ms" + value: 25 + + - label: "Over TransitionTime,Read CurrentHue attribute from DUT" command: "readAttribute" attribute: "current hue" response: - value: -1 + constraints: + type: uint8 + minValue: 0 + maxValue: 254 - label: "Turn off light that we turned on" cluster: "On/Off" diff --git a/src/app/tests/suites/certification/Test_TC_CC_4_3.yaml b/src/app/tests/suites/certification/Test_TC_CC_4_3.yaml index d7e1c71994a45e..7b992ee9cd30af 100644 --- a/src/app/tests/suites/certification/Test_TC_CC_4_3.yaml +++ b/src/app/tests/suites/certification/Test_TC_CC_4_3.yaml @@ -39,12 +39,14 @@ tests: response: value: 1 - - label: "Check Saturation attribute value matched before any change" - disabled: true + - label: "Reads CurrentSaturation attribute from DUT" command: "readAttribute" attribute: "current saturation" response: - value: 90 + constraints: + type: uint8 + minValue: 0 + maxValue: 254 - label: "Step saturation up command" command: "StepSaturation" @@ -61,14 +63,23 @@ tests: - name: "optionsOverride" value: 0 - - label: - "Check Saturation attribute value matched the value sent by the last - command" - disabled: true + #delay step is necessary to let the attribute value change over time + - label: "Wait 10ms" + cluster: "DelayCommands" + command: "WaitForMs" + arguments: + values: + - name: "ms" + value: 10 + + - label: "Over TransitionTime,Read CurrentSaturation attribute from DUT" command: "readAttribute" attribute: "current saturation" response: - value: -1 + constraints: + type: uint8 + minValue: 0 + maxValue: 254 - label: "Step saturation down command" command: "StepSaturation" @@ -85,14 +96,22 @@ tests: - name: "optionsOverride" value: 0 - - label: - "Check Saturation attribute value matched the value sent by the last - command" - disabled: true + - label: "Wait 10ms" + cluster: "DelayCommands" + command: "WaitForMs" + arguments: + values: + - name: "ms" + value: 10 + + - label: "Over TransitionTime,Reads CurrentSaturation attribute from DUT" command: "readAttribute" attribute: "current saturation" response: - value: -1 + constraints: + type: uint8 + minValue: 0 + maxValue: 254 - label: "Turn off light that we turned on" cluster: "On/Off" diff --git a/src/app/tests/suites/certification/Test_TC_CC_7_3.yaml b/src/app/tests/suites/certification/Test_TC_CC_7_3.yaml index 8e1556eb3ed967..778d6dcc26436c 100644 --- a/src/app/tests/suites/certification/Test_TC_CC_7_3.yaml +++ b/src/app/tests/suites/certification/Test_TC_CC_7_3.yaml @@ -39,14 +39,14 @@ tests: response: value: 1 - - label: - "Check EnhancedCurrentHue attribute value matched the value sent by - the last command" - disabled: true + - label: "Reads EnhancedCurrentHue attribute from DUT" command: "readAttribute" attribute: "enhanced current hue" response: - value: 1025 + constraints: + type: uint16 + minValue: 0 + maxValue: 65535 - label: "Enhanced Step Hue Up command" command: "EnhancedStepHue" @@ -63,14 +63,22 @@ tests: - name: "optionsOverride" value: 0 - - label: - "Check EnhancedCurrentHue attribute value matched the value sent by - the last command" - disabled: true + - label: "Wait 10ms" + cluster: "DelayCommands" + command: "WaitForMs" + arguments: + values: + - name: "ms" + value: 10 + + - label: "Over TransitionTime,Read EnhancedCurrentHue attribute from DUT" command: "readAttribute" attribute: "enhanced current hue" response: - value: 1075 + constraints: + type: uint16 + minValue: 0 + maxValue: 65535 - label: "Enhanced Step Hue Down command" command: "EnhancedStepHue" @@ -87,14 +95,22 @@ tests: - name: "optionsOverride" value: 0 - - label: - "Check EnhancedCurrentHue attribute value matched the value sent by - the last command" - disabled: true + - label: "Wait 10ms" + cluster: "DelayCommands" + command: "WaitForMs" + arguments: + values: + - name: "ms" + value: 10 + + - label: "Over TransitionTime,Read EnhancedCurrentHue attribute from DUT" command: "readAttribute" attribute: "enhanced current hue" response: - value: 1000 + constraints: + type: uint16 + minValue: 0 + maxValue: 65535 - label: "Turn off light that we turned on" cluster: "On/Off" diff --git a/src/app/tests/suites/certification/Test_TC_CC_8_1.yaml b/src/app/tests/suites/certification/Test_TC_CC_8_1.yaml index 1831c74fa0840a..ca2197bb1dc218 100644 --- a/src/app/tests/suites/certification/Test_TC_CC_8_1.yaml +++ b/src/app/tests/suites/certification/Test_TC_CC_8_1.yaml @@ -39,156 +39,335 @@ tests: response: value: 1 - - label: "Color Loop Set Command - Set all Attributes" - command: "ColorLoopSet" + - label: "Move hue up command" + command: "MoveHue" arguments: values: - - name: "updateFlags" - value: 14 - - name: "action" - value: 0 - - name: "direction" + - name: "moveMode" value: 1 - - name: "time" - value: 100 - - name: "startHue" - value: 500 + - name: "rate" + value: 50 - name: "optionsMask" value: 0 - name: "optionsOverride" value: 0 - - label: "Check ColorLoopDirection Value" + - label: "Reads CurrentHue attribute from DUT" command: "readAttribute" - attribute: "color loop direction" + attribute: "current hue" response: - value: 1 + constraints: + type: uint8 + minValue: 0 + maxValue: 254 - - label: "Check ColorLoopTime Value" - command: "readAttribute" - attribute: "color loop time" - response: - value: 100 + - label: "Stop Move Step command" + command: "StopMoveStep" + arguments: + values: + - name: "optionsMask" + value: 0 + - name: "optionsOverride" + value: 0 - - label: "Check ColorLoopStartEnhancedHue Value" + - label: "Reads CurrentHue attribute from DUT" command: "readAttribute" - attribute: "color loop start enhanced hue" + attribute: "current hue" response: - value: 500 + constraints: + type: uint8 + minValue: 0 + maxValue: 254 + + - label: "Wait 100ms" + cluster: "DelayCommands" + command: "WaitForMs" + arguments: + values: + - name: "ms" + value: 100 - - label: "Check ColorLoopActive Value" + - label: + "Check current hue attribute value matched the value sent by the last + attribute" command: "readAttribute" - attribute: "color loop active" + attribute: "current hue" response: - value: 0 + constraints: + type: uint8 + minValue: 0 + maxValue: 254 - - label: "Color Loop Set Command - Start Color Loop" - command: "ColorLoopSet" + - label: "Move saturation up command" + command: "MoveSaturation" arguments: values: - - name: "updateFlags" + - name: "moveMode" value: 1 - - name: "action" - value: 1 - - name: "direction" - value: 0 - - name: "time" + - name: "rate" + value: 5 + - name: "optionsMask" value: 0 - - name: "startHue" + - name: "optionsOverride" value: 0 + + - label: + "Check Saturation attribute value matched the value sent by the last + command" + command: "readAttribute" + attribute: "current saturation" + response: + constraints: + type: uint8 + minValue: 0 + maxValue: 254 + + - label: "Stop Move Step command" + command: "StopMoveStep" + arguments: + values: - name: "optionsMask" value: 0 - name: "optionsOverride" value: 0 - - label: "Check ColorLoopActive Value" + - label: "Reads CurrentSaturation attribute from DUT." command: "readAttribute" - attribute: "color loop active" + attribute: "current saturation" response: - value: 1 + constraints: + type: uint8 + minValue: 0 + maxValue: 254 + + - label: "Wait 100ms" + cluster: "DelayCommands" + command: "WaitForMs" + arguments: + values: + - name: "ms" + value: 100 - # Test is disabled because a sleep/wait is necessary to let the hue change over time - # Once sleep/wait is available, test case will need to be adapted - - label: "Check EnhancedCurrentHue attribute value changed to a Higher Hue" - disabled: true + - label: + "Check Saturation attribute value matched the value sent by the last + attribute" command: "readAttribute" - attribute: "enhanced current hue" + attribute: "current saturation" response: - value: 500 + constraints: + type: uint8 + minValue: 0 + maxValue: 254 - - label: "Color Loop Set Command - Set direction and time while running" - command: "ColorLoopSet" + - label: "Move Color command" + command: "MoveColor" arguments: values: - - name: "updateFlags" - value: 6 - - name: "action" - value: 0 - - name: "direction" + - name: "rateX" + value: 15 + - name: "rateY" + value: 20 + - name: "optionsMask" value: 0 - - name: "time" - value: 3500 - - name: "startHue" + - name: "optionsOverride" value: 0 + + - label: "Reads CurrentX attribute from DUT" + command: "readAttribute" + attribute: "current x" + response: + constraints: + type: uint16 + minValue: 0 + maxValue: 65279 + + - label: "Reads CurrentY attribute from DUT" + command: "readAttribute" + attribute: "current y" + response: + constraints: + type: uint16 + minValue: 0 + maxValue: 65279 + + - label: "Stop Move Step command" + command: "StopMoveStep" + arguments: + values: - name: "optionsMask" value: 0 - name: "optionsOverride" value: 0 - # Test is disabled because a sleep/wait is necessary to let the hue change over time - # Once sleep/wait is available, test case will need to be adapted - - label: "Check EnhancedCurrentHue attribute value changed to a lower Hue" - disabled: true + - label: "Reads CurrentX attribute from DUT" command: "readAttribute" - attribute: "enhanced current hue" + attribute: "current x" response: - value: 500 + constraints: + type: uint16 + minValue: 0 + maxValue: 65279 - - label: "Check ColorLoopDirection Value" + - label: "Reads CurrentY attribute from DUT" command: "readAttribute" - attribute: "color loop direction" + attribute: "current y" response: - value: 0 + constraints: + type: uint16 + minValue: 0 + maxValue: 65279 - - label: "Check ColorLoopTime Value" + - label: "Wait 100ms" + cluster: "DelayCommands" + command: "WaitForMs" + arguments: + values: + - name: "ms" + value: 100 + + - label: + "Check current x attribute value matched the value sent by the last + attribute" command: "readAttribute" - attribute: "color loop time" + attribute: "current x" response: - value: 3500 + constraints: + type: uint16 + minValue: 0 + maxValue: 65279 - - label: "Color Loop Set Command - Set direction while running" - command: "ColorLoopSet" + - label: + "Check current y attribute value matched the value sent by the last + attribute" + command: "readAttribute" + attribute: "current y" + response: + constraints: + type: uint16 + minValue: 0 + maxValue: 65279 + + - label: "Move up color temperature command" + command: "MoveColorTemperature" arguments: values: - - name: "updateFlags" - value: 2 - - name: "action" + - name: "moveMode" + value: 1 + - name: "rate" + value: 10 + - name: "colorTemperatureMinimum" + value: 1 + - name: "colorTemperatureMaximum" + value: 255 + - name: "optionsMask" + value: 0 + - name: "optionsOverride" value: 0 - - name: "direction" + + - label: "Reads current color temprature from DUT" + command: "readAttribute" + attribute: "color temperature" + response: + constraints: + type: uint16 + minValue: 0 + maxValue: 65279 + + - label: "Stop Move Step command" + command: "StopMoveStep" + arguments: + values: + - name: "optionsMask" + value: 0 + - name: "optionsOverride" + value: 0 + + - label: "Reads current color temprature from DUT" + command: "readAttribute" + attribute: "color temperature" + response: + constraints: + type: uint16 + minValue: 0 + maxValue: 65279 + + - label: "Wait 100ms" + cluster: "DelayCommands" + command: "WaitForMs" + arguments: + values: + - name: "ms" + value: 100 + + - label: + "Reads current color attribute value matched the value sent by the + last attribute" + command: "readAttribute" + attribute: "color temperature" + response: + constraints: + type: uint16 + minValue: 0 + maxValue: 65279 + + - label: "Enhanced Move Hue Up command" + command: "EnhancedMoveHue" + arguments: + values: + - name: "moveMode" value: 1 - - name: "time" + - name: "rate" + value: 50 + - name: "optionsMask" value: 0 - - name: "startHue" + - name: "optionsOverride" value: 0 + + - label: "Reads EnhancedCurrentHue attribute value from DUT" + command: "readAttribute" + attribute: "enhanced current hue" + response: + constraints: + type: uint16 + minValue: 0 + maxValue: 65535 + + - label: "Stop Move Step command" + command: "StopMoveStep" + arguments: + values: - name: "optionsMask" value: 0 - name: "optionsOverride" value: 0 - # Test is disabled because a sleep/wait is necessary to let the hue change over time - # Once sleep/wait is available, test case will need to be adapted - - label: "Check EnhancedCurrentHue attribute value changed to a Higher Hue" - disabled: true + - label: "Reads EnhancedCurrentHue attribute value from DUT" command: "readAttribute" attribute: "enhanced current hue" response: - value: 500 + constraints: + type: uint16 + minValue: 0 + maxValue: 65535 + + - label: "Wait 100ms" + cluster: "DelayCommands" + command: "WaitForMs" + arguments: + values: + - name: "ms" + value: 100 - - label: "Check ColorLoopDirection Value" + - label: + "Check EnhancedCurrentHue attribute value matched the value sent by + the last attribute" command: "readAttribute" - attribute: "color loop direction" + attribute: "enhanced current hue" response: - value: 1 + constraints: + type: uint16 + minValue: 0 + maxValue: 65535 - label: "Turn off light that we turned on" cluster: "On/Off" diff --git a/zzz_generated/chip-tool-darwin/zap-generated/test/Commands.h b/zzz_generated/chip-tool-darwin/zap-generated/test/Commands.h index 7ab4601a998f21..c08e7512eecebd 100644 --- a/zzz_generated/chip-tool-darwin/zap-generated/test/Commands.h +++ b/zzz_generated/chip-tool-darwin/zap-generated/test/Commands.h @@ -8834,20 +8834,40 @@ class Test_TC_CC_3_3 : public TestCommandBridge { err = TestCheckOnOffAttributeValueIsTrueAfterOnCommand_2(); break; case 3: - ChipLogProgress(chipTool, " ***** Test Step 3 : Step hue up command\n"); - err = TestStepHueUpCommand_3(); + ChipLogProgress(chipTool, " ***** Test Step 3 : Reads CurrentHue attribute from DUT\n"); + err = TestReadsCurrentHueAttributeFromDut_3(); break; case 4: - ChipLogProgress(chipTool, " ***** Test Step 4 : Step hue down command\n"); - err = TestStepHueDownCommand_4(); + ChipLogProgress(chipTool, " ***** Test Step 4 : Step hue up command\n"); + err = TestStepHueUpCommand_4(); break; case 5: - ChipLogProgress(chipTool, " ***** Test Step 5 : Turn off light that we turned on\n"); - err = TestTurnOffLightThatWeTurnedOn_5(); + ChipLogProgress(chipTool, " ***** Test Step 5 : Wait 25ms\n"); + err = TestWait25ms_5(); break; case 6: - ChipLogProgress(chipTool, " ***** Test Step 6 : Check on/off attribute value is false after off command\n"); - err = TestCheckOnOffAttributeValueIsFalseAfterOffCommand_6(); + ChipLogProgress(chipTool, " ***** Test Step 6 : Over TransitionTime,Read CurrentHue attribute from DUT\n"); + err = TestOverTransitionTimeReadCurrentHueAttributeFromDut_6(); + break; + case 7: + ChipLogProgress(chipTool, " ***** Test Step 7 : Step hue down command\n"); + err = TestStepHueDownCommand_7(); + break; + case 8: + ChipLogProgress(chipTool, " ***** Test Step 8 : Wait 25ms\n"); + err = TestWait25ms_8(); + break; + case 9: + ChipLogProgress(chipTool, " ***** Test Step 9 : Over TransitionTime,Read CurrentHue attribute from DUT\n"); + err = TestOverTransitionTimeReadCurrentHueAttributeFromDut_9(); + break; + case 10: + ChipLogProgress(chipTool, " ***** Test Step 10 : Turn off light that we turned on\n"); + err = TestTurnOffLightThatWeTurnedOn_10(); + break; + case 11: + ChipLogProgress(chipTool, " ***** Test Step 11 : Check on/off attribute value is false after off command\n"); + err = TestCheckOnOffAttributeValueIsFalseAfterOffCommand_11(); break; } @@ -8881,6 +8901,21 @@ class Test_TC_CC_3_3 : public TestCommandBridge { 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. @@ -8894,7 +8929,7 @@ class Test_TC_CC_3_3 : public TestCommandBridge { private: std::atomic_uint16_t mTestIndex; - const uint16_t mTestCount = 7; + const uint16_t mTestCount = 12; chip::Optional mNodeId; chip::Optional mCluster; @@ -8949,7 +8984,33 @@ class Test_TC_CC_3_3 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestStepHueUpCommand_3() + CHIP_ERROR TestReadsCurrentHueAttributeFromDut_3() + { + SetIdentity("alpha"); + CHIPDevice * device = GetConnectedDevice(); + CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeCurrentHueWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Reads CurrentHue attribute from DUT Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + VerifyOrReturn(CheckConstraintType("currentHue", "", "uint8")); + if (value != nil) { + VerifyOrReturn(CheckConstraintMinValue("currentHue", [value unsignedCharValue], 0)); + } + if (value != nil) { + VerifyOrReturn(CheckConstraintMaxValue("currentHue", [value unsignedCharValue], 254)); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestStepHueUpCommand_4() { SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); @@ -8974,7 +9035,40 @@ class Test_TC_CC_3_3 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestStepHueDownCommand_4() + CHIP_ERROR TestWait25ms_5() + { + SetIdentity("alpha"); + WaitForMs(25); + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestOverTransitionTimeReadCurrentHueAttributeFromDut_6() + { + SetIdentity("alpha"); + CHIPDevice * device = GetConnectedDevice(); + CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeCurrentHueWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Over TransitionTime,Read CurrentHue attribute from DUT Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + VerifyOrReturn(CheckConstraintType("currentHue", "", "uint8")); + if (value != nil) { + VerifyOrReturn(CheckConstraintMinValue("currentHue", [value unsignedCharValue], 0)); + } + if (value != nil) { + VerifyOrReturn(CheckConstraintMaxValue("currentHue", [value unsignedCharValue], 254)); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestStepHueDownCommand_7() { SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); @@ -8999,7 +9093,40 @@ class Test_TC_CC_3_3 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestTurnOffLightThatWeTurnedOn_5() + CHIP_ERROR TestWait25ms_8() + { + SetIdentity("alpha"); + WaitForMs(25); + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestOverTransitionTimeReadCurrentHueAttributeFromDut_9() + { + SetIdentity("alpha"); + CHIPDevice * device = GetConnectedDevice(); + CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeCurrentHueWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Over TransitionTime,Read CurrentHue attribute from DUT Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + VerifyOrReturn(CheckConstraintType("currentHue", "", "uint8")); + if (value != nil) { + VerifyOrReturn(CheckConstraintMinValue("currentHue", [value unsignedCharValue], 0)); + } + if (value != nil) { + VerifyOrReturn(CheckConstraintMaxValue("currentHue", [value unsignedCharValue], 254)); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestTurnOffLightThatWeTurnedOn_10() { SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); @@ -9017,7 +9144,7 @@ class Test_TC_CC_3_3 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestCheckOnOffAttributeValueIsFalseAfterOffCommand_6() + CHIP_ERROR TestCheckOnOffAttributeValueIsFalseAfterOffCommand_11() { SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); @@ -9697,20 +9824,40 @@ class Test_TC_CC_4_3 : public TestCommandBridge { err = TestCheckOnOffAttributeValueIsTrueAfterOnCommand_2(); break; case 3: - ChipLogProgress(chipTool, " ***** Test Step 3 : Step saturation up command\n"); - err = TestStepSaturationUpCommand_3(); + ChipLogProgress(chipTool, " ***** Test Step 3 : Reads CurrentSaturation attribute from DUT\n"); + err = TestReadsCurrentSaturationAttributeFromDut_3(); break; case 4: - ChipLogProgress(chipTool, " ***** Test Step 4 : Step saturation down command\n"); - err = TestStepSaturationDownCommand_4(); + ChipLogProgress(chipTool, " ***** Test Step 4 : Step saturation up command\n"); + err = TestStepSaturationUpCommand_4(); break; case 5: - ChipLogProgress(chipTool, " ***** Test Step 5 : Turn off light that we turned on\n"); - err = TestTurnOffLightThatWeTurnedOn_5(); + ChipLogProgress(chipTool, " ***** Test Step 5 : Wait 10ms\n"); + err = TestWait10ms_5(); break; case 6: - ChipLogProgress(chipTool, " ***** Test Step 6 : Check on/off attribute value is false after off command\n"); - err = TestCheckOnOffAttributeValueIsFalseAfterOffCommand_6(); + ChipLogProgress(chipTool, " ***** Test Step 6 : Over TransitionTime,Read CurrentSaturation attribute from DUT\n"); + err = TestOverTransitionTimeReadCurrentSaturationAttributeFromDut_6(); + break; + case 7: + ChipLogProgress(chipTool, " ***** Test Step 7 : Step saturation down command\n"); + err = TestStepSaturationDownCommand_7(); + break; + case 8: + ChipLogProgress(chipTool, " ***** Test Step 8 : Wait 10ms\n"); + err = TestWait10ms_8(); + break; + case 9: + ChipLogProgress(chipTool, " ***** Test Step 9 : Over TransitionTime,Reads CurrentSaturation attribute from DUT\n"); + err = TestOverTransitionTimeReadsCurrentSaturationAttributeFromDut_9(); + break; + case 10: + ChipLogProgress(chipTool, " ***** Test Step 10 : Turn off light that we turned on\n"); + err = TestTurnOffLightThatWeTurnedOn_10(); + break; + case 11: + ChipLogProgress(chipTool, " ***** Test Step 11 : Check on/off attribute value is false after off command\n"); + err = TestCheckOnOffAttributeValueIsFalseAfterOffCommand_11(); break; } @@ -9744,6 +9891,21 @@ class Test_TC_CC_4_3 : public TestCommandBridge { 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. @@ -9757,7 +9919,7 @@ class Test_TC_CC_4_3 : public TestCommandBridge { private: std::atomic_uint16_t mTestIndex; - const uint16_t mTestCount = 7; + const uint16_t mTestCount = 12; chip::Optional mNodeId; chip::Optional mCluster; @@ -9812,7 +9974,33 @@ class Test_TC_CC_4_3 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestStepSaturationUpCommand_3() + CHIP_ERROR TestReadsCurrentSaturationAttributeFromDut_3() + { + SetIdentity("alpha"); + CHIPDevice * device = GetConnectedDevice(); + CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeCurrentSaturationWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Reads CurrentSaturation attribute from DUT Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + VerifyOrReturn(CheckConstraintType("currentSaturation", "", "uint8")); + if (value != nil) { + VerifyOrReturn(CheckConstraintMinValue("currentSaturation", [value unsignedCharValue], 0)); + } + if (value != nil) { + VerifyOrReturn(CheckConstraintMaxValue("currentSaturation", [value unsignedCharValue], 254)); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestStepSaturationUpCommand_4() { SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); @@ -9837,7 +10025,40 @@ class Test_TC_CC_4_3 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestStepSaturationDownCommand_4() + CHIP_ERROR TestWait10ms_5() + { + SetIdentity("alpha"); + WaitForMs(10); + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestOverTransitionTimeReadCurrentSaturationAttributeFromDut_6() + { + SetIdentity("alpha"); + CHIPDevice * device = GetConnectedDevice(); + CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeCurrentSaturationWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Over TransitionTime,Read CurrentSaturation attribute from DUT Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + VerifyOrReturn(CheckConstraintType("currentSaturation", "", "uint8")); + if (value != nil) { + VerifyOrReturn(CheckConstraintMinValue("currentSaturation", [value unsignedCharValue], 0)); + } + if (value != nil) { + VerifyOrReturn(CheckConstraintMaxValue("currentSaturation", [value unsignedCharValue], 254)); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestStepSaturationDownCommand_7() { SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); @@ -9862,7 +10083,40 @@ class Test_TC_CC_4_3 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestTurnOffLightThatWeTurnedOn_5() + CHIP_ERROR TestWait10ms_8() + { + SetIdentity("alpha"); + WaitForMs(10); + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestOverTransitionTimeReadsCurrentSaturationAttributeFromDut_9() + { + SetIdentity("alpha"); + CHIPDevice * device = GetConnectedDevice(); + CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeCurrentSaturationWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Over TransitionTime,Reads CurrentSaturation attribute from DUT Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + VerifyOrReturn(CheckConstraintType("currentSaturation", "", "uint8")); + if (value != nil) { + VerifyOrReturn(CheckConstraintMinValue("currentSaturation", [value unsignedCharValue], 0)); + } + if (value != nil) { + VerifyOrReturn(CheckConstraintMaxValue("currentSaturation", [value unsignedCharValue], 254)); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestTurnOffLightThatWeTurnedOn_10() { SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); @@ -9880,7 +10134,7 @@ class Test_TC_CC_4_3 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestCheckOnOffAttributeValueIsFalseAfterOffCommand_6() + CHIP_ERROR TestCheckOnOffAttributeValueIsFalseAfterOffCommand_11() { SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); @@ -12504,29 +12758,49 @@ class Test_TC_CC_7_3 : public TestCommandBridge { err = TestCheckOnOffAttributeValueIsTrueAfterOnCommand_2(); break; case 3: - ChipLogProgress(chipTool, " ***** Test Step 3 : Enhanced Step Hue Up command\n"); - err = TestEnhancedStepHueUpCommand_3(); + ChipLogProgress(chipTool, " ***** Test Step 3 : Reads EnhancedCurrentHue attribute from DUT\n"); + err = TestReadsEnhancedCurrentHueAttributeFromDut_3(); break; case 4: - ChipLogProgress(chipTool, " ***** Test Step 4 : Enhanced Step Hue Down command\n"); - err = TestEnhancedStepHueDownCommand_4(); + ChipLogProgress(chipTool, " ***** Test Step 4 : Enhanced Step Hue Up command\n"); + err = TestEnhancedStepHueUpCommand_4(); break; case 5: - ChipLogProgress(chipTool, " ***** Test Step 5 : Turn off light that we turned on\n"); - err = TestTurnOffLightThatWeTurnedOn_5(); + ChipLogProgress(chipTool, " ***** Test Step 5 : Wait 10ms\n"); + err = TestWait10ms_5(); break; case 6: - ChipLogProgress(chipTool, " ***** Test Step 6 : Check on/off attribute value is false after off command\n"); - err = TestCheckOnOffAttributeValueIsFalseAfterOffCommand_6(); + ChipLogProgress(chipTool, " ***** Test Step 6 : Over TransitionTime,Read EnhancedCurrentHue attribute from DUT\n"); + err = TestOverTransitionTimeReadEnhancedCurrentHueAttributeFromDut_6(); break; - } - - if (CHIP_NO_ERROR != err) { - ChipLogError(chipTool, " ***** Test Failure: %s\n", chip::ErrorStr(err)); - SetCommandExitStatus(err); - } - } - + case 7: + ChipLogProgress(chipTool, " ***** Test Step 7 : Enhanced Step Hue Down command\n"); + err = TestEnhancedStepHueDownCommand_7(); + break; + case 8: + ChipLogProgress(chipTool, " ***** Test Step 8 : Wait 10ms\n"); + err = TestWait10ms_8(); + break; + case 9: + ChipLogProgress(chipTool, " ***** Test Step 9 : Over TransitionTime,Read EnhancedCurrentHue attribute from DUT\n"); + err = TestOverTransitionTimeReadEnhancedCurrentHueAttributeFromDut_9(); + break; + case 10: + ChipLogProgress(chipTool, " ***** Test Step 10 : Turn off light that we turned on\n"); + err = TestTurnOffLightThatWeTurnedOn_10(); + break; + case 11: + ChipLogProgress(chipTool, " ***** Test Step 11 : Check on/off attribute value is false after off command\n"); + err = TestCheckOnOffAttributeValueIsFalseAfterOffCommand_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) { @@ -12551,6 +12825,21 @@ class Test_TC_CC_7_3 : public TestCommandBridge { 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. @@ -12564,7 +12853,7 @@ class Test_TC_CC_7_3 : public TestCommandBridge { private: std::atomic_uint16_t mTestIndex; - const uint16_t mTestCount = 7; + const uint16_t mTestCount = 12; chip::Optional mNodeId; chip::Optional mCluster; @@ -12619,7 +12908,33 @@ class Test_TC_CC_7_3 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestEnhancedStepHueUpCommand_3() + CHIP_ERROR TestReadsEnhancedCurrentHueAttributeFromDut_3() + { + SetIdentity("alpha"); + CHIPDevice * device = GetConnectedDevice(); + CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeEnhancedCurrentHueWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Reads EnhancedCurrentHue attribute from DUT Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + VerifyOrReturn(CheckConstraintType("enhancedCurrentHue", "", "uint16")); + if (value != nil) { + VerifyOrReturn(CheckConstraintMinValue("enhancedCurrentHue", [value unsignedShortValue], 0U)); + } + if (value != nil) { + VerifyOrReturn(CheckConstraintMaxValue("enhancedCurrentHue", [value unsignedShortValue], 65535U)); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestEnhancedStepHueUpCommand_4() { SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); @@ -12644,7 +12959,40 @@ class Test_TC_CC_7_3 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestEnhancedStepHueDownCommand_4() + CHIP_ERROR TestWait10ms_5() + { + SetIdentity("alpha"); + WaitForMs(10); + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestOverTransitionTimeReadEnhancedCurrentHueAttributeFromDut_6() + { + SetIdentity("alpha"); + CHIPDevice * device = GetConnectedDevice(); + CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeEnhancedCurrentHueWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Over TransitionTime,Read EnhancedCurrentHue attribute from DUT Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + VerifyOrReturn(CheckConstraintType("enhancedCurrentHue", "", "uint16")); + if (value != nil) { + VerifyOrReturn(CheckConstraintMinValue("enhancedCurrentHue", [value unsignedShortValue], 0U)); + } + if (value != nil) { + VerifyOrReturn(CheckConstraintMaxValue("enhancedCurrentHue", [value unsignedShortValue], 65535U)); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestEnhancedStepHueDownCommand_7() { SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); @@ -12669,7 +13017,40 @@ class Test_TC_CC_7_3 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestTurnOffLightThatWeTurnedOn_5() + CHIP_ERROR TestWait10ms_8() + { + SetIdentity("alpha"); + WaitForMs(10); + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestOverTransitionTimeReadEnhancedCurrentHueAttributeFromDut_9() + { + SetIdentity("alpha"); + CHIPDevice * device = GetConnectedDevice(); + CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeEnhancedCurrentHueWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Over TransitionTime,Read EnhancedCurrentHue attribute from DUT Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + VerifyOrReturn(CheckConstraintType("enhancedCurrentHue", "", "uint16")); + if (value != nil) { + VerifyOrReturn(CheckConstraintMinValue("enhancedCurrentHue", [value unsignedShortValue], 0U)); + } + if (value != nil) { + VerifyOrReturn(CheckConstraintMaxValue("enhancedCurrentHue", [value unsignedShortValue], 65535U)); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestTurnOffLightThatWeTurnedOn_10() { SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); @@ -12687,7 +13068,7 @@ class Test_TC_CC_7_3 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestCheckOnOffAttributeValueIsFalseAfterOffCommand_6() + CHIP_ERROR TestCheckOnOffAttributeValueIsFalseAfterOffCommand_11() { SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); @@ -12988,60 +13369,151 @@ class Test_TC_CC_8_1 : public TestCommandBridge { err = TestCheckOnOffAttributeValueIsTrueAfterOnCommand_2(); break; case 3: - ChipLogProgress(chipTool, " ***** Test Step 3 : Color Loop Set Command - Set all Attributes\n"); - err = TestColorLoopSetCommandSetAllAttributes_3(); + ChipLogProgress(chipTool, " ***** Test Step 3 : Move hue up command\n"); + err = TestMoveHueUpCommand_3(); break; case 4: - ChipLogProgress(chipTool, " ***** Test Step 4 : Check ColorLoopDirection Value\n"); - err = TestCheckColorLoopDirectionValue_4(); + ChipLogProgress(chipTool, " ***** Test Step 4 : Reads CurrentHue attribute from DUT\n"); + err = TestReadsCurrentHueAttributeFromDut_4(); break; case 5: - ChipLogProgress(chipTool, " ***** Test Step 5 : Check ColorLoopTime Value\n"); - err = TestCheckColorLoopTimeValue_5(); + ChipLogProgress(chipTool, " ***** Test Step 5 : Stop Move Step command\n"); + err = TestStopMoveStepCommand_5(); break; case 6: - ChipLogProgress(chipTool, " ***** Test Step 6 : Check ColorLoopStartEnhancedHue Value\n"); - err = TestCheckColorLoopStartEnhancedHueValue_6(); + ChipLogProgress(chipTool, " ***** Test Step 6 : Reads CurrentHue attribute from DUT\n"); + err = TestReadsCurrentHueAttributeFromDut_6(); break; case 7: - ChipLogProgress(chipTool, " ***** Test Step 7 : Check ColorLoopActive Value\n"); - err = TestCheckColorLoopActiveValue_7(); + ChipLogProgress(chipTool, " ***** Test Step 7 : Wait 100ms\n"); + err = TestWait100ms_7(); break; case 8: - ChipLogProgress(chipTool, " ***** Test Step 8 : Color Loop Set Command - Start Color Loop\n"); - err = TestColorLoopSetCommandStartColorLoop_8(); + ChipLogProgress( + chipTool, " ***** Test Step 8 : Check current hue attribute value matched the value sent by the last attribute\n"); + err = TestCheckCurrentHueAttributeValueMatchedTheValueSentByTheLastAttribute_8(); break; case 9: - ChipLogProgress(chipTool, " ***** Test Step 9 : Check ColorLoopActive Value\n"); - err = TestCheckColorLoopActiveValue_9(); + ChipLogProgress(chipTool, " ***** Test Step 9 : Move saturation up command\n"); + err = TestMoveSaturationUpCommand_9(); break; case 10: - ChipLogProgress(chipTool, " ***** Test Step 10 : Color Loop Set Command - Set direction and time while running\n"); - err = TestColorLoopSetCommandSetDirectionAndTimeWhileRunning_10(); + ChipLogProgress( + chipTool, " ***** Test Step 10 : Check Saturation attribute value matched the value sent by the last command\n"); + err = TestCheckSaturationAttributeValueMatchedTheValueSentByTheLastCommand_10(); break; case 11: - ChipLogProgress(chipTool, " ***** Test Step 11 : Check ColorLoopDirection Value\n"); - err = TestCheckColorLoopDirectionValue_11(); + ChipLogProgress(chipTool, " ***** Test Step 11 : Stop Move Step command\n"); + err = TestStopMoveStepCommand_11(); break; case 12: - ChipLogProgress(chipTool, " ***** Test Step 12 : Check ColorLoopTime Value\n"); - err = TestCheckColorLoopTimeValue_12(); + ChipLogProgress(chipTool, " ***** Test Step 12 : Reads CurrentSaturation attribute from DUT.\n"); + err = TestReadsCurrentSaturationAttributeFromDut_12(); break; case 13: - ChipLogProgress(chipTool, " ***** Test Step 13 : Color Loop Set Command - Set direction while running\n"); - err = TestColorLoopSetCommandSetDirectionWhileRunning_13(); + ChipLogProgress(chipTool, " ***** Test Step 13 : Wait 100ms\n"); + err = TestWait100ms_13(); break; case 14: - ChipLogProgress(chipTool, " ***** Test Step 14 : Check ColorLoopDirection Value\n"); - err = TestCheckColorLoopDirectionValue_14(); + ChipLogProgress( + chipTool, " ***** Test Step 14 : Check Saturation attribute value matched the value sent by the last attribute\n"); + err = TestCheckSaturationAttributeValueMatchedTheValueSentByTheLastAttribute_14(); break; case 15: - ChipLogProgress(chipTool, " ***** Test Step 15 : Turn off light that we turned on\n"); - err = TestTurnOffLightThatWeTurnedOn_15(); + ChipLogProgress(chipTool, " ***** Test Step 15 : Move Color command\n"); + err = TestMoveColorCommand_15(); break; case 16: - ChipLogProgress(chipTool, " ***** Test Step 16 : Check on/off attribute value is false after off command\n"); - err = TestCheckOnOffAttributeValueIsFalseAfterOffCommand_16(); + ChipLogProgress(chipTool, " ***** Test Step 16 : Reads CurrentX attribute from DUT\n"); + err = TestReadsCurrentXAttributeFromDut_16(); + break; + case 17: + ChipLogProgress(chipTool, " ***** Test Step 17 : Reads CurrentY attribute from DUT\n"); + err = TestReadsCurrentYAttributeFromDut_17(); + break; + case 18: + ChipLogProgress(chipTool, " ***** Test Step 18 : Stop Move Step command\n"); + err = TestStopMoveStepCommand_18(); + break; + case 19: + ChipLogProgress(chipTool, " ***** Test Step 19 : Reads CurrentX attribute from DUT\n"); + err = TestReadsCurrentXAttributeFromDut_19(); + break; + case 20: + ChipLogProgress(chipTool, " ***** Test Step 20 : Reads CurrentY attribute from DUT\n"); + err = TestReadsCurrentYAttributeFromDut_20(); + break; + case 21: + ChipLogProgress(chipTool, " ***** Test Step 21 : Wait 100ms\n"); + err = TestWait100ms_21(); + break; + case 22: + ChipLogProgress( + chipTool, " ***** Test Step 22 : Check current x attribute value matched the value sent by the last attribute\n"); + err = TestCheckCurrentXAttributeValueMatchedTheValueSentByTheLastAttribute_22(); + break; + case 23: + ChipLogProgress( + chipTool, " ***** Test Step 23 : Check current y attribute value matched the value sent by the last attribute\n"); + err = TestCheckCurrentYAttributeValueMatchedTheValueSentByTheLastAttribute_23(); + break; + case 24: + ChipLogProgress(chipTool, " ***** Test Step 24 : Move up color temperature command\n"); + err = TestMoveUpColorTemperatureCommand_24(); + break; + case 25: + ChipLogProgress(chipTool, " ***** Test Step 25 : Reads current color temprature from DUT\n"); + err = TestReadsCurrentColorTempratureFromDut_25(); + break; + case 26: + ChipLogProgress(chipTool, " ***** Test Step 26 : Stop Move Step command\n"); + err = TestStopMoveStepCommand_26(); + break; + case 27: + ChipLogProgress(chipTool, " ***** Test Step 27 : Reads current color temprature from DUT\n"); + err = TestReadsCurrentColorTempratureFromDut_27(); + break; + case 28: + ChipLogProgress(chipTool, " ***** Test Step 28 : Wait 100ms\n"); + err = TestWait100ms_28(); + break; + case 29: + ChipLogProgress(chipTool, + " ***** Test Step 29 : Reads current color attribute value matched the value sent by the last attribute\n"); + err = TestReadsCurrentColorAttributeValueMatchedTheValueSentByTheLastAttribute_29(); + break; + case 30: + ChipLogProgress(chipTool, " ***** Test Step 30 : Enhanced Move Hue Up command\n"); + err = TestEnhancedMoveHueUpCommand_30(); + break; + case 31: + ChipLogProgress(chipTool, " ***** Test Step 31 : Reads EnhancedCurrentHue attribute value from DUT\n"); + err = TestReadsEnhancedCurrentHueAttributeValueFromDut_31(); + break; + case 32: + ChipLogProgress(chipTool, " ***** Test Step 32 : Stop Move Step command\n"); + err = TestStopMoveStepCommand_32(); + break; + case 33: + ChipLogProgress(chipTool, " ***** Test Step 33 : Reads EnhancedCurrentHue attribute value from DUT\n"); + err = TestReadsEnhancedCurrentHueAttributeValueFromDut_33(); + break; + case 34: + ChipLogProgress(chipTool, " ***** Test Step 34 : Wait 100ms\n"); + err = TestWait100ms_34(); + break; + case 35: + ChipLogProgress(chipTool, + " ***** Test Step 35 : Check EnhancedCurrentHue attribute value matched the value sent by the last attribute\n"); + err = TestCheckEnhancedCurrentHueAttributeValueMatchedTheValueSentByTheLastAttribute_35(); + break; + case 36: + ChipLogProgress(chipTool, " ***** Test Step 36 : Turn off light that we turned on\n"); + err = TestTurnOffLightThatWeTurnedOn_36(); + break; + case 37: + ChipLogProgress(chipTool, " ***** Test Step 37 : Check on/off attribute value is false after off command\n"); + err = TestCheckOnOffAttributeValueIsFalseAfterOffCommand_37(); break; } @@ -13105,6 +13577,69 @@ class Test_TC_CC_8_1 : public TestCommandBridge { 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; } // Go on to the next test. @@ -13118,7 +13653,7 @@ class Test_TC_CC_8_1 : public TestCommandBridge { private: std::atomic_uint16_t mTestIndex; - const uint16_t mTestCount = 17; + const uint16_t mTestCount = 38; chip::Optional mNodeId; chip::Optional mCluster; @@ -13173,26 +13708,359 @@ class Test_TC_CC_8_1 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestColorLoopSetCommandSetAllAttributes_3() + CHIP_ERROR TestMoveHueUpCommand_3() { SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - __auto_type * params = [[CHIPColorControlClusterColorLoopSetParams alloc] init]; - params.updateFlags = [NSNumber numberWithUnsignedChar:14]; - params.action = [NSNumber numberWithUnsignedChar:0]; - params.direction = [NSNumber numberWithUnsignedChar:1]; - params.time = [NSNumber numberWithUnsignedShort:100U]; - params.startHue = [NSNumber numberWithUnsignedShort:500U]; + __auto_type * params = [[CHIPColorControlClusterMoveHueParams alloc] init]; + params.moveMode = [NSNumber numberWithUnsignedChar:1]; + params.rate = [NSNumber numberWithUnsignedChar:50]; params.optionsMask = [NSNumber numberWithUnsignedChar:0]; params.optionsOverride = [NSNumber numberWithUnsignedChar:0]; - [cluster colorLoopSetWithParams:params - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Color Loop Set Command - Set all Attributes Error: %@", err); + [cluster moveHueWithParams:params + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Move hue up command Error: %@", err); - VerifyOrReturn(CheckValue("status", err, 0)); + VerifyOrReturn(CheckValue("status", err, 0)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadsCurrentHueAttributeFromDut_4() + { + SetIdentity("alpha"); + CHIPDevice * device = GetConnectedDevice(); + CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeCurrentHueWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Reads CurrentHue attribute from DUT Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + VerifyOrReturn(CheckConstraintType("currentHue", "", "uint8")); + if (value != nil) { + VerifyOrReturn(CheckConstraintMinValue("currentHue", [value unsignedCharValue], 0)); + } + if (value != nil) { + VerifyOrReturn(CheckConstraintMaxValue("currentHue", [value unsignedCharValue], 254)); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestStopMoveStepCommand_5() + { + SetIdentity("alpha"); + CHIPDevice * device = GetConnectedDevice(); + CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + __auto_type * params = [[CHIPColorControlClusterStopMoveStepParams alloc] init]; + params.optionsMask = [NSNumber numberWithUnsignedChar:0]; + params.optionsOverride = [NSNumber numberWithUnsignedChar:0]; + [cluster stopMoveStepWithParams:params + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Stop Move Step command Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadsCurrentHueAttributeFromDut_6() + { + SetIdentity("alpha"); + CHIPDevice * device = GetConnectedDevice(); + CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeCurrentHueWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Reads CurrentHue attribute from DUT Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + VerifyOrReturn(CheckConstraintType("currentHue", "", "uint8")); + if (value != nil) { + VerifyOrReturn(CheckConstraintMinValue("currentHue", [value unsignedCharValue], 0)); + } + if (value != nil) { + VerifyOrReturn(CheckConstraintMaxValue("currentHue", [value unsignedCharValue], 254)); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestWait100ms_7() + { + SetIdentity("alpha"); + WaitForMs(100); + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestCheckCurrentHueAttributeValueMatchedTheValueSentByTheLastAttribute_8() + { + SetIdentity("alpha"); + CHIPDevice * device = GetConnectedDevice(); + CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeCurrentHueWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Check current hue attribute value matched the value sent by the last attribute Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + VerifyOrReturn(CheckConstraintType("currentHue", "", "uint8")); + if (value != nil) { + VerifyOrReturn(CheckConstraintMinValue("currentHue", [value unsignedCharValue], 0)); + } + if (value != nil) { + VerifyOrReturn(CheckConstraintMaxValue("currentHue", [value unsignedCharValue], 254)); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestMoveSaturationUpCommand_9() + { + SetIdentity("alpha"); + CHIPDevice * device = GetConnectedDevice(); + CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + __auto_type * params = [[CHIPColorControlClusterMoveSaturationParams alloc] init]; + params.moveMode = [NSNumber numberWithUnsignedChar:1]; + params.rate = [NSNumber numberWithUnsignedChar:5]; + params.optionsMask = [NSNumber numberWithUnsignedChar:0]; + params.optionsOverride = [NSNumber numberWithUnsignedChar:0]; + [cluster moveSaturationWithParams:params + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Move saturation up command Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestCheckSaturationAttributeValueMatchedTheValueSentByTheLastCommand_10() + { + SetIdentity("alpha"); + CHIPDevice * device = GetConnectedDevice(); + CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeCurrentSaturationWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Check Saturation attribute value matched the value sent by the last command Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + VerifyOrReturn(CheckConstraintType("currentSaturation", "", "uint8")); + if (value != nil) { + VerifyOrReturn(CheckConstraintMinValue("currentSaturation", [value unsignedCharValue], 0)); + } + if (value != nil) { + VerifyOrReturn(CheckConstraintMaxValue("currentSaturation", [value unsignedCharValue], 254)); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestStopMoveStepCommand_11() + { + SetIdentity("alpha"); + CHIPDevice * device = GetConnectedDevice(); + CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + __auto_type * params = [[CHIPColorControlClusterStopMoveStepParams alloc] init]; + params.optionsMask = [NSNumber numberWithUnsignedChar:0]; + params.optionsOverride = [NSNumber numberWithUnsignedChar:0]; + [cluster stopMoveStepWithParams:params + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Stop Move Step command Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadsCurrentSaturationAttributeFromDut_12() + { + SetIdentity("alpha"); + CHIPDevice * device = GetConnectedDevice(); + CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeCurrentSaturationWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Reads CurrentSaturation attribute from DUT. Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + VerifyOrReturn(CheckConstraintType("currentSaturation", "", "uint8")); + if (value != nil) { + VerifyOrReturn(CheckConstraintMinValue("currentSaturation", [value unsignedCharValue], 0)); + } + if (value != nil) { + VerifyOrReturn(CheckConstraintMaxValue("currentSaturation", [value unsignedCharValue], 254)); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestWait100ms_13() + { + SetIdentity("alpha"); + WaitForMs(100); + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestCheckSaturationAttributeValueMatchedTheValueSentByTheLastAttribute_14() + { + SetIdentity("alpha"); + CHIPDevice * device = GetConnectedDevice(); + CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeCurrentSaturationWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Check Saturation attribute value matched the value sent by the last attribute Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + VerifyOrReturn(CheckConstraintType("currentSaturation", "", "uint8")); + if (value != nil) { + VerifyOrReturn(CheckConstraintMinValue("currentSaturation", [value unsignedCharValue], 0)); + } + if (value != nil) { + VerifyOrReturn(CheckConstraintMaxValue("currentSaturation", [value unsignedCharValue], 254)); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestMoveColorCommand_15() + { + SetIdentity("alpha"); + CHIPDevice * device = GetConnectedDevice(); + CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + __auto_type * params = [[CHIPColorControlClusterMoveColorParams alloc] init]; + params.rateX = [NSNumber numberWithShort:15]; + params.rateY = [NSNumber numberWithShort:20]; + params.optionsMask = [NSNumber numberWithUnsignedChar:0]; + params.optionsOverride = [NSNumber numberWithUnsignedChar:0]; + [cluster moveColorWithParams:params + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Move Color command Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadsCurrentXAttributeFromDut_16() + { + SetIdentity("alpha"); + CHIPDevice * device = GetConnectedDevice(); + CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeCurrentXWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Reads CurrentX attribute from DUT Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + VerifyOrReturn(CheckConstraintType("currentX", "", "uint16")); + if (value != nil) { + VerifyOrReturn(CheckConstraintMinValue("currentX", [value unsignedShortValue], 0U)); + } + if (value != nil) { + VerifyOrReturn(CheckConstraintMaxValue("currentX", [value unsignedShortValue], 65279U)); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadsCurrentYAttributeFromDut_17() + { + SetIdentity("alpha"); + CHIPDevice * device = GetConnectedDevice(); + CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeCurrentYWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Reads CurrentY attribute from DUT Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + VerifyOrReturn(CheckConstraintType("currentY", "", "uint16")); + if (value != nil) { + VerifyOrReturn(CheckConstraintMinValue("currentY", [value unsignedShortValue], 0U)); + } + if (value != nil) { + VerifyOrReturn(CheckConstraintMaxValue("currentY", [value unsignedShortValue], 65279U)); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestStopMoveStepCommand_18() + { + SetIdentity("alpha"); + CHIPDevice * device = GetConnectedDevice(); + CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + __auto_type * params = [[CHIPColorControlClusterStopMoveStepParams alloc] init]; + params.optionsMask = [NSNumber numberWithUnsignedChar:0]; + params.optionsOverride = [NSNumber numberWithUnsignedChar:0]; + [cluster stopMoveStepWithParams:params + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Stop Move Step command Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); NextTest(); }]; @@ -13200,21 +14068,24 @@ class Test_TC_CC_8_1 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestCheckColorLoopDirectionValue_4() + CHIP_ERROR TestReadsCurrentXAttributeFromDut_19() { SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeColorLoopDirectionWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Check ColorLoopDirection Value Error: %@", err); + [cluster readAttributeCurrentXWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Reads CurrentX attribute from DUT Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); - { - id actualValue = value; - VerifyOrReturn(CheckValue("color loop direction", actualValue, 1)); + VerifyOrReturn(CheckConstraintType("currentX", "", "uint16")); + if (value != nil) { + VerifyOrReturn(CheckConstraintMinValue("currentX", [value unsignedShortValue], 0U)); + } + if (value != nil) { + VerifyOrReturn(CheckConstraintMaxValue("currentX", [value unsignedShortValue], 65279U)); } NextTest(); @@ -13223,21 +14094,24 @@ class Test_TC_CC_8_1 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestCheckColorLoopTimeValue_5() + CHIP_ERROR TestReadsCurrentYAttributeFromDut_20() { SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeColorLoopTimeWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Check ColorLoopTime Value Error: %@", err); + [cluster readAttributeCurrentYWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Reads CurrentY attribute from DUT Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); - { - id actualValue = value; - VerifyOrReturn(CheckValue("color loop time", actualValue, 100U)); + VerifyOrReturn(CheckConstraintType("currentY", "", "uint16")); + if (value != nil) { + VerifyOrReturn(CheckConstraintMinValue("currentY", [value unsignedShortValue], 0U)); + } + if (value != nil) { + VerifyOrReturn(CheckConstraintMaxValue("currentY", [value unsignedShortValue], 65279U)); } NextTest(); @@ -13246,45 +14120,57 @@ class Test_TC_CC_8_1 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestCheckColorLoopStartEnhancedHueValue_6() + CHIP_ERROR TestWait100ms_21() + { + SetIdentity("alpha"); + WaitForMs(100); + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestCheckCurrentXAttributeValueMatchedTheValueSentByTheLastAttribute_22() { SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster - readAttributeColorLoopStartEnhancedHueWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Check ColorLoopStartEnhancedHue Value Error: %@", err); + [cluster readAttributeCurrentXWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Check current x attribute value matched the value sent by the last attribute Error: %@", err); - VerifyOrReturn(CheckValue("status", err, 0)); + VerifyOrReturn(CheckValue("status", err, 0)); - { - id actualValue = value; - VerifyOrReturn(CheckValue("color loop start enhanced hue", actualValue, 500U)); - } + VerifyOrReturn(CheckConstraintType("currentX", "", "uint16")); + if (value != nil) { + VerifyOrReturn(CheckConstraintMinValue("currentX", [value unsignedShortValue], 0U)); + } + if (value != nil) { + VerifyOrReturn(CheckConstraintMaxValue("currentX", [value unsignedShortValue], 65279U)); + } - NextTest(); - }]; + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestCheckColorLoopActiveValue_7() + CHIP_ERROR TestCheckCurrentYAttributeValueMatchedTheValueSentByTheLastAttribute_23() { SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeColorLoopActiveWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Check ColorLoopActive Value Error: %@", err); + [cluster readAttributeCurrentYWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Check current y attribute value matched the value sent by the last attribute Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); - { - id actualValue = value; - VerifyOrReturn(CheckValue("color loop active", actualValue, 0)); + VerifyOrReturn(CheckConstraintType("currentY", "", "uint16")); + if (value != nil) { + VerifyOrReturn(CheckConstraintMinValue("currentY", [value unsignedShortValue], 0U)); + } + if (value != nil) { + VerifyOrReturn(CheckConstraintMaxValue("currentY", [value unsignedShortValue], 65279U)); } NextTest(); @@ -13293,48 +14179,50 @@ class Test_TC_CC_8_1 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestColorLoopSetCommandStartColorLoop_8() + CHIP_ERROR TestMoveUpColorTemperatureCommand_24() { SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - __auto_type * params = [[CHIPColorControlClusterColorLoopSetParams alloc] init]; - params.updateFlags = [NSNumber numberWithUnsignedChar:1]; - params.action = [NSNumber numberWithUnsignedChar:1]; - params.direction = [NSNumber numberWithUnsignedChar:0]; - params.time = [NSNumber numberWithUnsignedShort:0U]; - params.startHue = [NSNumber numberWithUnsignedShort:0U]; + __auto_type * params = [[CHIPColorControlClusterMoveColorTemperatureParams alloc] init]; + params.moveMode = [NSNumber numberWithUnsignedChar:1]; + params.rate = [NSNumber numberWithUnsignedShort:10U]; + params.colorTemperatureMinimum = [NSNumber numberWithUnsignedShort:1U]; + params.colorTemperatureMaximum = [NSNumber numberWithUnsignedShort:255U]; params.optionsMask = [NSNumber numberWithUnsignedChar:0]; params.optionsOverride = [NSNumber numberWithUnsignedChar:0]; - [cluster colorLoopSetWithParams:params - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Color Loop Set Command - Start Color Loop Error: %@", err); + [cluster moveColorTemperatureWithParams:params + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Move up color temperature command Error: %@", err); - VerifyOrReturn(CheckValue("status", err, 0)); + VerifyOrReturn(CheckValue("status", err, 0)); - NextTest(); - }]; + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestCheckColorLoopActiveValue_9() + CHIP_ERROR TestReadsCurrentColorTempratureFromDut_25() { SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeColorLoopActiveWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Check ColorLoopActive Value Error: %@", err); + [cluster readAttributeColorTemperatureWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Reads current color temprature from DUT Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); - { - id actualValue = value; - VerifyOrReturn(CheckValue("color loop active", actualValue, 1)); + VerifyOrReturn(CheckConstraintType("colorTemperature", "", "uint16")); + if (value != nil) { + VerifyOrReturn(CheckConstraintMinValue("colorTemperature", [value unsignedShortValue], 0U)); + } + if (value != nil) { + VerifyOrReturn(CheckConstraintMaxValue("colorTemperature", [value unsignedShortValue], 65279U)); } NextTest(); @@ -13343,24 +14231,19 @@ class Test_TC_CC_8_1 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestColorLoopSetCommandSetDirectionAndTimeWhileRunning_10() + CHIP_ERROR TestStopMoveStepCommand_26() { SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - __auto_type * params = [[CHIPColorControlClusterColorLoopSetParams alloc] init]; - params.updateFlags = [NSNumber numberWithUnsignedChar:6]; - params.action = [NSNumber numberWithUnsignedChar:0]; - params.direction = [NSNumber numberWithUnsignedChar:0]; - params.time = [NSNumber numberWithUnsignedShort:3500U]; - params.startHue = [NSNumber numberWithUnsignedShort:0U]; + __auto_type * params = [[CHIPColorControlClusterStopMoveStepParams alloc] init]; params.optionsMask = [NSNumber numberWithUnsignedChar:0]; params.optionsOverride = [NSNumber numberWithUnsignedChar:0]; - [cluster colorLoopSetWithParams:params + [cluster stopMoveStepWithParams:params completionHandler:^(NSError * _Nullable err) { - NSLog(@"Color Loop Set Command - Set direction and time while running Error: %@", err); + NSLog(@"Stop Move Step command Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); @@ -13370,21 +14253,24 @@ class Test_TC_CC_8_1 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestCheckColorLoopDirectionValue_11() + CHIP_ERROR TestReadsCurrentColorTempratureFromDut_27() { SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeColorLoopDirectionWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Check ColorLoopDirection Value Error: %@", err); + [cluster readAttributeColorTemperatureWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Reads current color temprature from DUT Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); - { - id actualValue = value; - VerifyOrReturn(CheckValue("color loop direction", actualValue, 0)); + VerifyOrReturn(CheckConstraintType("colorTemperature", "", "uint16")); + if (value != nil) { + VerifyOrReturn(CheckConstraintMinValue("colorTemperature", [value unsignedShortValue], 0U)); + } + if (value != nil) { + VerifyOrReturn(CheckConstraintMaxValue("colorTemperature", [value unsignedShortValue], 65279U)); } NextTest(); @@ -13393,21 +14279,31 @@ class Test_TC_CC_8_1 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestCheckColorLoopTimeValue_12() + CHIP_ERROR TestWait100ms_28() + { + SetIdentity("alpha"); + WaitForMs(100); + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadsCurrentColorAttributeValueMatchedTheValueSentByTheLastAttribute_29() { SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeColorLoopTimeWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Check ColorLoopTime Value Error: %@", err); + [cluster readAttributeColorTemperatureWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Reads current color attribute value matched the value sent by the last attribute Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); - { - id actualValue = value; - VerifyOrReturn(CheckValue("color loop time", actualValue, 3500U)); + VerifyOrReturn(CheckConstraintType("colorTemperature", "", "uint16")); + if (value != nil) { + VerifyOrReturn(CheckConstraintMinValue("colorTemperature", [value unsignedShortValue], 0U)); + } + if (value != nil) { + VerifyOrReturn(CheckConstraintMaxValue("colorTemperature", [value unsignedShortValue], 65279U)); } NextTest(); @@ -13416,24 +14312,69 @@ class Test_TC_CC_8_1 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestColorLoopSetCommandSetDirectionWhileRunning_13() + CHIP_ERROR TestEnhancedMoveHueUpCommand_30() { SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - __auto_type * params = [[CHIPColorControlClusterColorLoopSetParams alloc] init]; - params.updateFlags = [NSNumber numberWithUnsignedChar:2]; - params.action = [NSNumber numberWithUnsignedChar:0]; - params.direction = [NSNumber numberWithUnsignedChar:1]; - params.time = [NSNumber numberWithUnsignedShort:0U]; - params.startHue = [NSNumber numberWithUnsignedShort:0U]; + __auto_type * params = [[CHIPColorControlClusterEnhancedMoveHueParams alloc] init]; + params.moveMode = [NSNumber numberWithUnsignedChar:1]; + params.rate = [NSNumber numberWithUnsignedShort:50U]; params.optionsMask = [NSNumber numberWithUnsignedChar:0]; params.optionsOverride = [NSNumber numberWithUnsignedChar:0]; - [cluster colorLoopSetWithParams:params + [cluster enhancedMoveHueWithParams:params + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Enhanced Move Hue Up command Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadsEnhancedCurrentHueAttributeValueFromDut_31() + { + SetIdentity("alpha"); + CHIPDevice * device = GetConnectedDevice(); + CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeEnhancedCurrentHueWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Reads EnhancedCurrentHue attribute value from DUT Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + VerifyOrReturn(CheckConstraintType("enhancedCurrentHue", "", "uint16")); + if (value != nil) { + VerifyOrReturn(CheckConstraintMinValue("enhancedCurrentHue", [value unsignedShortValue], 0U)); + } + if (value != nil) { + VerifyOrReturn(CheckConstraintMaxValue("enhancedCurrentHue", [value unsignedShortValue], 65535U)); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestStopMoveStepCommand_32() + { + SetIdentity("alpha"); + CHIPDevice * device = GetConnectedDevice(); + CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + __auto_type * params = [[CHIPColorControlClusterStopMoveStepParams alloc] init]; + params.optionsMask = [NSNumber numberWithUnsignedChar:0]; + params.optionsOverride = [NSNumber numberWithUnsignedChar:0]; + [cluster stopMoveStepWithParams:params completionHandler:^(NSError * _Nullable err) { - NSLog(@"Color Loop Set Command - Set direction while running Error: %@", err); + NSLog(@"Stop Move Step command Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); @@ -13443,21 +14384,57 @@ class Test_TC_CC_8_1 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestCheckColorLoopDirectionValue_14() + CHIP_ERROR TestReadsEnhancedCurrentHueAttributeValueFromDut_33() { SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeColorLoopDirectionWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Check ColorLoopDirection Value Error: %@", err); + [cluster readAttributeEnhancedCurrentHueWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Reads EnhancedCurrentHue attribute value from DUT Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); - { - id actualValue = value; - VerifyOrReturn(CheckValue("color loop direction", actualValue, 1)); + VerifyOrReturn(CheckConstraintType("enhancedCurrentHue", "", "uint16")); + if (value != nil) { + VerifyOrReturn(CheckConstraintMinValue("enhancedCurrentHue", [value unsignedShortValue], 0U)); + } + if (value != nil) { + VerifyOrReturn(CheckConstraintMaxValue("enhancedCurrentHue", [value unsignedShortValue], 65535U)); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestWait100ms_34() + { + SetIdentity("alpha"); + WaitForMs(100); + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestCheckEnhancedCurrentHueAttributeValueMatchedTheValueSentByTheLastAttribute_35() + { + SetIdentity("alpha"); + CHIPDevice * device = GetConnectedDevice(); + CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeEnhancedCurrentHueWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Check EnhancedCurrentHue attribute value matched the value sent by the last attribute Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + VerifyOrReturn(CheckConstraintType("enhancedCurrentHue", "", "uint16")); + if (value != nil) { + VerifyOrReturn(CheckConstraintMinValue("enhancedCurrentHue", [value unsignedShortValue], 0U)); + } + if (value != nil) { + VerifyOrReturn(CheckConstraintMaxValue("enhancedCurrentHue", [value unsignedShortValue], 65535U)); } NextTest(); @@ -13466,7 +14443,7 @@ class Test_TC_CC_8_1 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestTurnOffLightThatWeTurnedOn_15() + CHIP_ERROR TestTurnOffLightThatWeTurnedOn_36() { SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); @@ -13484,7 +14461,7 @@ class Test_TC_CC_8_1 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestCheckOnOffAttributeValueIsFalseAfterOffCommand_16() + CHIP_ERROR TestCheckOnOffAttributeValueIsFalseAfterOffCommand_37() { SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); diff --git a/zzz_generated/chip-tool/zap-generated/test/Commands.h b/zzz_generated/chip-tool/zap-generated/test/Commands.h index 27926edda135bb..128baf07afa272 100644 --- a/zzz_generated/chip-tool/zap-generated/test/Commands.h +++ b/zzz_generated/chip-tool/zap-generated/test/Commands.h @@ -4796,7 +4796,7 @@ class Test_TC_CC_3_2Suite : public TestCommand class Test_TC_CC_3_3Suite : public TestCommand { public: - Test_TC_CC_3_3Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_CC_3_3", 7, credsIssuerConfig) + Test_TC_CC_3_3Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_CC_3_3", 12, credsIssuerConfig) { AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); AddArgument("cluster", &mCluster); @@ -4846,14 +4846,52 @@ class Test_TC_CC_3_3Suite : public TestCommand 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", "", "uint8")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 254)); + } 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(CheckConstraintType("value", "", "uint8")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 254)); + } + 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(CheckConstraintType("value", "", "uint8")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 254)); + } + break; + case 10: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 11: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); { bool value; @@ -4891,7 +4929,11 @@ class Test_TC_CC_3_3Suite : public TestCommand return ReadAttribute(kIdentityAlpha, GetEndpoint(1), OnOff::Id, OnOff::Attributes::OnOff::Id); } case 3: { - LogStep(3, "Step hue up command"); + LogStep(3, "Reads CurrentHue attribute from DUT"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Attributes::CurrentHue::Id); + } + case 4: { + LogStep(4, "Step hue up command"); chip::app::Clusters::ColorControl::Commands::StepHue::Type value; value.stepMode = static_cast(1); value.stepSize = 5; @@ -4900,8 +4942,17 @@ class Test_TC_CC_3_3Suite : public TestCommand value.optionsOverride = 0; return SendCommand(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Commands::StepHue::Id, value); } - case 4: { - LogStep(4, "Step hue down command"); + case 5: { + LogStep(5, "Wait 25ms"); + SetIdentity(kIdentityAlpha); + return WaitForMs(25); + } + case 6: { + LogStep(6, "Over TransitionTime,Read CurrentHue attribute from DUT"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Attributes::CurrentHue::Id); + } + case 7: { + LogStep(7, "Step hue down command"); chip::app::Clusters::ColorControl::Commands::StepHue::Type value; value.stepMode = static_cast(3); value.stepSize = 5; @@ -4910,13 +4961,22 @@ class Test_TC_CC_3_3Suite : public TestCommand value.optionsOverride = 0; return SendCommand(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Commands::StepHue::Id, value); } - case 5: { - LogStep(5, "Turn off light that we turned on"); + case 8: { + LogStep(8, "Wait 25ms"); + SetIdentity(kIdentityAlpha); + return WaitForMs(25); + } + case 9: { + LogStep(9, "Over TransitionTime,Read CurrentHue attribute from DUT"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Attributes::CurrentHue::Id); + } + case 10: { + LogStep(10, "Turn off light that we turned on"); chip::app::Clusters::OnOff::Commands::Off::Type value; return SendCommand(kIdentityAlpha, GetEndpoint(1), OnOff::Id, OnOff::Commands::Off::Id, value); } - case 6: { - LogStep(6, "Check on/off attribute value is false after off command"); + case 11: { + LogStep(11, "Check on/off attribute value is false after off command"); return ReadAttribute(kIdentityAlpha, GetEndpoint(1), OnOff::Id, OnOff::Attributes::OnOff::Id); } } @@ -5222,7 +5282,7 @@ class Test_TC_CC_4_2Suite : public TestCommand class Test_TC_CC_4_3Suite : public TestCommand { public: - Test_TC_CC_4_3Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_CC_4_3", 7, credsIssuerConfig) + Test_TC_CC_4_3Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_CC_4_3", 12, credsIssuerConfig) { AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); AddArgument("cluster", &mCluster); @@ -5272,14 +5332,52 @@ class Test_TC_CC_4_3Suite : public TestCommand 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", "", "uint8")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 254)); + } 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(CheckConstraintType("value", "", "uint8")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 254)); + } + 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(CheckConstraintType("value", "", "uint8")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 254)); + } + break; + case 10: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 11: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); { bool value; @@ -5317,7 +5415,11 @@ class Test_TC_CC_4_3Suite : public TestCommand return ReadAttribute(kIdentityAlpha, GetEndpoint(1), OnOff::Id, OnOff::Attributes::OnOff::Id); } case 3: { - LogStep(3, "Step saturation up command"); + LogStep(3, "Reads CurrentSaturation attribute from DUT"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Attributes::CurrentSaturation::Id); + } + case 4: { + LogStep(4, "Step saturation up command"); chip::app::Clusters::ColorControl::Commands::StepSaturation::Type value; value.stepMode = static_cast(1); value.stepSize = 15; @@ -5326,8 +5428,17 @@ class Test_TC_CC_4_3Suite : public TestCommand value.optionsOverride = 0; return SendCommand(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Commands::StepSaturation::Id, value); } - case 4: { - LogStep(4, "Step saturation down command"); + case 5: { + LogStep(5, "Wait 10ms"); + SetIdentity(kIdentityAlpha); + return WaitForMs(10); + } + case 6: { + LogStep(6, "Over TransitionTime,Read CurrentSaturation attribute from DUT"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Attributes::CurrentSaturation::Id); + } + case 7: { + LogStep(7, "Step saturation down command"); chip::app::Clusters::ColorControl::Commands::StepSaturation::Type value; value.stepMode = static_cast(3); value.stepSize = 20; @@ -5336,13 +5447,22 @@ class Test_TC_CC_4_3Suite : public TestCommand value.optionsOverride = 0; return SendCommand(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Commands::StepSaturation::Id, value); } - case 5: { - LogStep(5, "Turn off light that we turned on"); + case 8: { + LogStep(8, "Wait 10ms"); + SetIdentity(kIdentityAlpha); + return WaitForMs(10); + } + case 9: { + LogStep(9, "Over TransitionTime,Reads CurrentSaturation attribute from DUT"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Attributes::CurrentSaturation::Id); + } + case 10: { + LogStep(10, "Turn off light that we turned on"); chip::app::Clusters::OnOff::Commands::Off::Type value; return SendCommand(kIdentityAlpha, GetEndpoint(1), OnOff::Id, OnOff::Commands::Off::Id, value); } - case 6: { - LogStep(6, "Check on/off attribute value is false after off command"); + case 11: { + LogStep(11, "Check on/off attribute value is false after off command"); return ReadAttribute(kIdentityAlpha, GetEndpoint(1), OnOff::Id, OnOff::Attributes::OnOff::Id); } } @@ -6646,7 +6766,7 @@ class Test_TC_CC_7_2Suite : public TestCommand class Test_TC_CC_7_3Suite : public TestCommand { public: - Test_TC_CC_7_3Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_CC_7_3", 7, credsIssuerConfig) + Test_TC_CC_7_3Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_CC_7_3", 12, credsIssuerConfig) { AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); AddArgument("cluster", &mCluster); @@ -6696,14 +6816,52 @@ class Test_TC_CC_7_3Suite : public TestCommand 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", "", "uint16")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 65535U)); + } 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(CheckConstraintType("value", "", "uint16")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 65535U)); + } + 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", "", "uint16")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 65535U)); + } + break; + case 10: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 11: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); { bool value; @@ -6741,7 +6899,12 @@ class Test_TC_CC_7_3Suite : public TestCommand return ReadAttribute(kIdentityAlpha, GetEndpoint(1), OnOff::Id, OnOff::Attributes::OnOff::Id); } case 3: { - LogStep(3, "Enhanced Step Hue Up command"); + LogStep(3, "Reads EnhancedCurrentHue attribute from DUT"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, + ColorControl::Attributes::EnhancedCurrentHue::Id); + } + case 4: { + LogStep(4, "Enhanced Step Hue Up command"); chip::app::Clusters::ColorControl::Commands::EnhancedStepHue::Type value; value.stepMode = static_cast(0); value.stepSize = 50U; @@ -6751,8 +6914,18 @@ class Test_TC_CC_7_3Suite : public TestCommand return SendCommand(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Commands::EnhancedStepHue::Id, value); } - case 4: { - LogStep(4, "Enhanced Step Hue Down command"); + case 5: { + LogStep(5, "Wait 10ms"); + SetIdentity(kIdentityAlpha); + return WaitForMs(10); + } + case 6: { + LogStep(6, "Over TransitionTime,Read EnhancedCurrentHue attribute from DUT"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, + ColorControl::Attributes::EnhancedCurrentHue::Id); + } + case 7: { + LogStep(7, "Enhanced Step Hue Down command"); chip::app::Clusters::ColorControl::Commands::EnhancedStepHue::Type value; value.stepMode = static_cast(1); value.stepSize = 75U; @@ -6762,13 +6935,23 @@ class Test_TC_CC_7_3Suite : public TestCommand return SendCommand(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Commands::EnhancedStepHue::Id, value); } - case 5: { - LogStep(5, "Turn off light that we turned on"); + case 8: { + LogStep(8, "Wait 10ms"); + SetIdentity(kIdentityAlpha); + return WaitForMs(10); + } + case 9: { + LogStep(9, "Over TransitionTime,Read EnhancedCurrentHue attribute from DUT"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, + ColorControl::Attributes::EnhancedCurrentHue::Id); + } + case 10: { + LogStep(10, "Turn off light that we turned on"); chip::app::Clusters::OnOff::Commands::Off::Type value; return SendCommand(kIdentityAlpha, GetEndpoint(1), OnOff::Id, OnOff::Commands::Off::Id, value); } - case 6: { - LogStep(6, "Check on/off attribute value is false after off command"); + case 11: { + LogStep(11, "Check on/off attribute value is false after off command"); return ReadAttribute(kIdentityAlpha, GetEndpoint(1), OnOff::Id, OnOff::Attributes::OnOff::Id); } } @@ -6898,7 +7081,7 @@ class Test_TC_CC_7_4Suite : public TestCommand class Test_TC_CC_8_1Suite : public TestCommand { public: - Test_TC_CC_8_1Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_CC_8_1", 17, credsIssuerConfig) + Test_TC_CC_8_1Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_CC_8_1", 38, credsIssuerConfig) { AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); AddArgument("cluster", &mCluster); @@ -6954,72 +7137,76 @@ class Test_TC_CC_8_1Suite : public TestCommand { uint8_t value; VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); - VerifyOrReturn(CheckValue("colorLoopDirection", value, 1)); + VerifyOrReturn(CheckConstraintType("value", "", "uint8")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 254)); } 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("colorLoopTime", value, 100U)); - } break; case 6: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); { - uint16_t value; + uint8_t value; VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); - VerifyOrReturn(CheckValue("colorLoopStartEnhancedHue", value, 500U)); + VerifyOrReturn(CheckConstraintType("value", "", "uint8")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 254)); } 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("colorLoopActive", value, 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)); { uint8_t value; VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); - VerifyOrReturn(CheckValue("colorLoopActive", value, 1)); + VerifyOrReturn(CheckConstraintType("value", "", "uint8")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 254)); } break; - case 10: + case 9: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; - case 11: + case 10: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); { uint8_t value; VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); - VerifyOrReturn(CheckValue("colorLoopDirection", value, 0)); + VerifyOrReturn(CheckConstraintType("value", "", "uint8")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 254)); } 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; + uint8_t value; VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); - VerifyOrReturn(CheckValue("colorLoopTime", value, 3500U)); + VerifyOrReturn(CheckConstraintType("value", "", "uint8")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 254)); } 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("colorLoopDirection", value, 1)); + VerifyOrReturn(CheckConstraintType("value", "", "uint8")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 254)); } break; case 15: @@ -7028,22 +7215,172 @@ class Test_TC_CC_8_1Suite : public TestCommand case 16: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); { - bool value; + uint16_t value; VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); - VerifyOrReturn(CheckValue("onOff", value, 0)); + VerifyOrReturn(CheckConstraintType("value", "", "uint16")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 65279U)); } break; - default: - LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); - } - - if (shouldContinue) - { - ContinueOnChipMainThread(CHIP_NO_ERROR); - } - } - - CHIP_ERROR DoTestStep(uint16_t testIndex) override + 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", "", "uint16")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 65279U)); + } + 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(CheckConstraintType("value", "", "uint16")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 65279U)); + } + 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", "", "uint16")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 65279U)); + } + 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(CheckConstraintType("value", "", "uint16")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 65279U)); + } + 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", "", "uint16")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 65279U)); + } + 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(CheckConstraintType("value", "", "uint16")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 65279U)); + } + break; + case 26: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 27: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint16_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "", "uint16")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 65279U)); + } + 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(CheckConstraintType("value", "", "uint16")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 65279U)); + } + break; + case 30: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 31: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint16_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "", "uint16")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 65535U)); + } + break; + case 32: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 33: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint16_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "", "uint16")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 65535U)); + } + 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(CheckConstraintType("value", "", "uint16")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 65535U)); + } + break; + case 36: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 37: + 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) @@ -7063,96 +7400,196 @@ class Test_TC_CC_8_1Suite : public TestCommand return ReadAttribute(kIdentityAlpha, GetEndpoint(1), OnOff::Id, OnOff::Attributes::OnOff::Id); } case 3: { - LogStep(3, "Color Loop Set Command - Set all Attributes"); - chip::app::Clusters::ColorControl::Commands::ColorLoopSet::Type value; - value.updateFlags = static_cast>(14); - value.action = static_cast(0); - value.direction = static_cast(1); - value.time = 100U; - value.startHue = 500U; + LogStep(3, "Move hue up command"); + chip::app::Clusters::ColorControl::Commands::MoveHue::Type value; + value.moveMode = static_cast(1); + value.rate = 50; value.optionsMask = 0; value.optionsOverride = 0; - return SendCommand(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Commands::ColorLoopSet::Id, value); + return SendCommand(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Commands::MoveHue::Id, value); } case 4: { - LogStep(4, "Check ColorLoopDirection Value"); - return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, - ColorControl::Attributes::ColorLoopDirection::Id); + LogStep(4, "Reads CurrentHue attribute from DUT"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Attributes::CurrentHue::Id); } case 5: { - LogStep(5, "Check ColorLoopTime Value"); - return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Attributes::ColorLoopTime::Id); + LogStep(5, "Stop Move Step command"); + chip::app::Clusters::ColorControl::Commands::StopMoveStep::Type value; + value.optionsMask = 0; + value.optionsOverride = 0; + return SendCommand(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Commands::StopMoveStep::Id, value); } case 6: { - LogStep(6, "Check ColorLoopStartEnhancedHue Value"); - return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, - ColorControl::Attributes::ColorLoopStartEnhancedHue::Id); + LogStep(6, "Reads CurrentHue attribute from DUT"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Attributes::CurrentHue::Id); } case 7: { - LogStep(7, "Check ColorLoopActive Value"); - return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Attributes::ColorLoopActive::Id); + LogStep(7, "Wait 100ms"); + SetIdentity(kIdentityAlpha); + return WaitForMs(100); } case 8: { - LogStep(8, "Color Loop Set Command - Start Color Loop"); - chip::app::Clusters::ColorControl::Commands::ColorLoopSet::Type value; - value.updateFlags = static_cast>(1); - value.action = static_cast(1); - value.direction = static_cast(0); - value.time = 0U; - value.startHue = 0U; - value.optionsMask = 0; - value.optionsOverride = 0; - return SendCommand(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Commands::ColorLoopSet::Id, value); + LogStep(8, "Check current hue attribute value matched the value sent by the last attribute"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Attributes::CurrentHue::Id); } case 9: { - LogStep(9, "Check ColorLoopActive Value"); - return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Attributes::ColorLoopActive::Id); - } - case 10: { - LogStep(10, "Color Loop Set Command - Set direction and time while running"); - chip::app::Clusters::ColorControl::Commands::ColorLoopSet::Type value; - value.updateFlags = static_cast>(6); - value.action = static_cast(0); - value.direction = static_cast(0); - value.time = 3500U; - value.startHue = 0U; + LogStep(9, "Move saturation up command"); + chip::app::Clusters::ColorControl::Commands::MoveSaturation::Type value; + value.moveMode = static_cast(1); + value.rate = 5; value.optionsMask = 0; value.optionsOverride = 0; - return SendCommand(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Commands::ColorLoopSet::Id, value); + return SendCommand(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Commands::MoveSaturation::Id, value); + } + case 10: { + LogStep(10, "Check Saturation attribute value matched the value sent by the last command"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Attributes::CurrentSaturation::Id); } case 11: { - LogStep(11, "Check ColorLoopDirection Value"); - return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, - ColorControl::Attributes::ColorLoopDirection::Id); + LogStep(11, "Stop Move Step command"); + chip::app::Clusters::ColorControl::Commands::StopMoveStep::Type value; + value.optionsMask = 0; + value.optionsOverride = 0; + return SendCommand(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Commands::StopMoveStep::Id, value); } case 12: { - LogStep(12, "Check ColorLoopTime Value"); - return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Attributes::ColorLoopTime::Id); + LogStep(12, "Reads CurrentSaturation attribute from DUT."); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Attributes::CurrentSaturation::Id); } case 13: { - LogStep(13, "Color Loop Set Command - Set direction while running"); - chip::app::Clusters::ColorControl::Commands::ColorLoopSet::Type value; - value.updateFlags = static_cast>(2); - value.action = static_cast(0); - value.direction = static_cast(1); - value.time = 0U; - value.startHue = 0U; + LogStep(13, "Wait 100ms"); + SetIdentity(kIdentityAlpha); + return WaitForMs(100); + } + case 14: { + LogStep(14, "Check Saturation attribute value matched the value sent by the last attribute"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Attributes::CurrentSaturation::Id); + } + case 15: { + LogStep(15, "Move Color command"); + chip::app::Clusters::ColorControl::Commands::MoveColor::Type value; + value.rateX = 15; + value.rateY = 20; value.optionsMask = 0; value.optionsOverride = 0; - return SendCommand(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Commands::ColorLoopSet::Id, value); + return SendCommand(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Commands::MoveColor::Id, value); } - case 14: { - LogStep(14, "Check ColorLoopDirection Value"); + case 16: { + LogStep(16, "Reads CurrentX attribute from DUT"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Attributes::CurrentX::Id); + } + case 17: { + LogStep(17, "Reads CurrentY attribute from DUT"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Attributes::CurrentY::Id); + } + case 18: { + LogStep(18, "Stop Move Step command"); + chip::app::Clusters::ColorControl::Commands::StopMoveStep::Type value; + value.optionsMask = 0; + value.optionsOverride = 0; + return SendCommand(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Commands::StopMoveStep::Id, value); + } + case 19: { + LogStep(19, "Reads CurrentX attribute from DUT"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Attributes::CurrentX::Id); + } + case 20: { + LogStep(20, "Reads CurrentY attribute from DUT"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Attributes::CurrentY::Id); + } + case 21: { + LogStep(21, "Wait 100ms"); + SetIdentity(kIdentityAlpha); + return WaitForMs(100); + } + case 22: { + LogStep(22, "Check current x attribute value matched the value sent by the last attribute"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Attributes::CurrentX::Id); + } + case 23: { + LogStep(23, "Check current y attribute value matched the value sent by the last attribute"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Attributes::CurrentY::Id); + } + case 24: { + LogStep(24, "Move up color temperature command"); + chip::app::Clusters::ColorControl::Commands::MoveColorTemperature::Type value; + value.moveMode = static_cast(1); + value.rate = 10U; + value.colorTemperatureMinimum = 1U; + value.colorTemperatureMaximum = 255U; + value.optionsMask = 0; + value.optionsOverride = 0; + return SendCommand(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Commands::MoveColorTemperature::Id, + value); + } + case 25: { + LogStep(25, "Reads current color temprature from DUT"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Attributes::ColorTemperature::Id); + } + case 26: { + LogStep(26, "Stop Move Step command"); + chip::app::Clusters::ColorControl::Commands::StopMoveStep::Type value; + value.optionsMask = 0; + value.optionsOverride = 0; + return SendCommand(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Commands::StopMoveStep::Id, value); + } + case 27: { + LogStep(27, "Reads current color temprature from DUT"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Attributes::ColorTemperature::Id); + } + case 28: { + LogStep(28, "Wait 100ms"); + SetIdentity(kIdentityAlpha); + return WaitForMs(100); + } + case 29: { + LogStep(29, "Reads current color attribute value matched the value sent by the last attribute"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Attributes::ColorTemperature::Id); + } + case 30: { + LogStep(30, "Enhanced Move Hue Up command"); + chip::app::Clusters::ColorControl::Commands::EnhancedMoveHue::Type value; + value.moveMode = static_cast(1); + value.rate = 50U; + value.optionsMask = 0; + value.optionsOverride = 0; + return SendCommand(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Commands::EnhancedMoveHue::Id, + value); + } + case 31: { + LogStep(31, "Reads EnhancedCurrentHue attribute value from DUT"); return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, - ColorControl::Attributes::ColorLoopDirection::Id); + ColorControl::Attributes::EnhancedCurrentHue::Id); } - case 15: { - LogStep(15, "Turn off light that we turned on"); + case 32: { + LogStep(32, "Stop Move Step command"); + chip::app::Clusters::ColorControl::Commands::StopMoveStep::Type value; + value.optionsMask = 0; + value.optionsOverride = 0; + return SendCommand(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Commands::StopMoveStep::Id, value); + } + case 33: { + LogStep(33, "Reads EnhancedCurrentHue attribute value from DUT"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, + ColorControl::Attributes::EnhancedCurrentHue::Id); + } + case 34: { + LogStep(34, "Wait 100ms"); + SetIdentity(kIdentityAlpha); + return WaitForMs(100); + } + case 35: { + LogStep(35, "Check EnhancedCurrentHue attribute value matched the value sent by the last attribute"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, + ColorControl::Attributes::EnhancedCurrentHue::Id); + } + case 36: { + LogStep(36, "Turn off light that we turned on"); chip::app::Clusters::OnOff::Commands::Off::Type value; return SendCommand(kIdentityAlpha, GetEndpoint(1), OnOff::Id, OnOff::Commands::Off::Id, value); } - case 16: { - LogStep(16, "Check on/off attribute value is false after off command"); + case 37: { + LogStep(37, "Check on/off attribute value is false after off command"); return ReadAttribute(kIdentityAlpha, GetEndpoint(1), OnOff::Id, OnOff::Attributes::OnOff::Id); } }