diff --git a/zzz_generated/chip-tool/zap-generated/test/Commands.h b/zzz_generated/chip-tool/zap-generated/test/Commands.h index e79750b7dd8437..0c3bfeb6f98e8d 100644 --- a/zzz_generated/chip-tool/zap-generated/test/Commands.h +++ b/zzz_generated/chip-tool/zap-generated/test/Commands.h @@ -21,10 +21,10 @@ #include -class TV_TargetNavigatorCluster : public TestCommand +class Test_TC_OO_1_1 : public TestCommand { public: - TV_TargetNavigatorCluster() : TestCommand("TV_TargetNavigatorCluster"), mTestIndex(0) {} + Test_TC_OO_1_1() : TestCommand("Test_TC_OO_1_1"), mTestIndex(0) {} /////////// TestCommand Interface ///////// void NextTest() override @@ -33,12 +33,12 @@ class TV_TargetNavigatorCluster : public TestCommand if (0 == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Start: TV_TargetNavigatorCluster\n"); + ChipLogProgress(chipTool, " **** Test Start: Test_TC_OO_1_1\n"); } if (mTestCount == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Complete: TV_TargetNavigatorCluster\n"); + ChipLogProgress(chipTool, " **** Test Complete: Test_TC_OO_1_1\n"); SetCommandExitStatus(CHIP_NO_ERROR); return; } @@ -50,12 +50,29 @@ class TV_TargetNavigatorCluster : public TestCommand switch (mTestIndex++) { case 0: - ChipLogProgress(chipTool, " ***** Test Step 0 : Read attribute Target Navigator list\n"); - err = TestReadAttributeTargetNavigatorList_0(); + ChipLogProgress(chipTool, " ***** Test Step 0 : read the global attribute: ClusterRevision\n"); + err = TestReadTheGlobalAttributeClusterRevision_0(); break; case 1: - ChipLogProgress(chipTool, " ***** Test Step 1 : Navigate Target Command\n"); - err = TestNavigateTargetCommand_1(); + ChipLogProgress(chipTool, + " ***** Test Step 1 : write the default values to mandatory global attribute: ClusterRevision\n"); + err = TestWriteTheDefaultValuesToMandatoryGlobalAttributeClusterRevision_1(); + break; + case 2: + ChipLogProgress(chipTool, " ***** Test Step 2 : reads back global attribute: ClusterRevision\n"); + err = TestReadsBackGlobalAttributeClusterRevision_2(); + break; + case 3: + ChipLogProgress(chipTool, " ***** Test Step 3 : read the optional global attribute: FeatureMap\n"); + err = TestReadTheOptionalGlobalAttributeFeatureMap_3(); + break; + case 4: + ChipLogProgress(chipTool, " ***** Test Step 4 : write the default values to optional global attribute: FeatureMap\n"); + err = TestWriteTheDefaultValuesToOptionalGlobalAttributeFeatureMap_4(); + break; + case 5: + ChipLogProgress(chipTool, " ***** Test Step 5 : reads back optional global attribute: FeatureMap\n"); + err = TestReadsBackOptionalGlobalAttributeFeatureMap_5(); break; } @@ -68,76 +85,183 @@ class TV_TargetNavigatorCluster : public TestCommand private: std::atomic_uint16_t mTestIndex; - const uint16_t mTestCount = 2; + const uint16_t mTestCount = 6; chip::Callback::Callback mOnFailureCallback_0{ OnFailureCallback_0, this }; - chip::Callback::Callback - mOnSuccessCallback_0{ OnSuccessCallback_0, this }; + chip::Callback::Callback mOnSuccessCallback_0{ OnSuccessCallback_0, this }; chip::Callback::Callback mOnFailureCallback_1{ OnFailureCallback_1, this }; - chip::Callback::Callback mOnSuccessCallback_1{ - OnSuccessCallback_1, this - }; + chip::Callback::Callback mOnSuccessCallback_1{ OnSuccessCallback_1, this }; + chip::Callback::Callback mOnFailureCallback_2{ OnFailureCallback_2, this }; + chip::Callback::Callback mOnSuccessCallback_2{ OnSuccessCallback_2, this }; + chip::Callback::Callback mOnFailureCallback_3{ OnFailureCallback_3, this }; + chip::Callback::Callback mOnSuccessCallback_3{ OnSuccessCallback_3, this }; + chip::Callback::Callback mOnFailureCallback_4{ OnFailureCallback_4, this }; + chip::Callback::Callback mOnSuccessCallback_4{ OnSuccessCallback_4, this }; + chip::Callback::Callback mOnFailureCallback_5{ OnFailureCallback_5, this }; + chip::Callback::Callback mOnSuccessCallback_5{ OnSuccessCallback_5, this }; static void OnFailureCallback_0(void * context, uint8_t status) { - (static_cast(context))->OnFailureResponse_0(status); + (static_cast(context))->OnFailureResponse_0(status); } - static void OnSuccessCallback_0(void * context, uint16_t count, _NavigateTargetTargetInfo * targetNavigatorList) + static void OnSuccessCallback_0(void * context, uint16_t clusterRevision) { - (static_cast(context))->OnSuccessResponse_0(count, targetNavigatorList); + (static_cast(context))->OnSuccessResponse_0(clusterRevision); } static void OnFailureCallback_1(void * context, uint8_t status) { - (static_cast(context))->OnFailureResponse_1(status); + (static_cast(context))->OnFailureResponse_1(status); } - static void OnSuccessCallback_1(void * context, uint8_t status, chip::ByteSpan data) + static void OnSuccessCallback_1(void * context, uint16_t clusterRevision) { - (static_cast(context))->OnSuccessResponse_1(status, data); + (static_cast(context))->OnSuccessResponse_1(clusterRevision); + } + + static void OnFailureCallback_2(void * context, uint8_t status) + { + (static_cast(context))->OnFailureResponse_2(status); + } + + static void OnSuccessCallback_2(void * context, uint16_t clusterRevision) + { + (static_cast(context))->OnSuccessResponse_2(clusterRevision); + } + + static void OnFailureCallback_3(void * context, uint8_t status) + { + (static_cast(context))->OnFailureResponse_3(status); + } + + static void OnSuccessCallback_3(void * context, uint32_t featureMap) + { + (static_cast(context))->OnSuccessResponse_3(featureMap); + } + + static void OnFailureCallback_4(void * context, uint8_t status) + { + (static_cast(context))->OnFailureResponse_4(status); + } + + static void OnSuccessCallback_4(void * context, uint32_t featureMap) + { + (static_cast(context))->OnSuccessResponse_4(featureMap); + } + + static void OnFailureCallback_5(void * context, uint8_t status) + { + (static_cast(context))->OnFailureResponse_5(status); + } + + static void OnSuccessCallback_5(void * context, uint32_t featureMap) + { + (static_cast(context))->OnSuccessResponse_5(featureMap); } // // Tests methods // - CHIP_ERROR TestReadAttributeTargetNavigatorList_0() + CHIP_ERROR TestReadTheGlobalAttributeClusterRevision_0() { - chip::Controller::TargetNavigatorClusterTest cluster; + chip::Controller::OnOffClusterTest cluster; cluster.Associate(mDevice, 1); - return cluster.ReadAttributeTargetNavigatorList(mOnSuccessCallback_0.Cancel(), mOnFailureCallback_0.Cancel()); + return cluster.ReadAttributeClusterRevision(mOnSuccessCallback_0.Cancel(), mOnFailureCallback_0.Cancel()); } void OnFailureResponse_0(uint8_t status) { ThrowFailureResponse(); } - void OnSuccessResponse_0(uint16_t count, _NavigateTargetTargetInfo * targetNavigatorList) + void OnSuccessResponse_0(uint16_t clusterRevision) { - VerifyOrReturn(CheckValueAsList("targetNavigatorList", count, 2)); + VerifyOrReturn(CheckValue("clusterRevision", clusterRevision, 3U)); NextTest(); } - CHIP_ERROR TestNavigateTargetCommand_1() + CHIP_ERROR TestWriteTheDefaultValuesToMandatoryGlobalAttributeClusterRevision_1() { - chip::Controller::TargetNavigatorClusterTest cluster; + chip::Controller::OnOffClusterTest cluster; cluster.Associate(mDevice, 1); - uint8_t targetArgument = 1; - chip::ByteSpan dataArgument = chip::ByteSpan(chip::Uint8::from_const_char("1"), strlen("1")); + uint16_t clusterRevisionArgument = 3U; - return cluster.NavigateTarget(mOnSuccessCallback_1.Cancel(), mOnFailureCallback_1.Cancel(), targetArgument, dataArgument); + return cluster.WriteAttributeClusterRevision(mOnSuccessCallback_1.Cancel(), mOnFailureCallback_1.Cancel(), + clusterRevisionArgument); } - void OnFailureResponse_1(uint8_t status) { ThrowFailureResponse(); } + void OnFailureResponse_1(uint8_t status) { NextTest(); } - void OnSuccessResponse_1(uint8_t status, chip::ByteSpan data) { NextTest(); } + void OnSuccessResponse_1(uint16_t clusterRevision) { ThrowSuccessResponse(); } + + CHIP_ERROR TestReadsBackGlobalAttributeClusterRevision_2() + { + chip::Controller::OnOffClusterTest cluster; + cluster.Associate(mDevice, 1); + + return cluster.ReadAttributeClusterRevision(mOnSuccessCallback_2.Cancel(), mOnFailureCallback_2.Cancel()); + } + + void OnFailureResponse_2(uint8_t status) { ThrowFailureResponse(); } + + void OnSuccessResponse_2(uint16_t clusterRevision) + { + VerifyOrReturn(CheckValue("clusterRevision", clusterRevision, 3U)); + NextTest(); + } + + CHIP_ERROR TestReadTheOptionalGlobalAttributeFeatureMap_3() + { + chip::Controller::OnOffClusterTest cluster; + cluster.Associate(mDevice, 1); + + return cluster.ReadAttributeFeatureMap(mOnSuccessCallback_3.Cancel(), mOnFailureCallback_3.Cancel()); + } + + void OnFailureResponse_3(uint8_t status) { ThrowFailureResponse(); } + + void OnSuccessResponse_3(uint32_t featureMap) + { + VerifyOrReturn(CheckValue("featureMap", featureMap, 0UL)); + NextTest(); + } + + CHIP_ERROR TestWriteTheDefaultValuesToOptionalGlobalAttributeFeatureMap_4() + { + chip::Controller::OnOffClusterTest cluster; + cluster.Associate(mDevice, 1); + + uint32_t featureMapArgument = 0UL; + + return cluster.WriteAttributeFeatureMap(mOnSuccessCallback_4.Cancel(), mOnFailureCallback_4.Cancel(), featureMapArgument); + } + + void OnFailureResponse_4(uint8_t status) { NextTest(); } + + void OnSuccessResponse_4(uint32_t featureMap) { ThrowSuccessResponse(); } + + CHIP_ERROR TestReadsBackOptionalGlobalAttributeFeatureMap_5() + { + chip::Controller::OnOffClusterTest cluster; + cluster.Associate(mDevice, 1); + + return cluster.ReadAttributeFeatureMap(mOnSuccessCallback_5.Cancel(), mOnFailureCallback_5.Cancel()); + } + + void OnFailureResponse_5(uint8_t status) { ThrowFailureResponse(); } + + void OnSuccessResponse_5(uint32_t featureMap) + { + VerifyOrReturn(CheckValue("featureMap", featureMap, 0UL)); + NextTest(); + } }; -class TV_AudioOutputCluster : public TestCommand +class Test_TC_OO_2_1 : public TestCommand { public: - TV_AudioOutputCluster() : TestCommand("TV_AudioOutputCluster"), mTestIndex(0) {} + Test_TC_OO_2_1() : TestCommand("Test_TC_OO_2_1"), mTestIndex(0) {} /////////// TestCommand Interface ///////// void NextTest() override @@ -146,12 +270,12 @@ class TV_AudioOutputCluster : public TestCommand if (0 == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Start: TV_AudioOutputCluster\n"); + ChipLogProgress(chipTool, " **** Test Start: Test_TC_OO_2_1\n"); } if (mTestCount == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Complete: TV_AudioOutputCluster\n"); + ChipLogProgress(chipTool, " **** Test Complete: Test_TC_OO_2_1\n"); SetCommandExitStatus(CHIP_NO_ERROR); return; } @@ -163,16 +287,52 @@ class TV_AudioOutputCluster : public TestCommand switch (mTestIndex++) { case 0: - ChipLogProgress(chipTool, " ***** Test Step 0 : Read attribute Audio Output list\n"); - err = TestReadAttributeAudioOutputList_0(); + ChipLogProgress(chipTool, " ***** Test Step 0 : read the mandatory attribute: OnOff\n"); + err = TestReadTheMandatoryAttributeOnOff_0(); break; case 1: - ChipLogProgress(chipTool, " ***** Test Step 1 : Select Output Command\n"); - err = TestSelectOutputCommand_1(); + ChipLogProgress(chipTool, " ***** Test Step 1 : reads back mandatory attribute: OnOff\n"); + err = TestReadsBackMandatoryAttributeOnOff_1(); break; case 2: - ChipLogProgress(chipTool, " ***** Test Step 2 : Rename Output Command\n"); - err = TestRenameOutputCommand_2(); + ChipLogProgress(chipTool, " ***** Test Step 2 : read LT attribute: GlobalSceneControl\n"); + err = TestReadLtAttributeGlobalSceneControl_2(); + break; + case 3: + ChipLogProgress(chipTool, " ***** Test Step 3 : read LT attribute: OnTime\n"); + err = TestReadLtAttributeOnTime_3(); + break; + case 4: + ChipLogProgress(chipTool, " ***** Test Step 4 : read LT attribute: OffWaitTime\n"); + err = TestReadLtAttributeOffWaitTime_4(); + break; + case 5: + ChipLogProgress(chipTool, " ***** Test Step 5 : read LT attribute: StartUpOnOff\n"); + err = TestReadLtAttributeStartUpOnOff_5(); + break; + case 6: + ChipLogProgress(chipTool, " ***** Test Step 6 : write the default value to LT attribute: OnTime\n"); + err = TestWriteTheDefaultValueToLtAttributeOnTime_6(); + break; + case 7: + ChipLogProgress(chipTool, " ***** Test Step 7 : write the default value to LT attribute: OffWaitTime\n"); + err = TestWriteTheDefaultValueToLtAttributeOffWaitTime_7(); + break; + case 8: + ChipLogProgress(chipTool, " ***** Test Step 8 : write the default value to LT attribute: StartUpOnOff\n"); + err = TestWriteTheDefaultValueToLtAttributeStartUpOnOff_8(); + break; + case 9: + ChipLogProgress(chipTool, " ***** Test Step 9 : reads back LT attribute: OnTime\n"); + err = TestReadsBackLtAttributeOnTime_9(); + break; + case 10: + ChipLogProgress(chipTool, " ***** Test Step 10 : reads back LT attribute: OffWaitTime\n"); + err = TestReadsBackLtAttributeOffWaitTime_10(); + break; + case 11: + ChipLogProgress(chipTool, " ***** Test Step 11 : reads back LT attribute: StartUpOnOff\n"); + err = TestReadsBackLtAttributeStartUpOnOff_11(); break; } @@ -185,352 +345,349 @@ class TV_AudioOutputCluster : public TestCommand private: std::atomic_uint16_t mTestIndex; - const uint16_t mTestCount = 3; + const uint16_t mTestCount = 12; chip::Callback::Callback mOnFailureCallback_0{ OnFailureCallback_0, this }; - chip::Callback::Callback mOnSuccessCallback_0{ - OnSuccessCallback_0, this - }; + chip::Callback::Callback mOnSuccessCallback_0{ OnSuccessCallback_0, this }; chip::Callback::Callback mOnFailureCallback_1{ OnFailureCallback_1, this }; - chip::Callback::Callback mOnSuccessCallback_1{ OnSuccessCallback_1, this }; + chip::Callback::Callback mOnSuccessCallback_1{ OnSuccessCallback_1, this }; chip::Callback::Callback mOnFailureCallback_2{ OnFailureCallback_2, this }; - chip::Callback::Callback mOnSuccessCallback_2{ OnSuccessCallback_2, this }; - - static void OnFailureCallback_0(void * context, uint8_t status) - { - (static_cast(context))->OnFailureResponse_0(status); + chip::Callback::Callback mOnSuccessCallback_2{ OnSuccessCallback_2, this }; + chip::Callback::Callback mOnFailureCallback_3{ OnFailureCallback_3, this }; + chip::Callback::Callback mOnSuccessCallback_3{ OnSuccessCallback_3, this }; + chip::Callback::Callback mOnFailureCallback_4{ OnFailureCallback_4, this }; + chip::Callback::Callback mOnSuccessCallback_4{ OnSuccessCallback_4, this }; + chip::Callback::Callback mOnFailureCallback_5{ OnFailureCallback_5, this }; + chip::Callback::Callback mOnSuccessCallback_5{ OnSuccessCallback_5, this }; + chip::Callback::Callback mOnFailureCallback_6{ OnFailureCallback_6, this }; + chip::Callback::Callback mOnSuccessCallback_6{ OnSuccessCallback_6, this }; + chip::Callback::Callback mOnFailureCallback_7{ OnFailureCallback_7, this }; + chip::Callback::Callback mOnSuccessCallback_7{ OnSuccessCallback_7, this }; + chip::Callback::Callback mOnFailureCallback_8{ OnFailureCallback_8, this }; + chip::Callback::Callback mOnSuccessCallback_8{ OnSuccessCallback_8, this }; + chip::Callback::Callback mOnFailureCallback_9{ OnFailureCallback_9, this }; + chip::Callback::Callback mOnSuccessCallback_9{ OnSuccessCallback_9, this }; + chip::Callback::Callback mOnFailureCallback_10{ OnFailureCallback_10, this }; + chip::Callback::Callback mOnSuccessCallback_10{ OnSuccessCallback_10, this }; + chip::Callback::Callback mOnFailureCallback_11{ OnFailureCallback_11, this }; + chip::Callback::Callback mOnSuccessCallback_11{ OnSuccessCallback_11, this }; + + static void OnFailureCallback_0(void * context, uint8_t status) + { + (static_cast(context))->OnFailureResponse_0(status); } - static void OnSuccessCallback_0(void * context, uint16_t count, _AudioOutputInfo * audioOutputList) + static void OnSuccessCallback_0(void * context, bool onOff) { - (static_cast(context))->OnSuccessResponse_0(count, audioOutputList); + (static_cast(context))->OnSuccessResponse_0(onOff); } static void OnFailureCallback_1(void * context, uint8_t status) { - (static_cast(context))->OnFailureResponse_1(status); + (static_cast(context))->OnFailureResponse_1(status); } - static void OnSuccessCallback_1(void * context) { (static_cast(context))->OnSuccessResponse_1(); } + static void OnSuccessCallback_1(void * context, bool onOff) + { + (static_cast(context))->OnSuccessResponse_1(onOff); + } static void OnFailureCallback_2(void * context, uint8_t status) { - (static_cast(context))->OnFailureResponse_2(status); + (static_cast(context))->OnFailureResponse_2(status); } - static void OnSuccessCallback_2(void * context) { (static_cast(context))->OnSuccessResponse_2(); } - - // - // Tests methods - // - - CHIP_ERROR TestReadAttributeAudioOutputList_0() + static void OnSuccessCallback_2(void * context, bool globalSceneControl) { - chip::Controller::AudioOutputClusterTest cluster; - cluster.Associate(mDevice, 2); - - return cluster.ReadAttributeAudioOutputList(mOnSuccessCallback_0.Cancel(), mOnFailureCallback_0.Cancel()); + (static_cast(context))->OnSuccessResponse_2(globalSceneControl); } - void OnFailureResponse_0(uint8_t status) { ThrowFailureResponse(); } - - void OnSuccessResponse_0(uint16_t count, _AudioOutputInfo * audioOutputList) + static void OnFailureCallback_3(void * context, uint8_t status) { - VerifyOrReturn(CheckValueAsList("audioOutputList", count, 3)); - NextTest(); + (static_cast(context))->OnFailureResponse_3(status); } - CHIP_ERROR TestSelectOutputCommand_1() + static void OnSuccessCallback_3(void * context, uint16_t onTime) { - chip::Controller::AudioOutputClusterTest cluster; - cluster.Associate(mDevice, 2); - - uint8_t indexArgument = 1; - - return cluster.SelectOutput(mOnSuccessCallback_1.Cancel(), mOnFailureCallback_1.Cancel(), indexArgument); + (static_cast(context))->OnSuccessResponse_3(onTime); } - void OnFailureResponse_1(uint8_t status) { ThrowFailureResponse(); } - - void OnSuccessResponse_1() { NextTest(); } - - CHIP_ERROR TestRenameOutputCommand_2() + static void OnFailureCallback_4(void * context, uint8_t status) { - chip::Controller::AudioOutputClusterTest cluster; - cluster.Associate(mDevice, 2); - - uint8_t indexArgument = 1; - chip::ByteSpan nameArgument = chip::ByteSpan(chip::Uint8::from_const_char("exampleName"), strlen("exampleName")); - - return cluster.RenameOutput(mOnSuccessCallback_2.Cancel(), mOnFailureCallback_2.Cancel(), indexArgument, nameArgument); + (static_cast(context))->OnFailureResponse_4(status); } - void OnFailureResponse_2(uint8_t status) { ThrowFailureResponse(); } - - void OnSuccessResponse_2() { NextTest(); } -}; - -class TV_ApplicationLauncherCluster : public TestCommand -{ -public: - TV_ApplicationLauncherCluster() : TestCommand("TV_ApplicationLauncherCluster"), mTestIndex(0) {} - - /////////// TestCommand Interface ///////// - void NextTest() override + static void OnSuccessCallback_4(void * context, uint16_t offWaitTime) { - CHIP_ERROR err = CHIP_NO_ERROR; + (static_cast(context))->OnSuccessResponse_4(offWaitTime); + } - if (0 == mTestIndex) - { - ChipLogProgress(chipTool, " **** Test Start: TV_ApplicationLauncherCluster\n"); - } + static void OnFailureCallback_5(void * context, uint8_t status) + { + (static_cast(context))->OnFailureResponse_5(status); + } - if (mTestCount == mTestIndex) - { - ChipLogProgress(chipTool, " **** Test Complete: TV_ApplicationLauncherCluster\n"); - SetCommandExitStatus(CHIP_NO_ERROR); - return; - } + static void OnSuccessCallback_5(void * context, uint8_t startUpOnOff) + { + (static_cast(context))->OnSuccessResponse_5(startUpOnOff); + } - // Ensure we increment mTestIndex before we start running the relevant - // command. That way if we lose the timeslice after we send the message - // but before our function call returns, we won't end up with an - // incorrect mTestIndex value observed when we get the response. - switch (mTestIndex++) - { - case 0: - ChipLogProgress(chipTool, " ***** Test Step 0 : Read attribute Application Launcher list\n"); - err = TestReadAttributeApplicationLauncherList_0(); - break; - case 1: - ChipLogProgress(chipTool, " ***** Test Step 1 : Launch App Command\n"); - err = TestLaunchAppCommand_1(); - break; - case 2: - ChipLogProgress(chipTool, " ***** Test Step 2 : Read attribute catalog vendor id\n"); - err = TestReadAttributeCatalogVendorId_2(); - break; - case 3: - ChipLogProgress(chipTool, " ***** Test Step 3 : Read attribute application id\n"); - err = TestReadAttributeApplicationId_3(); - break; - } + static void OnFailureCallback_6(void * context, uint8_t status) + { + (static_cast(context))->OnFailureResponse_6(status); + } - if (CHIP_NO_ERROR != err) - { - ChipLogError(chipTool, " ***** Test Failure: %s\n", chip::ErrorStr(err)); - SetCommandExitStatus(err); - } + static void OnSuccessCallback_6(void * context, uint16_t onTime) + { + (static_cast(context))->OnSuccessResponse_6(onTime); } -private: - std::atomic_uint16_t mTestIndex; - const uint16_t mTestCount = 4; + static void OnFailureCallback_7(void * context, uint8_t status) + { + (static_cast(context))->OnFailureResponse_7(status); + } - chip::Callback::Callback mOnFailureCallback_0{ OnFailureCallback_0, this }; - chip::Callback::Callback mOnSuccessCallback_0{ - OnSuccessCallback_0, this - }; - chip::Callback::Callback mOnFailureCallback_1{ OnFailureCallback_1, this }; - chip::Callback::Callback mOnSuccessCallback_1{ - OnSuccessCallback_1, this - }; - chip::Callback::Callback mOnFailureCallback_2{ OnFailureCallback_2, this }; - chip::Callback::Callback mOnSuccessCallback_2{ OnSuccessCallback_2, this }; - chip::Callback::Callback mOnFailureCallback_3{ OnFailureCallback_3, this }; - chip::Callback::Callback mOnSuccessCallback_3{ OnSuccessCallback_3, this }; + static void OnSuccessCallback_7(void * context, uint16_t offWaitTime) + { + (static_cast(context))->OnSuccessResponse_7(offWaitTime); + } - static void OnFailureCallback_0(void * context, uint8_t status) + static void OnFailureCallback_8(void * context, uint8_t status) { - (static_cast(context))->OnFailureResponse_0(status); + (static_cast(context))->OnFailureResponse_8(status); } - static void OnSuccessCallback_0(void * context, uint16_t count, uint16_t * applicationLauncherList) + static void OnSuccessCallback_8(void * context, uint8_t startUpOnOff) { - (static_cast(context))->OnSuccessResponse_0(count, applicationLauncherList); + (static_cast(context))->OnSuccessResponse_8(startUpOnOff); } - static void OnFailureCallback_1(void * context, uint8_t status) + static void OnFailureCallback_9(void * context, uint8_t status) { - (static_cast(context))->OnFailureResponse_1(status); + (static_cast(context))->OnFailureResponse_9(status); } - static void OnSuccessCallback_1(void * context, uint8_t status, chip::ByteSpan data) + static void OnSuccessCallback_9(void * context, uint16_t onTime) { - (static_cast(context))->OnSuccessResponse_1(status, data); + (static_cast(context))->OnSuccessResponse_9(onTime); } - static void OnFailureCallback_2(void * context, uint8_t status) + static void OnFailureCallback_10(void * context, uint8_t status) { - (static_cast(context))->OnFailureResponse_2(status); + (static_cast(context))->OnFailureResponse_10(status); } - static void OnSuccessCallback_2(void * context, uint8_t catalogVendorId) + static void OnSuccessCallback_10(void * context, uint16_t offWaitTime) { - (static_cast(context))->OnSuccessResponse_2(catalogVendorId); + (static_cast(context))->OnSuccessResponse_10(offWaitTime); } - static void OnFailureCallback_3(void * context, uint8_t status) + static void OnFailureCallback_11(void * context, uint8_t status) { - (static_cast(context))->OnFailureResponse_3(status); + (static_cast(context))->OnFailureResponse_11(status); } - static void OnSuccessCallback_3(void * context, uint8_t applicationId) + static void OnSuccessCallback_11(void * context, uint8_t startUpOnOff) { - (static_cast(context))->OnSuccessResponse_3(applicationId); + (static_cast(context))->OnSuccessResponse_11(startUpOnOff); } // // Tests methods // - CHIP_ERROR TestReadAttributeApplicationLauncherList_0() + CHIP_ERROR TestReadTheMandatoryAttributeOnOff_0() { - chip::Controller::ApplicationLauncherClusterTest cluster; + chip::Controller::OnOffClusterTest cluster; cluster.Associate(mDevice, 1); - return cluster.ReadAttributeApplicationLauncherList(mOnSuccessCallback_0.Cancel(), mOnFailureCallback_0.Cancel()); + return cluster.ReadAttributeOnOff(mOnSuccessCallback_0.Cancel(), mOnFailureCallback_0.Cancel()); } void OnFailureResponse_0(uint8_t status) { ThrowFailureResponse(); } - void OnSuccessResponse_0(uint16_t count, uint16_t * applicationLauncherList) + void OnSuccessResponse_0(bool onOff) { - VerifyOrReturn(CheckValueAsList("applicationLauncherList", count, 2)); + VerifyOrReturn(CheckValue("onOff", onOff, 0)); NextTest(); } - CHIP_ERROR TestLaunchAppCommand_1() + CHIP_ERROR TestReadsBackMandatoryAttributeOnOff_1() { - chip::Controller::ApplicationLauncherClusterTest cluster; + chip::Controller::OnOffClusterTest cluster; cluster.Associate(mDevice, 1); - chip::ByteSpan dataArgument = chip::ByteSpan(chip::Uint8::from_const_char("exampleData"), strlen("exampleData")); - uint16_t catalogVendorIdArgument = 1U; - chip::ByteSpan applicationIdArgument = chip::ByteSpan(chip::Uint8::from_const_char("appId"), strlen("appId")); - - return cluster.LaunchApp(mOnSuccessCallback_1.Cancel(), mOnFailureCallback_1.Cancel(), dataArgument, - catalogVendorIdArgument, applicationIdArgument); + return cluster.ReadAttributeOnOff(mOnSuccessCallback_1.Cancel(), mOnFailureCallback_1.Cancel()); } void OnFailureResponse_1(uint8_t status) { ThrowFailureResponse(); } - void OnSuccessResponse_1(uint8_t status, chip::ByteSpan data) { NextTest(); } + void OnSuccessResponse_1(bool onOff) + { + VerifyOrReturn(CheckValue("onOff", onOff, 0)); + NextTest(); + } - CHIP_ERROR TestReadAttributeCatalogVendorId_2() + CHIP_ERROR TestReadLtAttributeGlobalSceneControl_2() { - chip::Controller::ApplicationLauncherClusterTest cluster; + chip::Controller::OnOffClusterTest cluster; cluster.Associate(mDevice, 1); - return cluster.ReadAttributeCatalogVendorId(mOnSuccessCallback_2.Cancel(), mOnFailureCallback_2.Cancel()); + return cluster.ReadAttributeGlobalSceneControl(mOnSuccessCallback_2.Cancel(), mOnFailureCallback_2.Cancel()); } void OnFailureResponse_2(uint8_t status) { ThrowFailureResponse(); } - void OnSuccessResponse_2(uint8_t catalogVendorId) + void OnSuccessResponse_2(bool globalSceneControl) { - VerifyOrReturn(CheckValue("catalogVendorId", catalogVendorId, 0)); + VerifyOrReturn(CheckValue("globalSceneControl", globalSceneControl, 1)); NextTest(); } - CHIP_ERROR TestReadAttributeApplicationId_3() + CHIP_ERROR TestReadLtAttributeOnTime_3() { - chip::Controller::ApplicationLauncherClusterTest cluster; + chip::Controller::OnOffClusterTest cluster; cluster.Associate(mDevice, 1); - return cluster.ReadAttributeApplicationId(mOnSuccessCallback_3.Cancel(), mOnFailureCallback_3.Cancel()); + return cluster.ReadAttributeOnTime(mOnSuccessCallback_3.Cancel(), mOnFailureCallback_3.Cancel()); } void OnFailureResponse_3(uint8_t status) { ThrowFailureResponse(); } - void OnSuccessResponse_3(uint8_t applicationId) + void OnSuccessResponse_3(uint16_t onTime) { - VerifyOrReturn(CheckValue("applicationId", applicationId, 0)); + VerifyOrReturn(CheckValue("onTime", onTime, 0U)); NextTest(); } -}; -class TV_KeypadInputCluster : public TestCommand -{ -public: - TV_KeypadInputCluster() : TestCommand("TV_KeypadInputCluster"), mTestIndex(0) {} + CHIP_ERROR TestReadLtAttributeOffWaitTime_4() + { + chip::Controller::OnOffClusterTest cluster; + cluster.Associate(mDevice, 1); - /////////// TestCommand Interface ///////// - void NextTest() override + return cluster.ReadAttributeOffWaitTime(mOnSuccessCallback_4.Cancel(), mOnFailureCallback_4.Cancel()); + } + + void OnFailureResponse_4(uint8_t status) { ThrowFailureResponse(); } + + void OnSuccessResponse_4(uint16_t offWaitTime) { - CHIP_ERROR err = CHIP_NO_ERROR; + VerifyOrReturn(CheckValue("offWaitTime", offWaitTime, 0U)); + NextTest(); + } - if (0 == mTestIndex) - { - ChipLogProgress(chipTool, " **** Test Start: TV_KeypadInputCluster\n"); - } + CHIP_ERROR TestReadLtAttributeStartUpOnOff_5() + { + chip::Controller::OnOffClusterTest cluster; + cluster.Associate(mDevice, 1); - if (mTestCount == mTestIndex) - { - ChipLogProgress(chipTool, " **** Test Complete: TV_KeypadInputCluster\n"); - SetCommandExitStatus(CHIP_NO_ERROR); - return; - } + return cluster.ReadAttributeStartUpOnOff(mOnSuccessCallback_5.Cancel(), mOnFailureCallback_5.Cancel()); + } - // Ensure we increment mTestIndex before we start running the relevant - // command. That way if we lose the timeslice after we send the message - // but before our function call returns, we won't end up with an - // incorrect mTestIndex value observed when we get the response. - switch (mTestIndex++) - { - case 0: - ChipLogProgress(chipTool, " ***** Test Step 0 : Send Key Command\n"); - err = TestSendKeyCommand_0(); - break; - } + void OnFailureResponse_5(uint8_t status) { ThrowFailureResponse(); } - if (CHIP_NO_ERROR != err) - { - ChipLogError(chipTool, " ***** Test Failure: %s\n", chip::ErrorStr(err)); - SetCommandExitStatus(err); - } + void OnSuccessResponse_5(uint8_t startUpOnOff) + { + VerifyOrReturn(CheckValue("startUpOnOff", startUpOnOff, 0)); + NextTest(); } -private: - std::atomic_uint16_t mTestIndex; - const uint16_t mTestCount = 1; + CHIP_ERROR TestWriteTheDefaultValueToLtAttributeOnTime_6() + { + chip::Controller::OnOffClusterTest cluster; + cluster.Associate(mDevice, 1); - chip::Callback::Callback mOnFailureCallback_0{ OnFailureCallback_0, this }; - chip::Callback::Callback mOnSuccessCallback_0{ OnSuccessCallback_0, this }; + uint16_t onTimeArgument = 0U; - static void OnFailureCallback_0(void * context, uint8_t status) + return cluster.WriteAttributeOnTime(mOnSuccessCallback_6.Cancel(), mOnFailureCallback_6.Cancel(), onTimeArgument); + } + + void OnFailureResponse_6(uint8_t status) { ThrowFailureResponse(); } + + void OnSuccessResponse_6(uint16_t onTime) { NextTest(); } + + CHIP_ERROR TestWriteTheDefaultValueToLtAttributeOffWaitTime_7() { - (static_cast(context))->OnFailureResponse_0(status); + chip::Controller::OnOffClusterTest cluster; + cluster.Associate(mDevice, 1); + + uint16_t offWaitTimeArgument = 0U; + + return cluster.WriteAttributeOffWaitTime(mOnSuccessCallback_7.Cancel(), mOnFailureCallback_7.Cancel(), offWaitTimeArgument); } - static void OnSuccessCallback_0(void * context, uint8_t status) + void OnFailureResponse_7(uint8_t status) { ThrowFailureResponse(); } + + void OnSuccessResponse_7(uint16_t offWaitTime) { NextTest(); } + + CHIP_ERROR TestWriteTheDefaultValueToLtAttributeStartUpOnOff_8() { - (static_cast(context))->OnSuccessResponse_0(status); + chip::Controller::OnOffClusterTest cluster; + cluster.Associate(mDevice, 1); + + uint8_t startUpOnOffArgument = 0; + + return cluster.WriteAttributeStartUpOnOff(mOnSuccessCallback_8.Cancel(), mOnFailureCallback_8.Cancel(), + startUpOnOffArgument); } - // - // Tests methods - // + void OnFailureResponse_8(uint8_t status) { ThrowFailureResponse(); } - CHIP_ERROR TestSendKeyCommand_0() + void OnSuccessResponse_8(uint8_t startUpOnOff) { NextTest(); } + + CHIP_ERROR TestReadsBackLtAttributeOnTime_9() { - chip::Controller::KeypadInputClusterTest cluster; + chip::Controller::OnOffClusterTest cluster; cluster.Associate(mDevice, 1); - uint8_t keyCodeArgument = 3; + return cluster.ReadAttributeOnTime(mOnSuccessCallback_9.Cancel(), mOnFailureCallback_9.Cancel()); + } - return cluster.SendKey(mOnSuccessCallback_0.Cancel(), mOnFailureCallback_0.Cancel(), keyCodeArgument); + void OnFailureResponse_9(uint8_t status) { ThrowFailureResponse(); } + + void OnSuccessResponse_9(uint16_t onTime) + { + VerifyOrReturn(CheckValue("onTime", onTime, 0U)); + NextTest(); } - void OnFailureResponse_0(uint8_t status) { ThrowFailureResponse(); } + CHIP_ERROR TestReadsBackLtAttributeOffWaitTime_10() + { + chip::Controller::OnOffClusterTest cluster; + cluster.Associate(mDevice, 1); - void OnSuccessResponse_0(uint8_t status) { NextTest(); } + return cluster.ReadAttributeOffWaitTime(mOnSuccessCallback_10.Cancel(), mOnFailureCallback_10.Cancel()); + } + + void OnFailureResponse_10(uint8_t status) { ThrowFailureResponse(); } + + void OnSuccessResponse_10(uint16_t offWaitTime) + { + VerifyOrReturn(CheckValue("offWaitTime", offWaitTime, 0U)); + NextTest(); + } + + CHIP_ERROR TestReadsBackLtAttributeStartUpOnOff_11() + { + chip::Controller::OnOffClusterTest cluster; + cluster.Associate(mDevice, 1); + + return cluster.ReadAttributeStartUpOnOff(mOnSuccessCallback_11.Cancel(), mOnFailureCallback_11.Cancel()); + } + + void OnFailureResponse_11(uint8_t status) { ThrowFailureResponse(); } + + void OnSuccessResponse_11(uint8_t startUpOnOff) + { + VerifyOrReturn(CheckValue("startUpOnOff", startUpOnOff, 0)); + NextTest(); + } }; -class TV_AccountLoginCluster : public TestCommand +class Test_TC_OO_2_2 : public TestCommand { public: - TV_AccountLoginCluster() : TestCommand("TV_AccountLoginCluster"), mTestIndex(0) {} + Test_TC_OO_2_2() : TestCommand("Test_TC_OO_2_2"), mTestIndex(0) {} /////////// TestCommand Interface ///////// void NextTest() override @@ -539,12 +696,12 @@ class TV_AccountLoginCluster : public TestCommand if (0 == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Start: TV_AccountLoginCluster\n"); + ChipLogProgress(chipTool, " **** Test Start: Test_TC_OO_2_2\n"); } if (mTestCount == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Complete: TV_AccountLoginCluster\n"); + ChipLogProgress(chipTool, " **** Test Complete: Test_TC_OO_2_2\n"); SetCommandExitStatus(CHIP_NO_ERROR); return; } @@ -556,12 +713,60 @@ class TV_AccountLoginCluster : public TestCommand switch (mTestIndex++) { case 0: - ChipLogProgress(chipTool, " ***** Test Step 0 : Get Setup PIN Command\n"); - err = TestGetSetupPinCommand_0(); + ChipLogProgress(chipTool, " ***** Test Step 0 : Send Off Command\n"); + err = TestSendOffCommand_0(); break; case 1: - ChipLogProgress(chipTool, " ***** Test Step 1 : Login Command\n"); - err = TestLoginCommand_1(); + ChipLogProgress(chipTool, " ***** Test Step 1 : Check on/off attribute value is false after off command\n"); + err = TestCheckOnOffAttributeValueIsFalseAfterOffCommand_1(); + break; + case 2: + ChipLogProgress(chipTool, " ***** Test Step 2 : Send On Command\n"); + err = TestSendOnCommand_2(); + break; + case 3: + ChipLogProgress(chipTool, " ***** Test Step 3 : Check on/off attribute value is true after on command\n"); + err = TestCheckOnOffAttributeValueIsTrueAfterOnCommand_3(); + break; + case 4: + ChipLogProgress(chipTool, " ***** Test Step 4 : Send Off Command\n"); + err = TestSendOffCommand_4(); + break; + case 5: + ChipLogProgress(chipTool, " ***** Test Step 5 : Check on/off attribute value is false after off command\n"); + err = TestCheckOnOffAttributeValueIsFalseAfterOffCommand_5(); + break; + case 6: + ChipLogProgress(chipTool, " ***** Test Step 6 : Send Toggle Command\n"); + err = TestSendToggleCommand_6(); + break; + case 7: + ChipLogProgress(chipTool, " ***** Test Step 7 : Check on/off attribute value is true after toggle command\n"); + err = TestCheckOnOffAttributeValueIsTrueAfterToggleCommand_7(); + break; + case 8: + ChipLogProgress(chipTool, " ***** Test Step 8 : Send Toggle Command\n"); + err = TestSendToggleCommand_8(); + break; + case 9: + ChipLogProgress(chipTool, " ***** Test Step 9 : Check on/off attribute value is false after toggle command\n"); + err = TestCheckOnOffAttributeValueIsFalseAfterToggleCommand_9(); + break; + case 10: + ChipLogProgress(chipTool, " ***** Test Step 10 : Send On Command\n"); + err = TestSendOnCommand_10(); + break; + case 11: + ChipLogProgress(chipTool, " ***** Test Step 11 : Check on/off attribute value is true after on command\n"); + err = TestCheckOnOffAttributeValueIsTrueAfterOnCommand_11(); + break; + case 12: + ChipLogProgress(chipTool, " ***** Test Step 12 : Send Off Command\n"); + err = TestSendOffCommand_12(); + break; + case 13: + ChipLogProgress(chipTool, " ***** Test Step 13 : Check on/off attribute value is false after off command\n"); + err = TestCheckOnOffAttributeValueIsFalseAfterOffCommand_13(); break; } @@ -574,320 +779,361 @@ class TV_AccountLoginCluster : public TestCommand private: std::atomic_uint16_t mTestIndex; - const uint16_t mTestCount = 2; + const uint16_t mTestCount = 14; chip::Callback::Callback mOnFailureCallback_0{ OnFailureCallback_0, this }; - chip::Callback::Callback mOnSuccessCallback_0{ OnSuccessCallback_0, this }; + chip::Callback::Callback mOnSuccessCallback_0{ OnSuccessCallback_0, this }; chip::Callback::Callback mOnFailureCallback_1{ OnFailureCallback_1, this }; - chip::Callback::Callback mOnSuccessCallback_1{ OnSuccessCallback_1, this }; + chip::Callback::Callback mOnSuccessCallback_1{ OnSuccessCallback_1, this }; + chip::Callback::Callback mOnFailureCallback_2{ OnFailureCallback_2, this }; + chip::Callback::Callback mOnSuccessCallback_2{ OnSuccessCallback_2, this }; + chip::Callback::Callback mOnFailureCallback_3{ OnFailureCallback_3, this }; + chip::Callback::Callback mOnSuccessCallback_3{ OnSuccessCallback_3, this }; + chip::Callback::Callback mOnFailureCallback_4{ OnFailureCallback_4, this }; + chip::Callback::Callback mOnSuccessCallback_4{ OnSuccessCallback_4, this }; + chip::Callback::Callback mOnFailureCallback_5{ OnFailureCallback_5, this }; + chip::Callback::Callback mOnSuccessCallback_5{ OnSuccessCallback_5, this }; + chip::Callback::Callback mOnFailureCallback_6{ OnFailureCallback_6, this }; + chip::Callback::Callback mOnSuccessCallback_6{ OnSuccessCallback_6, this }; + chip::Callback::Callback mOnFailureCallback_7{ OnFailureCallback_7, this }; + chip::Callback::Callback mOnSuccessCallback_7{ OnSuccessCallback_7, this }; + chip::Callback::Callback mOnFailureCallback_8{ OnFailureCallback_8, this }; + chip::Callback::Callback mOnSuccessCallback_8{ OnSuccessCallback_8, this }; + chip::Callback::Callback mOnFailureCallback_9{ OnFailureCallback_9, this }; + chip::Callback::Callback mOnSuccessCallback_9{ OnSuccessCallback_9, this }; + chip::Callback::Callback mOnFailureCallback_10{ OnFailureCallback_10, this }; + chip::Callback::Callback mOnSuccessCallback_10{ OnSuccessCallback_10, this }; + chip::Callback::Callback mOnFailureCallback_11{ OnFailureCallback_11, this }; + chip::Callback::Callback mOnSuccessCallback_11{ OnSuccessCallback_11, this }; + chip::Callback::Callback mOnFailureCallback_12{ OnFailureCallback_12, this }; + chip::Callback::Callback mOnSuccessCallback_12{ OnSuccessCallback_12, this }; + chip::Callback::Callback mOnFailureCallback_13{ OnFailureCallback_13, this }; + chip::Callback::Callback mOnSuccessCallback_13{ OnSuccessCallback_13, this }; static void OnFailureCallback_0(void * context, uint8_t status) { - (static_cast(context))->OnFailureResponse_0(status); + (static_cast(context))->OnFailureResponse_0(status); } - static void OnSuccessCallback_0(void * context, chip::ByteSpan setupPIN) + static void OnSuccessCallback_0(void * context) { (static_cast(context))->OnSuccessResponse_0(); } + + static void OnFailureCallback_1(void * context, uint8_t status) { - (static_cast(context))->OnSuccessResponse_0(setupPIN); + (static_cast(context))->OnFailureResponse_1(status); } - static void OnFailureCallback_1(void * context, uint8_t status) + static void OnSuccessCallback_1(void * context, bool onOff) { - (static_cast(context))->OnFailureResponse_1(status); + (static_cast(context))->OnSuccessResponse_1(onOff); } - static void OnSuccessCallback_1(void * context) { (static_cast(context))->OnSuccessResponse_1(); } + static void OnFailureCallback_2(void * context, uint8_t status) + { + (static_cast(context))->OnFailureResponse_2(status); + } - // - // Tests methods - // + static void OnSuccessCallback_2(void * context) { (static_cast(context))->OnSuccessResponse_2(); } - CHIP_ERROR TestGetSetupPinCommand_0() + static void OnFailureCallback_3(void * context, uint8_t status) { - chip::Controller::AccountLoginClusterTest cluster; - cluster.Associate(mDevice, 3); - - chip::ByteSpan tempAccountIdentifierArgument = chip::ByteSpan(chip::Uint8::from_const_char("asdf"), strlen("asdf")); - - return cluster.GetSetupPIN(mOnSuccessCallback_0.Cancel(), mOnFailureCallback_0.Cancel(), tempAccountIdentifierArgument); + (static_cast(context))->OnFailureResponse_3(status); } - void OnFailureResponse_0(uint8_t status) { ThrowFailureResponse(); } - - void OnSuccessResponse_0(chip::ByteSpan setupPIN) { NextTest(); } - - CHIP_ERROR TestLoginCommand_1() + static void OnSuccessCallback_3(void * context, bool onOff) { - chip::Controller::AccountLoginClusterTest cluster; - cluster.Associate(mDevice, 3); - - chip::ByteSpan tempAccountIdentifierArgument = chip::ByteSpan(chip::Uint8::from_const_char("asdf"), strlen("asdf")); - chip::ByteSpan setupPINArgument = chip::ByteSpan(chip::Uint8::from_const_char("tempPin123"), strlen("tempPin123")); - - return cluster.Login(mOnSuccessCallback_1.Cancel(), mOnFailureCallback_1.Cancel(), tempAccountIdentifierArgument, - setupPINArgument); + (static_cast(context))->OnSuccessResponse_3(onOff); } - void OnFailureResponse_1(uint8_t status) { ThrowFailureResponse(); } - - void OnSuccessResponse_1() { NextTest(); } -}; - -class TV_WakeOnLanCluster : public TestCommand -{ -public: - TV_WakeOnLanCluster() : TestCommand("TV_WakeOnLanCluster"), mTestIndex(0) {} - - /////////// TestCommand Interface ///////// - void NextTest() override + static void OnFailureCallback_4(void * context, uint8_t status) { - CHIP_ERROR err = CHIP_NO_ERROR; - - if (0 == mTestIndex) - { - ChipLogProgress(chipTool, " **** Test Start: TV_WakeOnLanCluster\n"); - } - - if (mTestCount == mTestIndex) - { - ChipLogProgress(chipTool, " **** Test Complete: TV_WakeOnLanCluster\n"); - SetCommandExitStatus(CHIP_NO_ERROR); - return; - } - - // Ensure we increment mTestIndex before we start running the relevant - // command. That way if we lose the timeslice after we send the message - // but before our function call returns, we won't end up with an - // incorrect mTestIndex value observed when we get the response. - switch (mTestIndex++) - { - case 0: - ChipLogProgress(chipTool, " ***** Test Step 0 : Read mac address\n"); - err = TestReadMacAddress_0(); - break; - } - - if (CHIP_NO_ERROR != err) - { - ChipLogError(chipTool, " ***** Test Failure: %s\n", chip::ErrorStr(err)); - SetCommandExitStatus(err); - } + (static_cast(context))->OnFailureResponse_4(status); } -private: - std::atomic_uint16_t mTestIndex; - const uint16_t mTestCount = 1; - - chip::Callback::Callback mOnFailureCallback_0{ OnFailureCallback_0, this }; - chip::Callback::Callback mOnSuccessCallback_0{ - OnSuccessCallback_0, this - }; + static void OnSuccessCallback_4(void * context) { (static_cast(context))->OnSuccessResponse_4(); } - static void OnFailureCallback_0(void * context, uint8_t status) + static void OnFailureCallback_5(void * context, uint8_t status) { - (static_cast(context))->OnFailureResponse_0(status); + (static_cast(context))->OnFailureResponse_5(status); } - static void OnSuccessCallback_0(void * context, chip::ByteSpan wakeOnLanMacAddress) + static void OnSuccessCallback_5(void * context, bool onOff) { - (static_cast(context))->OnSuccessResponse_0(wakeOnLanMacAddress); + (static_cast(context))->OnSuccessResponse_5(onOff); } - // - // Tests methods - // - - CHIP_ERROR TestReadMacAddress_0() + static void OnFailureCallback_6(void * context, uint8_t status) { - chip::Controller::WakeOnLanClusterTest cluster; - cluster.Associate(mDevice, 1); - - return cluster.ReadAttributeWakeOnLanMacAddress(mOnSuccessCallback_0.Cancel(), mOnFailureCallback_0.Cancel()); + (static_cast(context))->OnFailureResponse_6(status); } - void OnFailureResponse_0(uint8_t status) { ThrowFailureResponse(); } + static void OnSuccessCallback_6(void * context) { (static_cast(context))->OnSuccessResponse_6(); } - void OnSuccessResponse_0(chip::ByteSpan wakeOnLanMacAddress) + static void OnFailureCallback_7(void * context, uint8_t status) { - VerifyOrReturn(CheckValueAsString("wakeOnLanMacAddress", wakeOnLanMacAddress, "00:00:00:00:00")); - NextTest(); + (static_cast(context))->OnFailureResponse_7(status); } -}; - -class TV_ApplicationBasicCluster : public TestCommand -{ -public: - TV_ApplicationBasicCluster() : TestCommand("TV_ApplicationBasicCluster"), mTestIndex(0) {} - /////////// TestCommand Interface ///////// - void NextTest() override + static void OnSuccessCallback_7(void * context, bool onOff) { - CHIP_ERROR err = CHIP_NO_ERROR; - - if (0 == mTestIndex) - { - ChipLogProgress(chipTool, " **** Test Start: TV_ApplicationBasicCluster\n"); - } - - if (mTestCount == mTestIndex) - { - ChipLogProgress(chipTool, " **** Test Complete: TV_ApplicationBasicCluster\n"); - SetCommandExitStatus(CHIP_NO_ERROR); - return; - } - - // Ensure we increment mTestIndex before we start running the relevant - // command. That way if we lose the timeslice after we send the message - // but before our function call returns, we won't end up with an - // incorrect mTestIndex value observed when we get the response. - switch (mTestIndex++) - { - case 0: - ChipLogProgress(chipTool, " ***** Test Step 0 : Change Status Command\n"); - err = TestChangeStatusCommand_0(); - break; - case 1: - ChipLogProgress(chipTool, " ***** Test Step 1 : Read attribute vendor id\n"); - err = TestReadAttributeVendorId_1(); - break; - case 2: - ChipLogProgress(chipTool, " ***** Test Step 2 : Read attribute product id\n"); - err = TestReadAttributeProductId_2(); - break; - case 3: - ChipLogProgress(chipTool, " ***** Test Step 3 : Read attribute catalog vendor id\n"); - err = TestReadAttributeCatalogVendorId_3(); - break; - } - - if (CHIP_NO_ERROR != err) - { - ChipLogError(chipTool, " ***** Test Failure: %s\n", chip::ErrorStr(err)); - SetCommandExitStatus(err); - } + (static_cast(context))->OnSuccessResponse_7(onOff); } -private: - std::atomic_uint16_t mTestIndex; - const uint16_t mTestCount = 4; + static void OnFailureCallback_8(void * context, uint8_t status) + { + (static_cast(context))->OnFailureResponse_8(status); + } - chip::Callback::Callback mOnFailureCallback_0{ OnFailureCallback_0, this }; - chip::Callback::Callback mOnSuccessCallback_0{ OnSuccessCallback_0, this }; - chip::Callback::Callback mOnFailureCallback_1{ OnFailureCallback_1, this }; - chip::Callback::Callback mOnSuccessCallback_1{ OnSuccessCallback_1, this }; - chip::Callback::Callback mOnFailureCallback_2{ OnFailureCallback_2, this }; - chip::Callback::Callback mOnSuccessCallback_2{ OnSuccessCallback_2, this }; - chip::Callback::Callback mOnFailureCallback_3{ OnFailureCallback_3, this }; - chip::Callback::Callback mOnSuccessCallback_3{ OnSuccessCallback_3, this }; + static void OnSuccessCallback_8(void * context) { (static_cast(context))->OnSuccessResponse_8(); } - static void OnFailureCallback_0(void * context, uint8_t status) + static void OnFailureCallback_9(void * context, uint8_t status) { - (static_cast(context))->OnFailureResponse_0(status); + (static_cast(context))->OnFailureResponse_9(status); } - static void OnSuccessCallback_0(void * context) { (static_cast(context))->OnSuccessResponse_0(); } + static void OnSuccessCallback_9(void * context, bool onOff) + { + (static_cast(context))->OnSuccessResponse_9(onOff); + } - static void OnFailureCallback_1(void * context, uint8_t status) + static void OnFailureCallback_10(void * context, uint8_t status) { - (static_cast(context))->OnFailureResponse_1(status); + (static_cast(context))->OnFailureResponse_10(status); } - static void OnSuccessCallback_1(void * context, uint16_t vendorId) + static void OnSuccessCallback_10(void * context) { (static_cast(context))->OnSuccessResponse_10(); } + + static void OnFailureCallback_11(void * context, uint8_t status) { - (static_cast(context))->OnSuccessResponse_1(vendorId); + (static_cast(context))->OnFailureResponse_11(status); } - static void OnFailureCallback_2(void * context, uint8_t status) + static void OnSuccessCallback_11(void * context, bool onOff) { - (static_cast(context))->OnFailureResponse_2(status); + (static_cast(context))->OnSuccessResponse_11(onOff); } - static void OnSuccessCallback_2(void * context, uint16_t productId) + static void OnFailureCallback_12(void * context, uint8_t status) { - (static_cast(context))->OnSuccessResponse_2(productId); + (static_cast(context))->OnFailureResponse_12(status); } - static void OnFailureCallback_3(void * context, uint8_t status) + static void OnSuccessCallback_12(void * context) { (static_cast(context))->OnSuccessResponse_12(); } + + static void OnFailureCallback_13(void * context, uint8_t status) { - (static_cast(context))->OnFailureResponse_3(status); + (static_cast(context))->OnFailureResponse_13(status); } - static void OnSuccessCallback_3(void * context, uint16_t catalogVendorId) + static void OnSuccessCallback_13(void * context, bool onOff) { - (static_cast(context))->OnSuccessResponse_3(catalogVendorId); + (static_cast(context))->OnSuccessResponse_13(onOff); } // // Tests methods // - CHIP_ERROR TestChangeStatusCommand_0() + CHIP_ERROR TestSendOffCommand_0() { - chip::Controller::ApplicationBasicClusterTest cluster; - cluster.Associate(mDevice, 3); - - uint8_t statusArgument = 1; + chip::Controller::OnOffClusterTest cluster; + cluster.Associate(mDevice, 1); - return cluster.ChangeStatus(mOnSuccessCallback_0.Cancel(), mOnFailureCallback_0.Cancel(), statusArgument); + return cluster.Off(mOnSuccessCallback_0.Cancel(), mOnFailureCallback_0.Cancel()); } void OnFailureResponse_0(uint8_t status) { ThrowFailureResponse(); } void OnSuccessResponse_0() { NextTest(); } - CHIP_ERROR TestReadAttributeVendorId_1() + CHIP_ERROR TestCheckOnOffAttributeValueIsFalseAfterOffCommand_1() { - chip::Controller::ApplicationBasicClusterTest cluster; - cluster.Associate(mDevice, 3); + chip::Controller::OnOffClusterTest cluster; + cluster.Associate(mDevice, 1); - return cluster.ReadAttributeVendorId(mOnSuccessCallback_1.Cancel(), mOnFailureCallback_1.Cancel()); + return cluster.ReadAttributeOnOff(mOnSuccessCallback_1.Cancel(), mOnFailureCallback_1.Cancel()); } void OnFailureResponse_1(uint8_t status) { ThrowFailureResponse(); } - void OnSuccessResponse_1(uint16_t vendorId) + void OnSuccessResponse_1(bool onOff) { - VerifyOrReturn(CheckValue("vendorId", vendorId, 1U)); + VerifyOrReturn(CheckValue("onOff", onOff, 0)); NextTest(); } - CHIP_ERROR TestReadAttributeProductId_2() + CHIP_ERROR TestSendOnCommand_2() { - chip::Controller::ApplicationBasicClusterTest cluster; - cluster.Associate(mDevice, 3); + chip::Controller::OnOffClusterTest cluster; + cluster.Associate(mDevice, 1); - return cluster.ReadAttributeProductId(mOnSuccessCallback_2.Cancel(), mOnFailureCallback_2.Cancel()); + return cluster.On(mOnSuccessCallback_2.Cancel(), mOnFailureCallback_2.Cancel()); } void OnFailureResponse_2(uint8_t status) { ThrowFailureResponse(); } - void OnSuccessResponse_2(uint16_t productId) - { - VerifyOrReturn(CheckValue("productId", productId, 1U)); - NextTest(); - } + void OnSuccessResponse_2() { NextTest(); } - CHIP_ERROR TestReadAttributeCatalogVendorId_3() + CHIP_ERROR TestCheckOnOffAttributeValueIsTrueAfterOnCommand_3() { - chip::Controller::ApplicationBasicClusterTest cluster; - cluster.Associate(mDevice, 3); + chip::Controller::OnOffClusterTest cluster; + cluster.Associate(mDevice, 1); - return cluster.ReadAttributeCatalogVendorId(mOnSuccessCallback_3.Cancel(), mOnFailureCallback_3.Cancel()); + return cluster.ReadAttributeOnOff(mOnSuccessCallback_3.Cancel(), mOnFailureCallback_3.Cancel()); } void OnFailureResponse_3(uint8_t status) { ThrowFailureResponse(); } - void OnSuccessResponse_3(uint16_t catalogVendorId) + void OnSuccessResponse_3(bool onOff) { - VerifyOrReturn(CheckValue("catalogVendorId", catalogVendorId, 1U)); + VerifyOrReturn(CheckValue("onOff", onOff, 1)); + NextTest(); + } + + CHIP_ERROR TestSendOffCommand_4() + { + chip::Controller::OnOffClusterTest cluster; + cluster.Associate(mDevice, 1); + + return cluster.Off(mOnSuccessCallback_4.Cancel(), mOnFailureCallback_4.Cancel()); + } + + void OnFailureResponse_4(uint8_t status) { ThrowFailureResponse(); } + + void OnSuccessResponse_4() { NextTest(); } + + CHIP_ERROR TestCheckOnOffAttributeValueIsFalseAfterOffCommand_5() + { + chip::Controller::OnOffClusterTest cluster; + cluster.Associate(mDevice, 1); + + return cluster.ReadAttributeOnOff(mOnSuccessCallback_5.Cancel(), mOnFailureCallback_5.Cancel()); + } + + void OnFailureResponse_5(uint8_t status) { ThrowFailureResponse(); } + + void OnSuccessResponse_5(bool onOff) + { + VerifyOrReturn(CheckValue("onOff", onOff, 0)); + NextTest(); + } + + CHIP_ERROR TestSendToggleCommand_6() + { + chip::Controller::OnOffClusterTest cluster; + cluster.Associate(mDevice, 1); + + return cluster.Toggle(mOnSuccessCallback_6.Cancel(), mOnFailureCallback_6.Cancel()); + } + + void OnFailureResponse_6(uint8_t status) { ThrowFailureResponse(); } + + void OnSuccessResponse_6() { NextTest(); } + + CHIP_ERROR TestCheckOnOffAttributeValueIsTrueAfterToggleCommand_7() + { + chip::Controller::OnOffClusterTest cluster; + cluster.Associate(mDevice, 1); + + return cluster.ReadAttributeOnOff(mOnSuccessCallback_7.Cancel(), mOnFailureCallback_7.Cancel()); + } + + void OnFailureResponse_7(uint8_t status) { ThrowFailureResponse(); } + + void OnSuccessResponse_7(bool onOff) + { + VerifyOrReturn(CheckValue("onOff", onOff, 1)); + NextTest(); + } + + CHIP_ERROR TestSendToggleCommand_8() + { + chip::Controller::OnOffClusterTest cluster; + cluster.Associate(mDevice, 1); + + return cluster.Toggle(mOnSuccessCallback_8.Cancel(), mOnFailureCallback_8.Cancel()); + } + + void OnFailureResponse_8(uint8_t status) { ThrowFailureResponse(); } + + void OnSuccessResponse_8() { NextTest(); } + + CHIP_ERROR TestCheckOnOffAttributeValueIsFalseAfterToggleCommand_9() + { + chip::Controller::OnOffClusterTest cluster; + cluster.Associate(mDevice, 1); + + return cluster.ReadAttributeOnOff(mOnSuccessCallback_9.Cancel(), mOnFailureCallback_9.Cancel()); + } + + void OnFailureResponse_9(uint8_t status) { ThrowFailureResponse(); } + + void OnSuccessResponse_9(bool onOff) + { + VerifyOrReturn(CheckValue("onOff", onOff, 0)); + NextTest(); + } + + CHIP_ERROR TestSendOnCommand_10() + { + chip::Controller::OnOffClusterTest cluster; + cluster.Associate(mDevice, 1); + + return cluster.On(mOnSuccessCallback_10.Cancel(), mOnFailureCallback_10.Cancel()); + } + + void OnFailureResponse_10(uint8_t status) { ThrowFailureResponse(); } + + void OnSuccessResponse_10() { NextTest(); } + + CHIP_ERROR TestCheckOnOffAttributeValueIsTrueAfterOnCommand_11() + { + chip::Controller::OnOffClusterTest cluster; + cluster.Associate(mDevice, 1); + + return cluster.ReadAttributeOnOff(mOnSuccessCallback_11.Cancel(), mOnFailureCallback_11.Cancel()); + } + + void OnFailureResponse_11(uint8_t status) { ThrowFailureResponse(); } + + void OnSuccessResponse_11(bool onOff) + { + VerifyOrReturn(CheckValue("onOff", onOff, 1)); + NextTest(); + } + + CHIP_ERROR TestSendOffCommand_12() + { + chip::Controller::OnOffClusterTest cluster; + cluster.Associate(mDevice, 1); + + return cluster.Off(mOnSuccessCallback_12.Cancel(), mOnFailureCallback_12.Cancel()); + } + + void OnFailureResponse_12(uint8_t status) { ThrowFailureResponse(); } + + void OnSuccessResponse_12() { NextTest(); } + + CHIP_ERROR TestCheckOnOffAttributeValueIsFalseAfterOffCommand_13() + { + chip::Controller::OnOffClusterTest cluster; + cluster.Associate(mDevice, 1); + + return cluster.ReadAttributeOnOff(mOnSuccessCallback_13.Cancel(), mOnFailureCallback_13.Cancel()); + } + + void OnFailureResponse_13(uint8_t status) { ThrowFailureResponse(); } + + void OnSuccessResponse_13(bool onOff) + { + VerifyOrReturn(CheckValue("onOff", onOff, 0)); NextTest(); } }; -class TV_MediaPlaybackCluster : public TestCommand +class Test_TC_DM_1_1 : public TestCommand { public: - TV_MediaPlaybackCluster() : TestCommand("TV_MediaPlaybackCluster"), mTestIndex(0) {} + Test_TC_DM_1_1() : TestCommand("Test_TC_DM_1_1"), mTestIndex(0) {} /////////// TestCommand Interface ///////// void NextTest() override @@ -896,12 +1142,12 @@ class TV_MediaPlaybackCluster : public TestCommand if (0 == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Start: TV_MediaPlaybackCluster\n"); + ChipLogProgress(chipTool, " **** Test Start: Test_TC_DM_1_1\n"); } if (mTestCount == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Complete: TV_MediaPlaybackCluster\n"); + ChipLogProgress(chipTool, " **** Test Complete: Test_TC_DM_1_1\n"); SetCommandExitStatus(CHIP_NO_ERROR); return; } @@ -913,48 +1159,76 @@ class TV_MediaPlaybackCluster : public TestCommand switch (mTestIndex++) { case 0: - ChipLogProgress(chipTool, " ***** Test Step 0 : Media Playback Play Command\n"); - err = TestMediaPlaybackPlayCommand_0(); + ChipLogProgress(chipTool, " ***** Test Step 0 : Query Interaction Model Version\n"); + err = TestQueryInteractionModelVersion_0(); break; case 1: - ChipLogProgress(chipTool, " ***** Test Step 1 : Media Playback Pause Command\n"); - err = TestMediaPlaybackPauseCommand_1(); + ChipLogProgress(chipTool, " ***** Test Step 1 : Query Vendor Name\n"); + err = TestQueryVendorName_1(); break; case 2: - ChipLogProgress(chipTool, " ***** Test Step 2 : Media Playback Stop Command\n"); - err = TestMediaPlaybackStopCommand_2(); + ChipLogProgress(chipTool, " ***** Test Step 2 : Query VendorID\n"); + err = TestQueryVendorID_2(); break; case 3: - ChipLogProgress(chipTool, " ***** Test Step 3 : Media Playback Start Over Command\n"); - err = TestMediaPlaybackStartOverCommand_3(); + ChipLogProgress(chipTool, " ***** Test Step 3 : Query Product Name\n"); + err = TestQueryProductName_3(); break; case 4: - ChipLogProgress(chipTool, " ***** Test Step 4 : Media Playback Previous Command\n"); - err = TestMediaPlaybackPreviousCommand_4(); + ChipLogProgress(chipTool, " ***** Test Step 4 : Query ProductID\n"); + err = TestQueryProductID_4(); break; case 5: - ChipLogProgress(chipTool, " ***** Test Step 5 : Media Playback Next Command\n"); - err = TestMediaPlaybackNextCommand_5(); + ChipLogProgress(chipTool, " ***** Test Step 5 : Query User Label\n"); + err = TestQueryUserLabel_5(); break; case 6: - ChipLogProgress(chipTool, " ***** Test Step 6 : Media Playback Rewind Command\n"); - err = TestMediaPlaybackRewindCommand_6(); + ChipLogProgress(chipTool, " ***** Test Step 6 : Query User Location\n"); + err = TestQueryUserLocation_6(); break; case 7: - ChipLogProgress(chipTool, " ***** Test Step 7 : Media Playback Fast Forward Command\n"); - err = TestMediaPlaybackFastForwardCommand_7(); + ChipLogProgress(chipTool, " ***** Test Step 7 : Query HardwareVersion\n"); + err = TestQueryHardwareVersion_7(); break; case 8: - ChipLogProgress(chipTool, " ***** Test Step 8 : Media Playback Skip Forward Command\n"); - err = TestMediaPlaybackSkipForwardCommand_8(); + ChipLogProgress(chipTool, " ***** Test Step 8 : Query HardwareVersionString\n"); + err = TestQueryHardwareVersionString_8(); break; case 9: - ChipLogProgress(chipTool, " ***** Test Step 9 : Media Playback Skip Backward Command\n"); - err = TestMediaPlaybackSkipBackwardCommand_9(); + ChipLogProgress(chipTool, " ***** Test Step 9 : Query SoftwareVersion\n"); + err = TestQuerySoftwareVersion_9(); break; case 10: - ChipLogProgress(chipTool, " ***** Test Step 10 : Media Playback Seek Command\n"); - err = TestMediaPlaybackSeekCommand_10(); + ChipLogProgress(chipTool, " ***** Test Step 10 : Query SoftwareVersionString\n"); + err = TestQuerySoftwareVersionString_10(); + break; + case 11: + ChipLogProgress(chipTool, " ***** Test Step 11 : Query ManufacturingDate\n"); + err = TestQueryManufacturingDate_11(); + break; + case 12: + ChipLogProgress(chipTool, " ***** Test Step 12 : Query PartNumber\n"); + err = TestQueryPartNumber_12(); + break; + case 13: + ChipLogProgress(chipTool, " ***** Test Step 13 : Query ProductURL\n"); + err = TestQueryProductURL_13(); + break; + case 14: + ChipLogProgress(chipTool, " ***** Test Step 14 : Query ProductLabel\n"); + err = TestQueryProductLabel_14(); + break; + case 15: + ChipLogProgress(chipTool, " ***** Test Step 15 : Query SerialNumber\n"); + err = TestQuerySerialNumber_15(); + break; + case 16: + ChipLogProgress(chipTool, " ***** Test Step 16 : Query LocalConfigDisabled\n"); + err = TestQueryLocalConfigDisabled_16(); + break; + case 17: + ChipLogProgress(chipTool, " ***** Test Step 17 : Query Reachable\n"); + err = TestQueryReachable_17(); break; } @@ -967,510 +1241,598 @@ class TV_MediaPlaybackCluster : public TestCommand private: std::atomic_uint16_t mTestIndex; - const uint16_t mTestCount = 11; + const uint16_t mTestCount = 18; chip::Callback::Callback mOnFailureCallback_0{ OnFailureCallback_0, this }; - chip::Callback::Callback mOnSuccessCallback_0{ OnSuccessCallback_0, - this }; + chip::Callback::Callback mOnSuccessCallback_0{ OnSuccessCallback_0, + this }; chip::Callback::Callback mOnFailureCallback_1{ OnFailureCallback_1, this }; - chip::Callback::Callback mOnSuccessCallback_1{ OnSuccessCallback_1, - this }; + chip::Callback::Callback mOnSuccessCallback_1{ OnSuccessCallback_1, this }; chip::Callback::Callback mOnFailureCallback_2{ OnFailureCallback_2, this }; - chip::Callback::Callback mOnSuccessCallback_2{ OnSuccessCallback_2, - this }; + chip::Callback::Callback mOnSuccessCallback_2{ OnSuccessCallback_2, this }; chip::Callback::Callback mOnFailureCallback_3{ OnFailureCallback_3, this }; - chip::Callback::Callback mOnSuccessCallback_3{ OnSuccessCallback_3, - this }; + chip::Callback::Callback mOnSuccessCallback_3{ OnSuccessCallback_3, + this }; chip::Callback::Callback mOnFailureCallback_4{ OnFailureCallback_4, this }; - chip::Callback::Callback mOnSuccessCallback_4{ OnSuccessCallback_4, - this }; + chip::Callback::Callback mOnSuccessCallback_4{ OnSuccessCallback_4, this }; chip::Callback::Callback mOnFailureCallback_5{ OnFailureCallback_5, this }; - chip::Callback::Callback mOnSuccessCallback_5{ OnSuccessCallback_5, - this }; + chip::Callback::Callback mOnSuccessCallback_5{ OnSuccessCallback_5, this }; chip::Callback::Callback mOnFailureCallback_6{ OnFailureCallback_6, this }; - chip::Callback::Callback mOnSuccessCallback_6{ OnSuccessCallback_6, - this }; + chip::Callback::Callback mOnSuccessCallback_6{ OnSuccessCallback_6, this }; chip::Callback::Callback mOnFailureCallback_7{ OnFailureCallback_7, this }; - chip::Callback::Callback mOnSuccessCallback_7{ OnSuccessCallback_7, - this }; + chip::Callback::Callback mOnSuccessCallback_7{ OnSuccessCallback_7, this }; chip::Callback::Callback mOnFailureCallback_8{ OnFailureCallback_8, this }; - chip::Callback::Callback mOnSuccessCallback_8{ OnSuccessCallback_8, - this }; + chip::Callback::Callback mOnSuccessCallback_8{ + OnSuccessCallback_8, this + }; chip::Callback::Callback mOnFailureCallback_9{ OnFailureCallback_9, this }; - chip::Callback::Callback mOnSuccessCallback_9{ OnSuccessCallback_9, - this }; + chip::Callback::Callback mOnSuccessCallback_9{ OnSuccessCallback_9, this }; chip::Callback::Callback mOnFailureCallback_10{ OnFailureCallback_10, this }; - chip::Callback::Callback mOnSuccessCallback_10{ OnSuccessCallback_10, + chip::Callback::Callback mOnSuccessCallback_10{ + OnSuccessCallback_10, this + }; + chip::Callback::Callback mOnFailureCallback_11{ OnFailureCallback_11, this }; + chip::Callback::Callback mOnSuccessCallback_11{ + OnSuccessCallback_11, this + }; + chip::Callback::Callback mOnFailureCallback_12{ OnFailureCallback_12, this }; + chip::Callback::Callback mOnSuccessCallback_12{ OnSuccessCallback_12, + this }; + chip::Callback::Callback mOnFailureCallback_13{ OnFailureCallback_13, this }; + chip::Callback::Callback mOnSuccessCallback_13{ OnSuccessCallback_13, + this }; + chip::Callback::Callback mOnFailureCallback_14{ OnFailureCallback_14, this }; + chip::Callback::Callback mOnSuccessCallback_14{ OnSuccessCallback_14, + this }; + chip::Callback::Callback mOnFailureCallback_15{ OnFailureCallback_15, this }; + chip::Callback::Callback mOnSuccessCallback_15{ OnSuccessCallback_15, this }; + chip::Callback::Callback mOnFailureCallback_16{ OnFailureCallback_16, this }; + chip::Callback::Callback mOnSuccessCallback_16{ OnSuccessCallback_16, + this }; + chip::Callback::Callback mOnFailureCallback_17{ OnFailureCallback_17, this }; + chip::Callback::Callback mOnSuccessCallback_17{ OnSuccessCallback_17, this }; static void OnFailureCallback_0(void * context, uint8_t status) { - (static_cast(context))->OnFailureResponse_0(status); + (static_cast(context))->OnFailureResponse_0(status); } - static void OnSuccessCallback_0(void * context, uint8_t mediaPlaybackStatus) + static void OnSuccessCallback_0(void * context, uint16_t interactionModelVersion) { - (static_cast(context))->OnSuccessResponse_0(mediaPlaybackStatus); + (static_cast(context))->OnSuccessResponse_0(interactionModelVersion); } static void OnFailureCallback_1(void * context, uint8_t status) { - (static_cast(context))->OnFailureResponse_1(status); + (static_cast(context))->OnFailureResponse_1(status); } - static void OnSuccessCallback_1(void * context, uint8_t mediaPlaybackStatus) + static void OnSuccessCallback_1(void * context, chip::ByteSpan vendorName) { - (static_cast(context))->OnSuccessResponse_1(mediaPlaybackStatus); + (static_cast(context))->OnSuccessResponse_1(vendorName); } static void OnFailureCallback_2(void * context, uint8_t status) { - (static_cast(context))->OnFailureResponse_2(status); + (static_cast(context))->OnFailureResponse_2(status); } - static void OnSuccessCallback_2(void * context, uint8_t mediaPlaybackStatus) + static void OnSuccessCallback_2(void * context, uint16_t vendorID) { - (static_cast(context))->OnSuccessResponse_2(mediaPlaybackStatus); + (static_cast(context))->OnSuccessResponse_2(vendorID); } static void OnFailureCallback_3(void * context, uint8_t status) { - (static_cast(context))->OnFailureResponse_3(status); + (static_cast(context))->OnFailureResponse_3(status); } - static void OnSuccessCallback_3(void * context, uint8_t mediaPlaybackStatus) + static void OnSuccessCallback_3(void * context, chip::ByteSpan productName) { - (static_cast(context))->OnSuccessResponse_3(mediaPlaybackStatus); + (static_cast(context))->OnSuccessResponse_3(productName); } static void OnFailureCallback_4(void * context, uint8_t status) { - (static_cast(context))->OnFailureResponse_4(status); + (static_cast(context))->OnFailureResponse_4(status); } - static void OnSuccessCallback_4(void * context, uint8_t mediaPlaybackStatus) + static void OnSuccessCallback_4(void * context, uint16_t productID) { - (static_cast(context))->OnSuccessResponse_4(mediaPlaybackStatus); + (static_cast(context))->OnSuccessResponse_4(productID); } static void OnFailureCallback_5(void * context, uint8_t status) { - (static_cast(context))->OnFailureResponse_5(status); + (static_cast(context))->OnFailureResponse_5(status); } - static void OnSuccessCallback_5(void * context, uint8_t mediaPlaybackStatus) + static void OnSuccessCallback_5(void * context, chip::ByteSpan userLabel) { - (static_cast(context))->OnSuccessResponse_5(mediaPlaybackStatus); + (static_cast(context))->OnSuccessResponse_5(userLabel); } static void OnFailureCallback_6(void * context, uint8_t status) { - (static_cast(context))->OnFailureResponse_6(status); + (static_cast(context))->OnFailureResponse_6(status); } - static void OnSuccessCallback_6(void * context, uint8_t mediaPlaybackStatus) + static void OnSuccessCallback_6(void * context, chip::ByteSpan location) { - (static_cast(context))->OnSuccessResponse_6(mediaPlaybackStatus); + (static_cast(context))->OnSuccessResponse_6(location); } static void OnFailureCallback_7(void * context, uint8_t status) { - (static_cast(context))->OnFailureResponse_7(status); + (static_cast(context))->OnFailureResponse_7(status); } - static void OnSuccessCallback_7(void * context, uint8_t mediaPlaybackStatus) + static void OnSuccessCallback_7(void * context, uint16_t hardwareVersion) { - (static_cast(context))->OnSuccessResponse_7(mediaPlaybackStatus); + (static_cast(context))->OnSuccessResponse_7(hardwareVersion); } static void OnFailureCallback_8(void * context, uint8_t status) { - (static_cast(context))->OnFailureResponse_8(status); + (static_cast(context))->OnFailureResponse_8(status); } - static void OnSuccessCallback_8(void * context, uint8_t mediaPlaybackStatus) + static void OnSuccessCallback_8(void * context, chip::ByteSpan hardwareVersionString) { - (static_cast(context))->OnSuccessResponse_8(mediaPlaybackStatus); + (static_cast(context))->OnSuccessResponse_8(hardwareVersionString); } static void OnFailureCallback_9(void * context, uint8_t status) { - (static_cast(context))->OnFailureResponse_9(status); + (static_cast(context))->OnFailureResponse_9(status); } - static void OnSuccessCallback_9(void * context, uint8_t mediaPlaybackStatus) + static void OnSuccessCallback_9(void * context, uint32_t softwareVersion) { - (static_cast(context))->OnSuccessResponse_9(mediaPlaybackStatus); + (static_cast(context))->OnSuccessResponse_9(softwareVersion); } static void OnFailureCallback_10(void * context, uint8_t status) { - (static_cast(context))->OnFailureResponse_10(status); + (static_cast(context))->OnFailureResponse_10(status); } - static void OnSuccessCallback_10(void * context, uint8_t mediaPlaybackStatus) + static void OnSuccessCallback_10(void * context, chip::ByteSpan softwareVersionString) { - (static_cast(context))->OnSuccessResponse_10(mediaPlaybackStatus); + (static_cast(context))->OnSuccessResponse_10(softwareVersionString); } - // - // Tests methods - // - - CHIP_ERROR TestMediaPlaybackPlayCommand_0() + static void OnFailureCallback_11(void * context, uint8_t status) { - chip::Controller::MediaPlaybackClusterTest cluster; - cluster.Associate(mDevice, 3); - - return cluster.MediaPlay(mOnSuccessCallback_0.Cancel(), mOnFailureCallback_0.Cancel()); + (static_cast(context))->OnFailureResponse_11(status); } - void OnFailureResponse_0(uint8_t status) { ThrowFailureResponse(); } - - void OnSuccessResponse_0(uint8_t mediaPlaybackStatus) + static void OnSuccessCallback_11(void * context, chip::ByteSpan manufacturingDate) { - VerifyOrReturn(CheckValue("mediaPlaybackStatus", mediaPlaybackStatus, 0)); - NextTest(); + (static_cast(context))->OnSuccessResponse_11(manufacturingDate); } - CHIP_ERROR TestMediaPlaybackPauseCommand_1() + static void OnFailureCallback_12(void * context, uint8_t status) { - chip::Controller::MediaPlaybackClusterTest cluster; - cluster.Associate(mDevice, 3); + (static_cast(context))->OnFailureResponse_12(status); + } - return cluster.MediaPause(mOnSuccessCallback_1.Cancel(), mOnFailureCallback_1.Cancel()); + static void OnSuccessCallback_12(void * context, chip::ByteSpan partNumber) + { + (static_cast(context))->OnSuccessResponse_12(partNumber); } - void OnFailureResponse_1(uint8_t status) { ThrowFailureResponse(); } + static void OnFailureCallback_13(void * context, uint8_t status) + { + (static_cast(context))->OnFailureResponse_13(status); + } - void OnSuccessResponse_1(uint8_t mediaPlaybackStatus) + static void OnSuccessCallback_13(void * context, chip::ByteSpan productURL) { - VerifyOrReturn(CheckValue("mediaPlaybackStatus", mediaPlaybackStatus, 0)); - NextTest(); + (static_cast(context))->OnSuccessResponse_13(productURL); } - CHIP_ERROR TestMediaPlaybackStopCommand_2() + static void OnFailureCallback_14(void * context, uint8_t status) { - chip::Controller::MediaPlaybackClusterTest cluster; - cluster.Associate(mDevice, 3); + (static_cast(context))->OnFailureResponse_14(status); + } - return cluster.MediaStop(mOnSuccessCallback_2.Cancel(), mOnFailureCallback_2.Cancel()); + static void OnSuccessCallback_14(void * context, chip::ByteSpan productLabel) + { + (static_cast(context))->OnSuccessResponse_14(productLabel); } - void OnFailureResponse_2(uint8_t status) { ThrowFailureResponse(); } + static void OnFailureCallback_15(void * context, uint8_t status) + { + (static_cast(context))->OnFailureResponse_15(status); + } - void OnSuccessResponse_2(uint8_t mediaPlaybackStatus) + static void OnSuccessCallback_15(void * context, chip::ByteSpan serialNumber) { - VerifyOrReturn(CheckValue("mediaPlaybackStatus", mediaPlaybackStatus, 0)); - NextTest(); + (static_cast(context))->OnSuccessResponse_15(serialNumber); } - CHIP_ERROR TestMediaPlaybackStartOverCommand_3() + static void OnFailureCallback_16(void * context, uint8_t status) { - chip::Controller::MediaPlaybackClusterTest cluster; - cluster.Associate(mDevice, 3); + (static_cast(context))->OnFailureResponse_16(status); + } - return cluster.MediaStartOver(mOnSuccessCallback_3.Cancel(), mOnFailureCallback_3.Cancel()); + static void OnSuccessCallback_16(void * context, bool localConfigDisabled) + { + (static_cast(context))->OnSuccessResponse_16(localConfigDisabled); } - void OnFailureResponse_3(uint8_t status) { ThrowFailureResponse(); } + static void OnFailureCallback_17(void * context, uint8_t status) + { + (static_cast(context))->OnFailureResponse_17(status); + } - void OnSuccessResponse_3(uint8_t mediaPlaybackStatus) + static void OnSuccessCallback_17(void * context, bool reachable) { - VerifyOrReturn(CheckValue("mediaPlaybackStatus", mediaPlaybackStatus, 0)); - NextTest(); + (static_cast(context))->OnSuccessResponse_17(reachable); } - CHIP_ERROR TestMediaPlaybackPreviousCommand_4() + // + // Tests methods + // + + CHIP_ERROR TestQueryInteractionModelVersion_0() { - chip::Controller::MediaPlaybackClusterTest cluster; - cluster.Associate(mDevice, 3); + chip::Controller::BasicClusterTest cluster; + cluster.Associate(mDevice, 0); - return cluster.MediaPrevious(mOnSuccessCallback_4.Cancel(), mOnFailureCallback_4.Cancel()); + return cluster.ReadAttributeInteractionModelVersion(mOnSuccessCallback_0.Cancel(), mOnFailureCallback_0.Cancel()); } - void OnFailureResponse_4(uint8_t status) { ThrowFailureResponse(); } + void OnFailureResponse_0(uint8_t status) { ThrowFailureResponse(); } - void OnSuccessResponse_4(uint8_t mediaPlaybackStatus) + void OnSuccessResponse_0(uint16_t interactionModelVersion) { - VerifyOrReturn(CheckValue("mediaPlaybackStatus", mediaPlaybackStatus, 0)); + VerifyOrReturn(CheckConstraintType("interactionModelVersion", "", "uint16")); NextTest(); } - CHIP_ERROR TestMediaPlaybackNextCommand_5() + CHIP_ERROR TestQueryVendorName_1() { - chip::Controller::MediaPlaybackClusterTest cluster; - cluster.Associate(mDevice, 3); + chip::Controller::BasicClusterTest cluster; + cluster.Associate(mDevice, 0); - return cluster.MediaNext(mOnSuccessCallback_5.Cancel(), mOnFailureCallback_5.Cancel()); + return cluster.ReadAttributeVendorName(mOnSuccessCallback_1.Cancel(), mOnFailureCallback_1.Cancel()); } - void OnFailureResponse_5(uint8_t status) { ThrowFailureResponse(); } + void OnFailureResponse_1(uint8_t status) { ThrowFailureResponse(); } - void OnSuccessResponse_5(uint8_t mediaPlaybackStatus) + void OnSuccessResponse_1(chip::ByteSpan vendorName) { - VerifyOrReturn(CheckValue("mediaPlaybackStatus", mediaPlaybackStatus, 0)); + VerifyOrReturn(CheckConstraintType("vendorName", "", "string")); + VerifyOrReturn(CheckConstraintMaxLength("vendorName", vendorName.size(), 32)); NextTest(); } - CHIP_ERROR TestMediaPlaybackRewindCommand_6() + CHIP_ERROR TestQueryVendorID_2() { - chip::Controller::MediaPlaybackClusterTest cluster; - cluster.Associate(mDevice, 3); + chip::Controller::BasicClusterTest cluster; + cluster.Associate(mDevice, 0); - return cluster.MediaRewind(mOnSuccessCallback_6.Cancel(), mOnFailureCallback_6.Cancel()); + return cluster.ReadAttributeVendorID(mOnSuccessCallback_2.Cancel(), mOnFailureCallback_2.Cancel()); } - void OnFailureResponse_6(uint8_t status) { ThrowFailureResponse(); } + void OnFailureResponse_2(uint8_t status) { ThrowFailureResponse(); } - void OnSuccessResponse_6(uint8_t mediaPlaybackStatus) + void OnSuccessResponse_2(uint16_t vendorID) { - VerifyOrReturn(CheckValue("mediaPlaybackStatus", mediaPlaybackStatus, 0)); + VerifyOrReturn(CheckConstraintType("vendorID", "", "uint16")); NextTest(); } - CHIP_ERROR TestMediaPlaybackFastForwardCommand_7() + CHIP_ERROR TestQueryProductName_3() { - chip::Controller::MediaPlaybackClusterTest cluster; - cluster.Associate(mDevice, 3); + chip::Controller::BasicClusterTest cluster; + cluster.Associate(mDevice, 0); - return cluster.MediaFastForward(mOnSuccessCallback_7.Cancel(), mOnFailureCallback_7.Cancel()); + return cluster.ReadAttributeProductName(mOnSuccessCallback_3.Cancel(), mOnFailureCallback_3.Cancel()); } - void OnFailureResponse_7(uint8_t status) { ThrowFailureResponse(); } + void OnFailureResponse_3(uint8_t status) { ThrowFailureResponse(); } - void OnSuccessResponse_7(uint8_t mediaPlaybackStatus) + void OnSuccessResponse_3(chip::ByteSpan productName) { - VerifyOrReturn(CheckValue("mediaPlaybackStatus", mediaPlaybackStatus, 0)); + VerifyOrReturn(CheckConstraintType("productName", "", "string")); + VerifyOrReturn(CheckConstraintMaxLength("productName", productName.size(), 32)); NextTest(); } - CHIP_ERROR TestMediaPlaybackSkipForwardCommand_8() + CHIP_ERROR TestQueryProductID_4() { - chip::Controller::MediaPlaybackClusterTest cluster; - cluster.Associate(mDevice, 3); - - uint64_t deltaPositionMillisecondsArgument = 100ULL; + chip::Controller::BasicClusterTest cluster; + cluster.Associate(mDevice, 0); - return cluster.MediaSkipForward(mOnSuccessCallback_8.Cancel(), mOnFailureCallback_8.Cancel(), - deltaPositionMillisecondsArgument); + return cluster.ReadAttributeProductID(mOnSuccessCallback_4.Cancel(), mOnFailureCallback_4.Cancel()); } - void OnFailureResponse_8(uint8_t status) { ThrowFailureResponse(); } + void OnFailureResponse_4(uint8_t status) { ThrowFailureResponse(); } - void OnSuccessResponse_8(uint8_t mediaPlaybackStatus) + void OnSuccessResponse_4(uint16_t productID) { - VerifyOrReturn(CheckValue("mediaPlaybackStatus", mediaPlaybackStatus, 0)); + VerifyOrReturn(CheckConstraintType("productID", "", "uint16")); NextTest(); } - CHIP_ERROR TestMediaPlaybackSkipBackwardCommand_9() + CHIP_ERROR TestQueryUserLabel_5() { - chip::Controller::MediaPlaybackClusterTest cluster; - cluster.Associate(mDevice, 3); - - uint64_t deltaPositionMillisecondsArgument = 100ULL; + chip::Controller::BasicClusterTest cluster; + cluster.Associate(mDevice, 0); - return cluster.MediaSkipBackward(mOnSuccessCallback_9.Cancel(), mOnFailureCallback_9.Cancel(), - deltaPositionMillisecondsArgument); + return cluster.ReadAttributeUserLabel(mOnSuccessCallback_5.Cancel(), mOnFailureCallback_5.Cancel()); } - void OnFailureResponse_9(uint8_t status) { ThrowFailureResponse(); } + void OnFailureResponse_5(uint8_t status) { ThrowFailureResponse(); } - void OnSuccessResponse_9(uint8_t mediaPlaybackStatus) + void OnSuccessResponse_5(chip::ByteSpan userLabel) { - VerifyOrReturn(CheckValue("mediaPlaybackStatus", mediaPlaybackStatus, 0)); + VerifyOrReturn(CheckConstraintType("userLabel", "", "string")); + VerifyOrReturn(CheckConstraintMaxLength("userLabel", userLabel.size(), 32)); NextTest(); } - CHIP_ERROR TestMediaPlaybackSeekCommand_10() + CHIP_ERROR TestQueryUserLocation_6() { - chip::Controller::MediaPlaybackClusterTest cluster; - cluster.Associate(mDevice, 3); - - uint64_t positionArgument = 100ULL; + chip::Controller::BasicClusterTest cluster; + cluster.Associate(mDevice, 0); - return cluster.MediaSeek(mOnSuccessCallback_10.Cancel(), mOnFailureCallback_10.Cancel(), positionArgument); + return cluster.ReadAttributeLocation(mOnSuccessCallback_6.Cancel(), mOnFailureCallback_6.Cancel()); } - void OnFailureResponse_10(uint8_t status) { ThrowFailureResponse(); } + void OnFailureResponse_6(uint8_t status) { ThrowFailureResponse(); } - void OnSuccessResponse_10(uint8_t mediaPlaybackStatus) + void OnSuccessResponse_6(chip::ByteSpan location) { - VerifyOrReturn(CheckValue("mediaPlaybackStatus", mediaPlaybackStatus, 0)); + VerifyOrReturn(CheckConstraintType("location", "", "string")); + VerifyOrReturn(CheckConstraintFormat("location", "", "ISO 3166-1 alpha-2")); + VerifyOrReturn(CheckConstraintMaxLength("location", location.size(), 2)); NextTest(); } -}; - -class TV_TvChannelCluster : public TestCommand -{ -public: - TV_TvChannelCluster() : TestCommand("TV_TvChannelCluster"), mTestIndex(0) {} - /////////// TestCommand Interface ///////// - void NextTest() override + CHIP_ERROR TestQueryHardwareVersion_7() { - CHIP_ERROR err = CHIP_NO_ERROR; - - if (0 == mTestIndex) - { - ChipLogProgress(chipTool, " **** Test Start: TV_TvChannelCluster\n"); - } + chip::Controller::BasicClusterTest cluster; + cluster.Associate(mDevice, 0); - if (mTestCount == mTestIndex) - { - ChipLogProgress(chipTool, " **** Test Complete: TV_TvChannelCluster\n"); - SetCommandExitStatus(CHIP_NO_ERROR); - return; - } + return cluster.ReadAttributeHardwareVersion(mOnSuccessCallback_7.Cancel(), mOnFailureCallback_7.Cancel()); + } - // Ensure we increment mTestIndex before we start running the relevant - // command. That way if we lose the timeslice after we send the message - // but before our function call returns, we won't end up with an - // incorrect mTestIndex value observed when we get the response. - switch (mTestIndex++) - { - case 0: - ChipLogProgress(chipTool, " ***** Test Step 0 : Read attribute TV Channel list\n"); - err = TestReadAttributeTvChannelList_0(); - break; - case 1: - ChipLogProgress(chipTool, " ***** Test Step 1 : Change Channel By Number Command\n"); - err = TestChangeChannelByNumberCommand_1(); - break; - case 2: - ChipLogProgress(chipTool, " ***** Test Step 2 : Skip Channel Command\n"); - err = TestSkipChannelCommand_2(); - break; - } + void OnFailureResponse_7(uint8_t status) { ThrowFailureResponse(); } - if (CHIP_NO_ERROR != err) - { - ChipLogError(chipTool, " ***** Test Failure: %s\n", chip::ErrorStr(err)); - SetCommandExitStatus(err); - } + void OnSuccessResponse_7(uint16_t hardwareVersion) + { + VerifyOrReturn(CheckConstraintType("hardwareVersion", "", "uint16")); + NextTest(); } -private: - std::atomic_uint16_t mTestIndex; - const uint16_t mTestCount = 3; + CHIP_ERROR TestQueryHardwareVersionString_8() + { + chip::Controller::BasicClusterTest cluster; + cluster.Associate(mDevice, 0); - chip::Callback::Callback mOnFailureCallback_0{ OnFailureCallback_0, this }; - chip::Callback::Callback mOnSuccessCallback_0{ - OnSuccessCallback_0, this - }; - chip::Callback::Callback mOnFailureCallback_1{ OnFailureCallback_1, this }; - chip::Callback::Callback mOnSuccessCallback_1{ OnSuccessCallback_1, this }; - chip::Callback::Callback mOnFailureCallback_2{ OnFailureCallback_2, this }; - chip::Callback::Callback mOnSuccessCallback_2{ OnSuccessCallback_2, this }; + return cluster.ReadAttributeHardwareVersionString(mOnSuccessCallback_8.Cancel(), mOnFailureCallback_8.Cancel()); + } - static void OnFailureCallback_0(void * context, uint8_t status) + void OnFailureResponse_8(uint8_t status) { ThrowFailureResponse(); } + + void OnSuccessResponse_8(chip::ByteSpan hardwareVersionString) { - (static_cast(context))->OnFailureResponse_0(status); + VerifyOrReturn(CheckConstraintType("hardwareVersionString", "", "string")); + VerifyOrReturn(CheckConstraintMinLength("hardwareVersionString", hardwareVersionString.size(), 1)); + VerifyOrReturn(CheckConstraintMaxLength("hardwareVersionString", hardwareVersionString.size(), 64)); + NextTest(); } - static void OnSuccessCallback_0(void * context, uint16_t count, _TvChannelInfo * tvChannelList) + CHIP_ERROR TestQuerySoftwareVersion_9() { - (static_cast(context))->OnSuccessResponse_0(count, tvChannelList); + chip::Controller::BasicClusterTest cluster; + cluster.Associate(mDevice, 0); + + return cluster.ReadAttributeSoftwareVersion(mOnSuccessCallback_9.Cancel(), mOnFailureCallback_9.Cancel()); } - static void OnFailureCallback_1(void * context, uint8_t status) + void OnFailureResponse_9(uint8_t status) { ThrowFailureResponse(); } + + void OnSuccessResponse_9(uint32_t softwareVersion) { - (static_cast(context))->OnFailureResponse_1(status); + VerifyOrReturn(CheckConstraintType("softwareVersion", "", "uint32")); + NextTest(); } - static void OnSuccessCallback_1(void * context) { (static_cast(context))->OnSuccessResponse_1(); } - - static void OnFailureCallback_2(void * context, uint8_t status) + CHIP_ERROR TestQuerySoftwareVersionString_10() { - (static_cast(context))->OnFailureResponse_2(status); + chip::Controller::BasicClusterTest cluster; + cluster.Associate(mDevice, 0); + + return cluster.ReadAttributeSoftwareVersionString(mOnSuccessCallback_10.Cancel(), mOnFailureCallback_10.Cancel()); } - static void OnSuccessCallback_2(void * context) { (static_cast(context))->OnSuccessResponse_2(); } + void OnFailureResponse_10(uint8_t status) { ThrowFailureResponse(); } - // - // Tests methods - // + void OnSuccessResponse_10(chip::ByteSpan softwareVersionString) + { + VerifyOrReturn(CheckConstraintType("softwareVersionString", "", "string")); + VerifyOrReturn(CheckConstraintFormat("softwareVersionString", "", "ASCII")); + VerifyOrReturn(CheckConstraintMinLength("softwareVersionString", softwareVersionString.size(), 1)); + VerifyOrReturn(CheckConstraintMaxLength("softwareVersionString", softwareVersionString.size(), 64)); + NextTest(); + } - CHIP_ERROR TestReadAttributeTvChannelList_0() + CHIP_ERROR TestQueryManufacturingDate_11() { - chip::Controller::TvChannelClusterTest cluster; - cluster.Associate(mDevice, 1); + chip::Controller::BasicClusterTest cluster; + cluster.Associate(mDevice, 0); - return cluster.ReadAttributeTvChannelList(mOnSuccessCallback_0.Cancel(), mOnFailureCallback_0.Cancel()); + return cluster.ReadAttributeManufacturingDate(mOnSuccessCallback_11.Cancel(), mOnFailureCallback_11.Cancel()); } - void OnFailureResponse_0(uint8_t status) { ThrowFailureResponse(); } + void OnFailureResponse_11(uint8_t status) + { + (status == EMBER_ZCL_STATUS_UNSUPPORTED_ATTRIBUTE) ? NextTest() : ThrowFailureResponse(); + } - void OnSuccessResponse_0(uint16_t count, _TvChannelInfo * tvChannelList) + void OnSuccessResponse_11(chip::ByteSpan manufacturingDate) { - VerifyOrReturn(CheckValueAsList("tvChannelList", count, 2)); + VerifyOrReturn(CheckConstraintType("manufacturingDate", "", "string")); + VerifyOrReturn(CheckConstraintFormat("manufacturingDate", "", "ISO 8601")); + VerifyOrReturn(CheckConstraintMinLength("manufacturingDate", manufacturingDate.size(), 8)); + VerifyOrReturn(CheckConstraintMaxLength("manufacturingDate", manufacturingDate.size(), 16)); NextTest(); } - CHIP_ERROR TestChangeChannelByNumberCommand_1() + CHIP_ERROR TestQueryPartNumber_12() { - chip::Controller::TvChannelClusterTest cluster; - cluster.Associate(mDevice, 1); - - uint16_t majorNumberArgument = 1U; - uint16_t minorNumberArgument = 2U; + chip::Controller::BasicClusterTest cluster; + cluster.Associate(mDevice, 0); - return cluster.ChangeChannelByNumber(mOnSuccessCallback_1.Cancel(), mOnFailureCallback_1.Cancel(), majorNumberArgument, - minorNumberArgument); + return cluster.ReadAttributePartNumber(mOnSuccessCallback_12.Cancel(), mOnFailureCallback_12.Cancel()); } - void OnFailureResponse_1(uint8_t status) { ThrowFailureResponse(); } + void OnFailureResponse_12(uint8_t status) + { + (status == EMBER_ZCL_STATUS_UNSUPPORTED_ATTRIBUTE) ? NextTest() : ThrowFailureResponse(); + } - void OnSuccessResponse_1() { NextTest(); } + void OnSuccessResponse_12(chip::ByteSpan partNumber) + { + VerifyOrReturn(CheckConstraintType("partNumber", "", "string")); + VerifyOrReturn(CheckConstraintMaxLength("partNumber", partNumber.size(), 32)); + NextTest(); + } - CHIP_ERROR TestSkipChannelCommand_2() + CHIP_ERROR TestQueryProductURL_13() { - chip::Controller::TvChannelClusterTest cluster; - cluster.Associate(mDevice, 1); + chip::Controller::BasicClusterTest cluster; + cluster.Associate(mDevice, 0); - uint16_t countArgument = 1U; + return cluster.ReadAttributeProductURL(mOnSuccessCallback_13.Cancel(), mOnFailureCallback_13.Cancel()); + } - return cluster.SkipChannel(mOnSuccessCallback_2.Cancel(), mOnFailureCallback_2.Cancel(), countArgument); + void OnFailureResponse_13(uint8_t status) + { + (status == EMBER_ZCL_STATUS_UNSUPPORTED_ATTRIBUTE) ? NextTest() : ThrowFailureResponse(); } - void OnFailureResponse_2(uint8_t status) { ThrowFailureResponse(); } + void OnSuccessResponse_13(chip::ByteSpan productURL) + { + VerifyOrReturn(CheckConstraintType("productURL", "", "string")); + VerifyOrReturn(CheckConstraintFormat("productURL", "", "RFC3986")); + VerifyOrReturn(CheckConstraintMaxLength("productURL", productURL.size(), 256)); + NextTest(); + } - void OnSuccessResponse_2() { NextTest(); } -}; + CHIP_ERROR TestQueryProductLabel_14() + { + chip::Controller::BasicClusterTest cluster; + cluster.Associate(mDevice, 0); -class TV_LowPowerCluster : public TestCommand -{ -public: - TV_LowPowerCluster() : TestCommand("TV_LowPowerCluster"), mTestIndex(0) {} + return cluster.ReadAttributeProductLabel(mOnSuccessCallback_14.Cancel(), mOnFailureCallback_14.Cancel()); + } - /////////// TestCommand Interface ///////// - void NextTest() override + void OnFailureResponse_14(uint8_t status) { - CHIP_ERROR err = CHIP_NO_ERROR; + (status == EMBER_ZCL_STATUS_UNSUPPORTED_ATTRIBUTE) ? NextTest() : ThrowFailureResponse(); + } - if (0 == mTestIndex) - { - ChipLogProgress(chipTool, " **** Test Start: TV_LowPowerCluster\n"); - } + void OnSuccessResponse_14(chip::ByteSpan productLabel) + { + VerifyOrReturn(CheckConstraintType("productLabel", "", "string")); + VerifyOrReturn(CheckConstraintMaxLength("productLabel", productLabel.size(), 64)); + NextTest(); + } - if (mTestCount == mTestIndex) - { - ChipLogProgress(chipTool, " **** Test Complete: TV_LowPowerCluster\n"); - SetCommandExitStatus(CHIP_NO_ERROR); - return; - } + CHIP_ERROR TestQuerySerialNumber_15() + { + chip::Controller::BasicClusterTest cluster; + cluster.Associate(mDevice, 0); - // Ensure we increment mTestIndex before we start running the relevant - // command. That way if we lose the timeslice after we send the message - // but before our function call returns, we won't end up with an - // incorrect mTestIndex value observed when we get the response. + return cluster.ReadAttributeSerialNumber(mOnSuccessCallback_15.Cancel(), mOnFailureCallback_15.Cancel()); + } + + void OnFailureResponse_15(uint8_t status) + { + (status == EMBER_ZCL_STATUS_UNSUPPORTED_ATTRIBUTE) ? NextTest() : ThrowFailureResponse(); + } + + void OnSuccessResponse_15(chip::ByteSpan serialNumber) + { + VerifyOrReturn(CheckConstraintType("serialNumber", "", "string")); + VerifyOrReturn(CheckConstraintMaxLength("serialNumber", serialNumber.size(), 32)); + NextTest(); + } + + CHIP_ERROR TestQueryLocalConfigDisabled_16() + { + chip::Controller::BasicClusterTest cluster; + cluster.Associate(mDevice, 0); + + return cluster.ReadAttributeLocalConfigDisabled(mOnSuccessCallback_16.Cancel(), mOnFailureCallback_16.Cancel()); + } + + void OnFailureResponse_16(uint8_t status) + { + (status == EMBER_ZCL_STATUS_UNSUPPORTED_ATTRIBUTE) ? NextTest() : ThrowFailureResponse(); + } + + void OnSuccessResponse_16(bool localConfigDisabled) + { + VerifyOrReturn(CheckConstraintType("localConfigDisabled", "", "boolean")); + NextTest(); + } + + CHIP_ERROR TestQueryReachable_17() + { + chip::Controller::BasicClusterTest cluster; + cluster.Associate(mDevice, 0); + + return cluster.ReadAttributeReachable(mOnSuccessCallback_17.Cancel(), mOnFailureCallback_17.Cancel()); + } + + void OnFailureResponse_17(uint8_t status) + { + (status == EMBER_ZCL_STATUS_UNSUPPORTED_ATTRIBUTE) ? NextTest() : ThrowFailureResponse(); + } + + void OnSuccessResponse_17(bool reachable) + { + VerifyOrReturn(CheckConstraintType("reachable", "", "boolean")); + NextTest(); + } +}; + +class Test_TC_DM_3_1 : public TestCommand +{ +public: + Test_TC_DM_3_1() : TestCommand("Test_TC_DM_3_1"), mTestIndex(0) {} + + /////////// TestCommand Interface ///////// + void NextTest() override + { + CHIP_ERROR err = CHIP_NO_ERROR; + + if (0 == mTestIndex) + { + ChipLogProgress(chipTool, " **** Test Start: Test_TC_DM_3_1\n"); + } + + if (mTestCount == mTestIndex) + { + ChipLogProgress(chipTool, " **** Test Complete: Test_TC_DM_3_1\n"); + SetCommandExitStatus(CHIP_NO_ERROR); + return; + } + + // Ensure we increment mTestIndex before we start running the relevant + // command. That way if we lose the timeslice after we send the message + // but before our function call returns, we won't end up with an + // incorrect mTestIndex value observed when we get the response. switch (mTestIndex++) { - case 0: - ChipLogProgress(chipTool, " ***** Test Step 0 : Sleep Input Status Command\n"); - err = TestSleepInputStatusCommand_0(); - break; } if (CHIP_NO_ERROR != err) @@ -1482,39 +1844,17 @@ class TV_LowPowerCluster : public TestCommand private: std::atomic_uint16_t mTestIndex; - const uint16_t mTestCount = 1; - - chip::Callback::Callback mOnFailureCallback_0{ OnFailureCallback_0, this }; - chip::Callback::Callback mOnSuccessCallback_0{ OnSuccessCallback_0, this }; - - static void OnFailureCallback_0(void * context, uint8_t status) - { - (static_cast(context))->OnFailureResponse_0(status); - } - - static void OnSuccessCallback_0(void * context) { (static_cast(context))->OnSuccessResponse_0(); } + const uint16_t mTestCount = 0; // // Tests methods // - - CHIP_ERROR TestSleepInputStatusCommand_0() - { - chip::Controller::LowPowerClusterTest cluster; - cluster.Associate(mDevice, 1); - - return cluster.Sleep(mOnSuccessCallback_0.Cancel(), mOnFailureCallback_0.Cancel()); - } - - void OnFailureResponse_0(uint8_t status) { ThrowFailureResponse(); } - - void OnSuccessResponse_0() { NextTest(); } }; -class TV_MediaInputCluster : public TestCommand +class Test_TC_WNCV_1_1 : public TestCommand { public: - TV_MediaInputCluster() : TestCommand("TV_MediaInputCluster"), mTestIndex(0) {} + Test_TC_WNCV_1_1() : TestCommand("Test_TC_WNCV_1_1"), mTestIndex(0) {} /////////// TestCommand Interface ///////// void NextTest() override @@ -1523,12 +1863,12 @@ class TV_MediaInputCluster : public TestCommand if (0 == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Start: TV_MediaInputCluster\n"); + ChipLogProgress(chipTool, " **** Test Start: Test_TC_WNCV_1_1\n"); } if (mTestCount == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Complete: TV_MediaInputCluster\n"); + ChipLogProgress(chipTool, " **** Test Complete: Test_TC_WNCV_1_1\n"); SetCommandExitStatus(CHIP_NO_ERROR); return; } @@ -1540,28 +1880,17 @@ class TV_MediaInputCluster : public TestCommand switch (mTestIndex++) { case 0: - ChipLogProgress(chipTool, " ***** Test Step 0 : Read attribute media input list\n"); - err = TestReadAttributeMediaInputList_0(); + ChipLogProgress(chipTool, " ***** Test Step 0 : read the global attribute: ClusterRevision\n"); + err = TestReadTheGlobalAttributeClusterRevision_0(); break; case 1: - ChipLogProgress(chipTool, " ***** Test Step 1 : Select Input Command\n"); - err = TestSelectInputCommand_1(); + ChipLogProgress(chipTool, + " ***** Test Step 1 : write the default value to mandatory global attribute: ClusterRevision\n"); + err = TestWriteTheDefaultValueToMandatoryGlobalAttributeClusterRevision_1(); break; case 2: - ChipLogProgress(chipTool, " ***** Test Step 2 : Read current input list\n"); - err = TestReadCurrentInputList_2(); - break; - case 3: - ChipLogProgress(chipTool, " ***** Test Step 3 : Hide Input Status Command\n"); - err = TestHideInputStatusCommand_3(); - break; - case 4: - ChipLogProgress(chipTool, " ***** Test Step 4 : Show Input Status Command\n"); - err = TestShowInputStatusCommand_4(); - break; - case 5: - ChipLogProgress(chipTool, " ***** Test Step 5 : Rename Input Command\n"); - err = TestRenameInputCommand_5(); + ChipLogProgress(chipTool, " ***** Test Step 2 : reads back global attribute: ClusterRevision\n"); + err = TestReadsBackGlobalAttributeClusterRevision_2(); break; } @@ -1574,179 +1903,115 @@ class TV_MediaInputCluster : public TestCommand private: std::atomic_uint16_t mTestIndex; - const uint16_t mTestCount = 6; + const uint16_t mTestCount = 3; chip::Callback::Callback mOnFailureCallback_0{ OnFailureCallback_0, this }; - chip::Callback::Callback mOnSuccessCallback_0{ - OnSuccessCallback_0, this - }; + chip::Callback::Callback mOnSuccessCallback_0{ OnSuccessCallback_0, this }; chip::Callback::Callback mOnFailureCallback_1{ OnFailureCallback_1, this }; - chip::Callback::Callback mOnSuccessCallback_1{ OnSuccessCallback_1, this }; + chip::Callback::Callback mOnSuccessCallback_1{ OnSuccessCallback_1, this }; chip::Callback::Callback mOnFailureCallback_2{ OnFailureCallback_2, this }; - chip::Callback::Callback mOnSuccessCallback_2{ OnSuccessCallback_2, this }; - chip::Callback::Callback mOnFailureCallback_3{ OnFailureCallback_3, this }; - chip::Callback::Callback mOnSuccessCallback_3{ OnSuccessCallback_3, this }; - chip::Callback::Callback mOnFailureCallback_4{ OnFailureCallback_4, this }; - chip::Callback::Callback mOnSuccessCallback_4{ OnSuccessCallback_4, this }; - chip::Callback::Callback mOnFailureCallback_5{ OnFailureCallback_5, this }; - chip::Callback::Callback mOnSuccessCallback_5{ OnSuccessCallback_5, this }; + chip::Callback::Callback mOnSuccessCallback_2{ OnSuccessCallback_2, this }; static void OnFailureCallback_0(void * context, uint8_t status) { - (static_cast(context))->OnFailureResponse_0(status); + (static_cast(context))->OnFailureResponse_0(status); } - static void OnSuccessCallback_0(void * context, uint16_t count, _MediaInputInfo * mediaInputList) + static void OnSuccessCallback_0(void * context, uint16_t clusterRevision) { - (static_cast(context))->OnSuccessResponse_0(count, mediaInputList); + (static_cast(context))->OnSuccessResponse_0(clusterRevision); } static void OnFailureCallback_1(void * context, uint8_t status) { - (static_cast(context))->OnFailureResponse_1(status); - } - - static void OnSuccessCallback_1(void * context) { (static_cast(context))->OnSuccessResponse_1(); } - - static void OnFailureCallback_2(void * context, uint8_t status) - { - (static_cast(context))->OnFailureResponse_2(status); - } - - static void OnSuccessCallback_2(void * context, uint8_t currentMediaInput) - { - (static_cast(context))->OnSuccessResponse_2(currentMediaInput); + (static_cast(context))->OnFailureResponse_1(status); } - static void OnFailureCallback_3(void * context, uint8_t status) + static void OnSuccessCallback_1(void * context, uint16_t clusterRevision) { - (static_cast(context))->OnFailureResponse_3(status); + (static_cast(context))->OnSuccessResponse_1(clusterRevision); } - static void OnSuccessCallback_3(void * context) { (static_cast(context))->OnSuccessResponse_3(); } - - static void OnFailureCallback_4(void * context, uint8_t status) + static void OnFailureCallback_2(void * context, uint8_t status) { - (static_cast(context))->OnFailureResponse_4(status); + (static_cast(context))->OnFailureResponse_2(status); } - static void OnSuccessCallback_4(void * context) { (static_cast(context))->OnSuccessResponse_4(); } - - static void OnFailureCallback_5(void * context, uint8_t status) + static void OnSuccessCallback_2(void * context, uint16_t clusterRevision) { - (static_cast(context))->OnFailureResponse_5(status); + (static_cast(context))->OnSuccessResponse_2(clusterRevision); } - static void OnSuccessCallback_5(void * context) { (static_cast(context))->OnSuccessResponse_5(); } - // // Tests methods // - CHIP_ERROR TestReadAttributeMediaInputList_0() + CHIP_ERROR TestReadTheGlobalAttributeClusterRevision_0() { - chip::Controller::MediaInputClusterTest cluster; + chip::Controller::WindowCoveringClusterTest cluster; cluster.Associate(mDevice, 1); - return cluster.ReadAttributeMediaInputList(mOnSuccessCallback_0.Cancel(), mOnFailureCallback_0.Cancel()); + return cluster.ReadAttributeClusterRevision(mOnSuccessCallback_0.Cancel(), mOnFailureCallback_0.Cancel()); } void OnFailureResponse_0(uint8_t status) { ThrowFailureResponse(); } - void OnSuccessResponse_0(uint16_t count, _MediaInputInfo * mediaInputList) + void OnSuccessResponse_0(uint16_t clusterRevision) { - VerifyOrReturn(CheckValueAsList("mediaInputList", count, 2)); + VerifyOrReturn(CheckValue("clusterRevision", clusterRevision, 5U)); NextTest(); } - CHIP_ERROR TestSelectInputCommand_1() + CHIP_ERROR TestWriteTheDefaultValueToMandatoryGlobalAttributeClusterRevision_1() { - chip::Controller::MediaInputClusterTest cluster; + chip::Controller::WindowCoveringClusterTest cluster; cluster.Associate(mDevice, 1); - uint8_t indexArgument = 1; + uint16_t clusterRevisionArgument = 5U; - return cluster.SelectInput(mOnSuccessCallback_1.Cancel(), mOnFailureCallback_1.Cancel(), indexArgument); + return cluster.WriteAttributeClusterRevision(mOnSuccessCallback_1.Cancel(), mOnFailureCallback_1.Cancel(), + clusterRevisionArgument); } - void OnFailureResponse_1(uint8_t status) { ThrowFailureResponse(); } + void OnFailureResponse_1(uint8_t status) { NextTest(); } - void OnSuccessResponse_1() { NextTest(); } + void OnSuccessResponse_1(uint16_t clusterRevision) { ThrowSuccessResponse(); } - CHIP_ERROR TestReadCurrentInputList_2() + CHIP_ERROR TestReadsBackGlobalAttributeClusterRevision_2() { - chip::Controller::MediaInputClusterTest cluster; + chip::Controller::WindowCoveringClusterTest cluster; cluster.Associate(mDevice, 1); - return cluster.ReadAttributeCurrentMediaInput(mOnSuccessCallback_2.Cancel(), mOnFailureCallback_2.Cancel()); + return cluster.ReadAttributeClusterRevision(mOnSuccessCallback_2.Cancel(), mOnFailureCallback_2.Cancel()); } void OnFailureResponse_2(uint8_t status) { ThrowFailureResponse(); } - void OnSuccessResponse_2(uint8_t currentMediaInput) + void OnSuccessResponse_2(uint16_t clusterRevision) { - VerifyOrReturn(CheckValue("currentMediaInput", currentMediaInput, 1)); + VerifyOrReturn(CheckValue("clusterRevision", clusterRevision, 5U)); NextTest(); } +}; - CHIP_ERROR TestHideInputStatusCommand_3() - { - chip::Controller::MediaInputClusterTest cluster; - cluster.Associate(mDevice, 1); - - return cluster.HideInputStatus(mOnSuccessCallback_3.Cancel(), mOnFailureCallback_3.Cancel()); - } - - void OnFailureResponse_3(uint8_t status) { ThrowFailureResponse(); } - - void OnSuccessResponse_3() { NextTest(); } +class Test_TC_WNCV_2_1 : public TestCommand +{ +public: + Test_TC_WNCV_2_1() : TestCommand("Test_TC_WNCV_2_1"), mTestIndex(0) {} - CHIP_ERROR TestShowInputStatusCommand_4() + /////////// TestCommand Interface ///////// + void NextTest() override { - chip::Controller::MediaInputClusterTest cluster; - cluster.Associate(mDevice, 1); + CHIP_ERROR err = CHIP_NO_ERROR; - return cluster.ShowInputStatus(mOnSuccessCallback_4.Cancel(), mOnFailureCallback_4.Cancel()); - } - - void OnFailureResponse_4(uint8_t status) { ThrowFailureResponse(); } - - void OnSuccessResponse_4() { NextTest(); } - - CHIP_ERROR TestRenameInputCommand_5() - { - chip::Controller::MediaInputClusterTest cluster; - cluster.Associate(mDevice, 1); - - uint8_t indexArgument = 1; - chip::ByteSpan nameArgument = chip::ByteSpan(chip::Uint8::from_const_char("newName"), strlen("newName")); - - return cluster.RenameInput(mOnSuccessCallback_5.Cancel(), mOnFailureCallback_5.Cancel(), indexArgument, nameArgument); - } - - void OnFailureResponse_5(uint8_t status) { ThrowFailureResponse(); } - - void OnSuccessResponse_5() { NextTest(); } -}; - -class TestCluster : public TestCommand -{ -public: - TestCluster() : TestCommand("TestCluster"), mTestIndex(0) {} - - /////////// TestCommand Interface ///////// - void NextTest() override - { - CHIP_ERROR err = CHIP_NO_ERROR; - - if (0 == mTestIndex) - { - ChipLogProgress(chipTool, " **** Test Start: TestCluster\n"); - } + if (0 == mTestIndex) + { + ChipLogProgress(chipTool, " **** Test Start: Test_TC_WNCV_2_1\n"); + } if (mTestCount == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Complete: TestCluster\n"); + ChipLogProgress(chipTool, " **** Test Complete: Test_TC_WNCV_2_1\n"); SetCommandExitStatus(CHIP_NO_ERROR); return; } @@ -1758,3878 +2023,4495 @@ class TestCluster : public TestCommand switch (mTestIndex++) { case 0: - ChipLogProgress(chipTool, " ***** Test Step 0 : Send Test Command\n"); - err = TestSendTestCommand_0(); + ChipLogProgress(chipTool, " ***** Test Step 0 : read the RO mandatory attribute default: Type\n"); + err = TestReadTheRoMandatoryAttributeDefaultType_0(); break; case 1: - ChipLogProgress(chipTool, " ***** Test Step 1 : Send Test Not Handled Command\n"); - err = TestSendTestNotHandledCommand_1(); + ChipLogProgress(chipTool, " ***** Test Step 1 : reads back the RO mandatory attribute: Type\n"); + err = TestReadsBackTheRoMandatoryAttributeType_1(); break; case 2: - ChipLogProgress(chipTool, " ***** Test Step 2 : Send Test Specific Command\n"); - err = TestSendTestSpecificCommand_2(); + ChipLogProgress(chipTool, " ***** Test Step 2 : read the RO mandatory attribute default: ConfigStatus\n"); + err = TestReadTheRoMandatoryAttributeDefaultConfigStatus_2(); break; case 3: - ChipLogProgress(chipTool, " ***** Test Step 3 : Send Test Add Arguments Command\n"); - err = TestSendTestAddArgumentsCommand_3(); + ChipLogProgress(chipTool, " ***** Test Step 3 : reads back the RO mandatory attribute: ConfigStatus\n"); + err = TestReadsBackTheRoMandatoryAttributeConfigStatus_3(); break; case 4: - ChipLogProgress(chipTool, " ***** Test Step 4 : Send failing Test Add Arguments Command\n"); - err = TestSendFailingTestAddArgumentsCommand_4(); + ChipLogProgress(chipTool, " ***** Test Step 4 : read the RO mandatory attribute default: OperationalStatus\n"); + err = TestReadTheRoMandatoryAttributeDefaultOperationalStatus_4(); break; case 5: - ChipLogProgress(chipTool, " ***** Test Step 5 : Read attribute BOOLEAN Default Value\n"); - err = TestReadAttributeBooleanDefaultValue_5(); + ChipLogProgress(chipTool, " ***** Test Step 5 : reads back the RO mandatory attribute: OperationalStatus\n"); + err = TestReadsBackTheRoMandatoryAttributeOperationalStatus_5(); break; case 6: - ChipLogProgress(chipTool, " ***** Test Step 6 : Write attribute BOOLEAN True\n"); - err = TestWriteAttributeBooleanTrue_6(); + ChipLogProgress(chipTool, " ***** Test Step 6 : read the RO mandatory attribute default: EndProductType\n"); + err = TestReadTheRoMandatoryAttributeDefaultEndProductType_6(); break; case 7: - ChipLogProgress(chipTool, " ***** Test Step 7 : Read attribute BOOLEAN True\n"); - err = TestReadAttributeBooleanTrue_7(); + ChipLogProgress(chipTool, " ***** Test Step 7 : reads back the RO mandatory attribute: EndProductType\n"); + err = TestReadsBackTheRoMandatoryAttributeEndProductType_7(); break; case 8: - ChipLogProgress(chipTool, " ***** Test Step 8 : Write attribute BOOLEAN False\n"); - err = TestWriteAttributeBooleanFalse_8(); + ChipLogProgress(chipTool, " ***** Test Step 8 : read the RW mandatory attribute default: Mode\n"); + err = TestReadTheRwMandatoryAttributeDefaultMode_8(); break; case 9: - ChipLogProgress(chipTool, " ***** Test Step 9 : Read attribute BOOLEAN False\n"); - err = TestReadAttributeBooleanFalse_9(); + ChipLogProgress(chipTool, " ***** Test Step 9 : write a value into the RW mandatory attribute:: Mode\n"); + err = TestWriteAValueIntoTheRwMandatoryAttributeMode_9(); break; case 10: - ChipLogProgress(chipTool, " ***** Test Step 10 : Read attribute BITMAP8 Default Value\n"); - err = TestReadAttributeBitmap8DefaultValue_10(); - break; - case 11: - ChipLogProgress(chipTool, " ***** Test Step 11 : Write attribute BITMAP8 Max Value\n"); - err = TestWriteAttributeBitmap8MaxValue_11(); - break; - case 12: - ChipLogProgress(chipTool, " ***** Test Step 12 : Read attribute BITMAP8 Max Value\n"); - err = TestReadAttributeBitmap8MaxValue_12(); - break; - case 13: - ChipLogProgress(chipTool, " ***** Test Step 13 : Write attribute BITMAP8 Min Value\n"); - err = TestWriteAttributeBitmap8MinValue_13(); - break; - case 14: - ChipLogProgress(chipTool, " ***** Test Step 14 : Read attribute BITMAP8 Min Value\n"); - err = TestReadAttributeBitmap8MinValue_14(); - break; - case 15: - ChipLogProgress(chipTool, " ***** Test Step 15 : Read attribute BITMAP16 Default Value\n"); - err = TestReadAttributeBitmap16DefaultValue_15(); - break; - case 16: - ChipLogProgress(chipTool, " ***** Test Step 16 : Write attribute BITMAP16 Max Value\n"); - err = TestWriteAttributeBitmap16MaxValue_16(); - break; - case 17: - ChipLogProgress(chipTool, " ***** Test Step 17 : Read attribute BITMAP16 Max Value\n"); - err = TestReadAttributeBitmap16MaxValue_17(); - break; - case 18: - ChipLogProgress(chipTool, " ***** Test Step 18 : Write attribute BITMAP16 Min Value\n"); - err = TestWriteAttributeBitmap16MinValue_18(); - break; - case 19: - ChipLogProgress(chipTool, " ***** Test Step 19 : Read attribute BITMAP16 Min Value\n"); - err = TestReadAttributeBitmap16MinValue_19(); - break; - case 20: - ChipLogProgress(chipTool, " ***** Test Step 20 : Read attribute BITMAP32 Default Value\n"); - err = TestReadAttributeBitmap32DefaultValue_20(); - break; - case 21: - ChipLogProgress(chipTool, " ***** Test Step 21 : Write attribute BITMAP32 Max Value\n"); - err = TestWriteAttributeBitmap32MaxValue_21(); - break; - case 22: - ChipLogProgress(chipTool, " ***** Test Step 22 : Read attribute BITMAP32 Max Value\n"); - err = TestReadAttributeBitmap32MaxValue_22(); - break; - case 23: - ChipLogProgress(chipTool, " ***** Test Step 23 : Write attribute BITMAP32 Min Value\n"); - err = TestWriteAttributeBitmap32MinValue_23(); - break; - case 24: - ChipLogProgress(chipTool, " ***** Test Step 24 : Read attribute BITMAP32 Min Value\n"); - err = TestReadAttributeBitmap32MinValue_24(); - break; - case 25: - ChipLogProgress(chipTool, " ***** Test Step 25 : Read attribute BITMAP64 Default Value\n"); - err = TestReadAttributeBitmap64DefaultValue_25(); - break; - case 26: - ChipLogProgress(chipTool, " ***** Test Step 26 : Write attribute BITMAP64 Max Value\n"); - err = TestWriteAttributeBitmap64MaxValue_26(); - break; - case 27: - ChipLogProgress(chipTool, " ***** Test Step 27 : Read attribute BITMAP64 Max Value\n"); - err = TestReadAttributeBitmap64MaxValue_27(); - break; - case 28: - ChipLogProgress(chipTool, " ***** Test Step 28 : Write attribute BITMAP64 Min Value\n"); - err = TestWriteAttributeBitmap64MinValue_28(); - break; - case 29: - ChipLogProgress(chipTool, " ***** Test Step 29 : Read attribute BITMAP64 Min Value\n"); - err = TestReadAttributeBitmap64MinValue_29(); - break; - case 30: - ChipLogProgress(chipTool, " ***** Test Step 30 : Read attribute INT8U Default Value\n"); - err = TestReadAttributeInt8uDefaultValue_30(); - break; - case 31: - ChipLogProgress(chipTool, " ***** Test Step 31 : Write attribute INT8U Max Value\n"); - err = TestWriteAttributeInt8uMaxValue_31(); - break; - case 32: - ChipLogProgress(chipTool, " ***** Test Step 32 : Read attribute INT8U Max Value\n"); - err = TestReadAttributeInt8uMaxValue_32(); - break; - case 33: - ChipLogProgress(chipTool, " ***** Test Step 33 : Write attribute INT8U Min Value\n"); - err = TestWriteAttributeInt8uMinValue_33(); - break; - case 34: - ChipLogProgress(chipTool, " ***** Test Step 34 : Read attribute INT8U Min Value\n"); - err = TestReadAttributeInt8uMinValue_34(); - break; - case 35: - ChipLogProgress(chipTool, " ***** Test Step 35 : Read attribute INT16U Default Value\n"); - err = TestReadAttributeInt16uDefaultValue_35(); - break; - case 36: - ChipLogProgress(chipTool, " ***** Test Step 36 : Write attribute INT16U Max Value\n"); - err = TestWriteAttributeInt16uMaxValue_36(); - break; - case 37: - ChipLogProgress(chipTool, " ***** Test Step 37 : Read attribute INT16U Max Value\n"); - err = TestReadAttributeInt16uMaxValue_37(); - break; - case 38: - ChipLogProgress(chipTool, " ***** Test Step 38 : Write attribute INT16U Min Value\n"); - err = TestWriteAttributeInt16uMinValue_38(); - break; - case 39: - ChipLogProgress(chipTool, " ***** Test Step 39 : Read attribute INT16U Min Value\n"); - err = TestReadAttributeInt16uMinValue_39(); - break; - case 40: - ChipLogProgress(chipTool, " ***** Test Step 40 : Read attribute INT32U Default Value\n"); - err = TestReadAttributeInt32uDefaultValue_40(); - break; - case 41: - ChipLogProgress(chipTool, " ***** Test Step 41 : Write attribute INT32U Max Value\n"); - err = TestWriteAttributeInt32uMaxValue_41(); - break; - case 42: - ChipLogProgress(chipTool, " ***** Test Step 42 : Read attribute INT32U Max Value\n"); - err = TestReadAttributeInt32uMaxValue_42(); - break; - case 43: - ChipLogProgress(chipTool, " ***** Test Step 43 : Write attribute INT32U Min Value\n"); - err = TestWriteAttributeInt32uMinValue_43(); - break; - case 44: - ChipLogProgress(chipTool, " ***** Test Step 44 : Read attribute INT32U Min Value\n"); - err = TestReadAttributeInt32uMinValue_44(); - break; - case 45: - ChipLogProgress(chipTool, " ***** Test Step 45 : Read attribute INT64U Default Value\n"); - err = TestReadAttributeInt64uDefaultValue_45(); - break; - case 46: - ChipLogProgress(chipTool, " ***** Test Step 46 : Write attribute INT64U Max Value\n"); - err = TestWriteAttributeInt64uMaxValue_46(); - break; - case 47: - ChipLogProgress(chipTool, " ***** Test Step 47 : Read attribute INT64U Max Value\n"); - err = TestReadAttributeInt64uMaxValue_47(); - break; - case 48: - ChipLogProgress(chipTool, " ***** Test Step 48 : Write attribute INT64U Min Value\n"); - err = TestWriteAttributeInt64uMinValue_48(); - break; - case 49: - ChipLogProgress(chipTool, " ***** Test Step 49 : Read attribute INT64U Min Value\n"); - err = TestReadAttributeInt64uMinValue_49(); - break; - case 50: - ChipLogProgress(chipTool, " ***** Test Step 50 : Read attribute INT8S Default Value\n"); - err = TestReadAttributeInt8sDefaultValue_50(); - break; - case 51: - ChipLogProgress(chipTool, " ***** Test Step 51 : Write attribute INT8S Max Value\n"); - err = TestWriteAttributeInt8sMaxValue_51(); - break; - case 52: - ChipLogProgress(chipTool, " ***** Test Step 52 : Read attribute INT8S Max Value\n"); - err = TestReadAttributeInt8sMaxValue_52(); - break; - case 53: - ChipLogProgress(chipTool, " ***** Test Step 53 : Write attribute INT8S Min Value\n"); - err = TestWriteAttributeInt8sMinValue_53(); + ChipLogProgress(chipTool, " ***** Test Step 10 : reads back the RW mandatory attribute: Mode\n"); + err = TestReadsBackTheRwMandatoryAttributeMode_10(); break; - case 54: - ChipLogProgress(chipTool, " ***** Test Step 54 : Read attribute INT8S Min Value\n"); - err = TestReadAttributeInt8sMinValue_54(); - break; - case 55: - ChipLogProgress(chipTool, " ***** Test Step 55 : Write attribute INT8S Default Value\n"); - err = TestWriteAttributeInt8sDefaultValue_55(); - break; - case 56: - ChipLogProgress(chipTool, " ***** Test Step 56 : Read attribute INT8S Default Value\n"); - err = TestReadAttributeInt8sDefaultValue_56(); - break; - case 57: - ChipLogProgress(chipTool, " ***** Test Step 57 : Read attribute INT16S Default Value\n"); - err = TestReadAttributeInt16sDefaultValue_57(); - break; - case 58: - ChipLogProgress(chipTool, " ***** Test Step 58 : Write attribute INT16S Max Value\n"); - err = TestWriteAttributeInt16sMaxValue_58(); - break; - case 59: - ChipLogProgress(chipTool, " ***** Test Step 59 : Read attribute INT16S Max Value\n"); - err = TestReadAttributeInt16sMaxValue_59(); - break; - case 60: - ChipLogProgress(chipTool, " ***** Test Step 60 : Write attribute INT16S Min Value\n"); - err = TestWriteAttributeInt16sMinValue_60(); - break; - case 61: - ChipLogProgress(chipTool, " ***** Test Step 61 : Read attribute INT16S Min Value\n"); - err = TestReadAttributeInt16sMinValue_61(); - break; - case 62: - ChipLogProgress(chipTool, " ***** Test Step 62 : Write attribute INT16S Default Value\n"); - err = TestWriteAttributeInt16sDefaultValue_62(); - break; - case 63: - ChipLogProgress(chipTool, " ***** Test Step 63 : Read attribute INT16S Default Value\n"); - err = TestReadAttributeInt16sDefaultValue_63(); - break; - case 64: - ChipLogProgress(chipTool, " ***** Test Step 64 : Read attribute INT32S Default Value\n"); - err = TestReadAttributeInt32sDefaultValue_64(); - break; - case 65: - ChipLogProgress(chipTool, " ***** Test Step 65 : Write attribute INT32S Max Value\n"); - err = TestWriteAttributeInt32sMaxValue_65(); - break; - case 66: - ChipLogProgress(chipTool, " ***** Test Step 66 : Read attribute INT32S Max Value\n"); - err = TestReadAttributeInt32sMaxValue_66(); - break; - case 67: - ChipLogProgress(chipTool, " ***** Test Step 67 : Write attribute INT32S Min Value\n"); - err = TestWriteAttributeInt32sMinValue_67(); - break; - case 68: - ChipLogProgress(chipTool, " ***** Test Step 68 : Read attribute INT32S Min Value\n"); - err = TestReadAttributeInt32sMinValue_68(); - break; - case 69: - ChipLogProgress(chipTool, " ***** Test Step 69 : Write attribute INT32S Default Value\n"); - err = TestWriteAttributeInt32sDefaultValue_69(); - break; - case 70: - ChipLogProgress(chipTool, " ***** Test Step 70 : Read attribute INT32S Default Value\n"); - err = TestReadAttributeInt32sDefaultValue_70(); - break; - case 71: - ChipLogProgress(chipTool, " ***** Test Step 71 : Read attribute INT64S Default Value\n"); - err = TestReadAttributeInt64sDefaultValue_71(); - break; - case 72: - ChipLogProgress(chipTool, " ***** Test Step 72 : Write attribute INT64S Max Value\n"); - err = TestWriteAttributeInt64sMaxValue_72(); - break; - case 73: - ChipLogProgress(chipTool, " ***** Test Step 73 : Read attribute INT64S Max Value\n"); - err = TestReadAttributeInt64sMaxValue_73(); - break; - case 74: - ChipLogProgress(chipTool, " ***** Test Step 74 : Write attribute INT64S Min Value\n"); - err = TestWriteAttributeInt64sMinValue_74(); - break; - case 75: - ChipLogProgress(chipTool, " ***** Test Step 75 : Read attribute INT64S Min Value\n"); - err = TestReadAttributeInt64sMinValue_75(); - break; - case 76: - ChipLogProgress(chipTool, " ***** Test Step 76 : Write attribute INT64S Default Value\n"); - err = TestWriteAttributeInt64sDefaultValue_76(); - break; - case 77: - ChipLogProgress(chipTool, " ***** Test Step 77 : Read attribute INT64S Default Value\n"); - err = TestReadAttributeInt64sDefaultValue_77(); - break; - case 78: - ChipLogProgress(chipTool, " ***** Test Step 78 : Read attribute ENUM8 Default Value\n"); - err = TestReadAttributeEnum8DefaultValue_78(); - break; - case 79: - ChipLogProgress(chipTool, " ***** Test Step 79 : Write attribute ENUM8 Max Value\n"); - err = TestWriteAttributeEnum8MaxValue_79(); - break; - case 80: - ChipLogProgress(chipTool, " ***** Test Step 80 : Read attribute ENUM8 Max Value\n"); - err = TestReadAttributeEnum8MaxValue_80(); - break; - case 81: - ChipLogProgress(chipTool, " ***** Test Step 81 : Write attribute ENUM8 Min Value\n"); - err = TestWriteAttributeEnum8MinValue_81(); - break; - case 82: - ChipLogProgress(chipTool, " ***** Test Step 82 : Read attribute ENUM8 Min Value\n"); - err = TestReadAttributeEnum8MinValue_82(); - break; - case 83: - ChipLogProgress(chipTool, " ***** Test Step 83 : Read attribute ENUM16 Default Value\n"); - err = TestReadAttributeEnum16DefaultValue_83(); - break; - case 84: - ChipLogProgress(chipTool, " ***** Test Step 84 : Write attribute ENUM16 Max Value\n"); - err = TestWriteAttributeEnum16MaxValue_84(); - break; - case 85: - ChipLogProgress(chipTool, " ***** Test Step 85 : Read attribute ENUM16 Max Value\n"); - err = TestReadAttributeEnum16MaxValue_85(); - break; - case 86: - ChipLogProgress(chipTool, " ***** Test Step 86 : Write attribute ENUM16 Min Value\n"); - err = TestWriteAttributeEnum16MinValue_86(); - break; - case 87: - ChipLogProgress(chipTool, " ***** Test Step 87 : Read attribute ENUM16 Min Value\n"); - err = TestReadAttributeEnum16MinValue_87(); - break; - case 88: - ChipLogProgress(chipTool, " ***** Test Step 88 : Read attribute OCTET_STRING Default Value\n"); - err = TestReadAttributeOctetStringDefaultValue_88(); - break; - case 89: - ChipLogProgress(chipTool, " ***** Test Step 89 : Write attribute OCTET_STRING\n"); - err = TestWriteAttributeOctetString_89(); - break; - case 90: - ChipLogProgress(chipTool, " ***** Test Step 90 : Read attribute OCTET_STRING\n"); - err = TestReadAttributeOctetString_90(); - break; - case 91: - ChipLogProgress(chipTool, " ***** Test Step 91 : Write attribute OCTET_STRING\n"); - err = TestWriteAttributeOctetString_91(); - break; - case 92: - ChipLogProgress(chipTool, " ***** Test Step 92 : Read attribute OCTET_STRING\n"); - err = TestReadAttributeOctetString_92(); - break; - case 93: - ChipLogProgress(chipTool, " ***** Test Step 93 : Write attribute OCTET_STRING\n"); - err = TestWriteAttributeOctetString_93(); - break; - case 94: - ChipLogProgress(chipTool, " ***** Test Step 94 : Read attribute LONG_OCTET_STRING Default Value\n"); - err = TestReadAttributeLongOctetStringDefaultValue_94(); - break; - case 95: - ChipLogProgress(chipTool, " ***** Test Step 95 : Write attribute LONG_OCTET_STRING\n"); - err = TestWriteAttributeLongOctetString_95(); - break; - case 96: - ChipLogProgress(chipTool, " ***** Test Step 96 : Read attribute LONG_OCTET_STRING\n"); - err = TestReadAttributeLongOctetString_96(); - break; - case 97: - ChipLogProgress(chipTool, " ***** Test Step 97 : Write attribute LONG_OCTET_STRING\n"); - err = TestWriteAttributeLongOctetString_97(); - break; - case 98: - ChipLogProgress(chipTool, " ***** Test Step 98 : Read attribute CHAR_STRING Default Value\n"); - err = TestReadAttributeCharStringDefaultValue_98(); - break; - case 99: - ChipLogProgress(chipTool, " ***** Test Step 99 : Write attribute CHAR_STRING\n"); - err = TestWriteAttributeCharString_99(); - break; - case 100: - ChipLogProgress(chipTool, " ***** Test Step 100 : Write attribute CHAR_STRING - Value too long\n"); - err = TestWriteAttributeCharStringValueTooLong_100(); - break; - case 101: - ChipLogProgress(chipTool, " ***** Test Step 101 : Write attribute CHAR_STRING - Empty\n"); - err = TestWriteAttributeCharStringEmpty_101(); - break; - case 102: - ChipLogProgress(chipTool, " ***** Test Step 102 : Read attribute LONG_CHAR_STRING Default Value\n"); - err = TestReadAttributeLongCharStringDefaultValue_102(); - break; - case 103: - ChipLogProgress(chipTool, " ***** Test Step 103 : Write attribute LONG_CHAR_STRING\n"); - err = TestWriteAttributeLongCharString_103(); - break; - case 104: - ChipLogProgress(chipTool, " ***** Test Step 104 : Read attribute LONG_CHAR_STRING\n"); - err = TestReadAttributeLongCharString_104(); - break; - case 105: - ChipLogProgress(chipTool, " ***** Test Step 105 : Write attribute LONG_CHAR_STRING\n"); - err = TestWriteAttributeLongCharString_105(); - break; - case 106: - ChipLogProgress(chipTool, " ***** Test Step 106 : Read attribute LIST\n"); - err = TestReadAttributeList_106(); - break; - case 107: - ChipLogProgress(chipTool, " ***** Test Step 107 : Read attribute LIST_OCTET_STRING\n"); - err = TestReadAttributeListOctetString_107(); - break; - case 108: - ChipLogProgress(chipTool, " ***** Test Step 108 : Read attribute LIST_STRUCT_OCTET_STRING\n"); - err = TestReadAttributeListStructOctetString_108(); - break; - case 109: - ChipLogProgress(chipTool, " ***** Test Step 109 : Read attribute EPOCH_US Default Value\n"); - err = TestReadAttributeEpochUsDefaultValue_109(); - break; - case 110: - ChipLogProgress(chipTool, " ***** Test Step 110 : Write attribute EPOCH_US Max Value\n"); - err = TestWriteAttributeEpochUsMaxValue_110(); - break; - case 111: - ChipLogProgress(chipTool, " ***** Test Step 111 : Read attribute EPOCH_US Max Value\n"); - err = TestReadAttributeEpochUsMaxValue_111(); - break; - case 112: - ChipLogProgress(chipTool, " ***** Test Step 112 : Write attribute EPOCH_US Min Value\n"); - err = TestWriteAttributeEpochUsMinValue_112(); - break; - case 113: - ChipLogProgress(chipTool, " ***** Test Step 113 : Read attribute EPOCH_US Min Value\n"); - err = TestReadAttributeEpochUsMinValue_113(); - break; - case 114: - ChipLogProgress(chipTool, " ***** Test Step 114 : Read attribute EPOCH_S Default Value\n"); - err = TestReadAttributeEpochSDefaultValue_114(); - break; - case 115: - ChipLogProgress(chipTool, " ***** Test Step 115 : Write attribute EPOCH_S Max Value\n"); - err = TestWriteAttributeEpochSMaxValue_115(); - break; - case 116: - ChipLogProgress(chipTool, " ***** Test Step 116 : Read attribute EPOCH_S Max Value\n"); - err = TestReadAttributeEpochSMaxValue_116(); - break; - case 117: - ChipLogProgress(chipTool, " ***** Test Step 117 : Write attribute EPOCH_S Min Value\n"); - err = TestWriteAttributeEpochSMinValue_117(); - break; - case 118: - ChipLogProgress(chipTool, " ***** Test Step 118 : Read attribute EPOCH_S Min Value\n"); - err = TestReadAttributeEpochSMinValue_118(); - break; - case 119: - ChipLogProgress(chipTool, " ***** Test Step 119 : Read attribute UNSUPPORTED\n"); - err = TestReadAttributeUnsupported_119(); - break; - case 120: - ChipLogProgress(chipTool, " ***** Test Step 120 : Writeattribute UNSUPPORTED\n"); - err = TestWriteattributeUnsupported_120(); - break; - case 121: - ChipLogProgress(chipTool, " ***** Test Step 121 : Send Test Command to unsupported endpoint\n"); - err = TestSendTestCommandToUnsupportedEndpoint_121(); - break; - } - - if (CHIP_NO_ERROR != err) - { - ChipLogError(chipTool, " ***** Test Failure: %s\n", chip::ErrorStr(err)); - SetCommandExitStatus(err); - } - } - -private: - std::atomic_uint16_t mTestIndex; - const uint16_t mTestCount = 122; - - chip::Callback::Callback mOnFailureCallback_0{ OnFailureCallback_0, this }; - chip::Callback::Callback mOnSuccessCallback_0{ OnSuccessCallback_0, this }; - chip::Callback::Callback mOnFailureCallback_1{ OnFailureCallback_1, this }; - chip::Callback::Callback mOnSuccessCallback_1{ OnSuccessCallback_1, this }; - chip::Callback::Callback mOnFailureCallback_2{ OnFailureCallback_2, this }; - chip::Callback::Callback mOnSuccessCallback_2{ OnSuccessCallback_2, this }; - chip::Callback::Callback mOnFailureCallback_3{ OnFailureCallback_3, this }; - chip::Callback::Callback mOnSuccessCallback_3{ OnSuccessCallback_3, this }; - chip::Callback::Callback mOnFailureCallback_4{ OnFailureCallback_4, this }; - chip::Callback::Callback mOnSuccessCallback_4{ OnSuccessCallback_4, this }; - chip::Callback::Callback mOnFailureCallback_5{ OnFailureCallback_5, this }; - chip::Callback::Callback mOnSuccessCallback_5{ OnSuccessCallback_5, this }; - chip::Callback::Callback mOnFailureCallback_6{ OnFailureCallback_6, this }; - chip::Callback::Callback mOnSuccessCallback_6{ OnSuccessCallback_6, this }; - chip::Callback::Callback mOnFailureCallback_7{ OnFailureCallback_7, this }; - chip::Callback::Callback mOnSuccessCallback_7{ OnSuccessCallback_7, this }; - chip::Callback::Callback mOnFailureCallback_8{ OnFailureCallback_8, this }; - chip::Callback::Callback mOnSuccessCallback_8{ OnSuccessCallback_8, this }; - chip::Callback::Callback mOnFailureCallback_9{ OnFailureCallback_9, this }; - chip::Callback::Callback mOnSuccessCallback_9{ OnSuccessCallback_9, this }; - chip::Callback::Callback mOnFailureCallback_10{ OnFailureCallback_10, this }; - chip::Callback::Callback mOnSuccessCallback_10{ OnSuccessCallback_10, this }; - chip::Callback::Callback mOnFailureCallback_11{ OnFailureCallback_11, this }; - chip::Callback::Callback mOnSuccessCallback_11{ OnSuccessCallback_11, this }; - chip::Callback::Callback mOnFailureCallback_12{ OnFailureCallback_12, this }; - chip::Callback::Callback mOnSuccessCallback_12{ OnSuccessCallback_12, this }; - chip::Callback::Callback mOnFailureCallback_13{ OnFailureCallback_13, this }; - chip::Callback::Callback mOnSuccessCallback_13{ OnSuccessCallback_13, this }; - chip::Callback::Callback mOnFailureCallback_14{ OnFailureCallback_14, this }; - chip::Callback::Callback mOnSuccessCallback_14{ OnSuccessCallback_14, this }; - chip::Callback::Callback mOnFailureCallback_15{ OnFailureCallback_15, this }; - chip::Callback::Callback mOnSuccessCallback_15{ OnSuccessCallback_15, this }; - chip::Callback::Callback mOnFailureCallback_16{ OnFailureCallback_16, this }; - chip::Callback::Callback mOnSuccessCallback_16{ OnSuccessCallback_16, this }; - chip::Callback::Callback mOnFailureCallback_17{ OnFailureCallback_17, this }; - chip::Callback::Callback mOnSuccessCallback_17{ OnSuccessCallback_17, this }; - chip::Callback::Callback mOnFailureCallback_18{ OnFailureCallback_18, this }; - chip::Callback::Callback mOnSuccessCallback_18{ OnSuccessCallback_18, this }; - chip::Callback::Callback mOnFailureCallback_19{ OnFailureCallback_19, this }; - chip::Callback::Callback mOnSuccessCallback_19{ OnSuccessCallback_19, this }; - chip::Callback::Callback mOnFailureCallback_20{ OnFailureCallback_20, this }; - chip::Callback::Callback mOnSuccessCallback_20{ OnSuccessCallback_20, this }; - chip::Callback::Callback mOnFailureCallback_21{ OnFailureCallback_21, this }; - chip::Callback::Callback mOnSuccessCallback_21{ OnSuccessCallback_21, this }; - chip::Callback::Callback mOnFailureCallback_22{ OnFailureCallback_22, this }; - chip::Callback::Callback mOnSuccessCallback_22{ OnSuccessCallback_22, this }; - chip::Callback::Callback mOnFailureCallback_23{ OnFailureCallback_23, this }; - chip::Callback::Callback mOnSuccessCallback_23{ OnSuccessCallback_23, this }; - chip::Callback::Callback mOnFailureCallback_24{ OnFailureCallback_24, this }; - chip::Callback::Callback mOnSuccessCallback_24{ OnSuccessCallback_24, this }; - chip::Callback::Callback mOnFailureCallback_25{ OnFailureCallback_25, this }; - chip::Callback::Callback mOnSuccessCallback_25{ OnSuccessCallback_25, this }; - chip::Callback::Callback mOnFailureCallback_26{ OnFailureCallback_26, this }; - chip::Callback::Callback mOnSuccessCallback_26{ OnSuccessCallback_26, this }; - chip::Callback::Callback mOnFailureCallback_27{ OnFailureCallback_27, this }; - chip::Callback::Callback mOnSuccessCallback_27{ OnSuccessCallback_27, this }; - chip::Callback::Callback mOnFailureCallback_28{ OnFailureCallback_28, this }; - chip::Callback::Callback mOnSuccessCallback_28{ OnSuccessCallback_28, this }; - chip::Callback::Callback mOnFailureCallback_29{ OnFailureCallback_29, this }; - chip::Callback::Callback mOnSuccessCallback_29{ OnSuccessCallback_29, this }; - chip::Callback::Callback mOnFailureCallback_30{ OnFailureCallback_30, this }; - chip::Callback::Callback mOnSuccessCallback_30{ OnSuccessCallback_30, this }; - chip::Callback::Callback mOnFailureCallback_31{ OnFailureCallback_31, this }; - chip::Callback::Callback mOnSuccessCallback_31{ OnSuccessCallback_31, this }; - chip::Callback::Callback mOnFailureCallback_32{ OnFailureCallback_32, this }; - chip::Callback::Callback mOnSuccessCallback_32{ OnSuccessCallback_32, this }; - chip::Callback::Callback mOnFailureCallback_33{ OnFailureCallback_33, this }; - chip::Callback::Callback mOnSuccessCallback_33{ OnSuccessCallback_33, this }; - chip::Callback::Callback mOnFailureCallback_34{ OnFailureCallback_34, this }; - chip::Callback::Callback mOnSuccessCallback_34{ OnSuccessCallback_34, this }; - chip::Callback::Callback mOnFailureCallback_35{ OnFailureCallback_35, this }; - chip::Callback::Callback mOnSuccessCallback_35{ OnSuccessCallback_35, this }; - chip::Callback::Callback mOnFailureCallback_36{ OnFailureCallback_36, this }; - chip::Callback::Callback mOnSuccessCallback_36{ OnSuccessCallback_36, this }; - chip::Callback::Callback mOnFailureCallback_37{ OnFailureCallback_37, this }; - chip::Callback::Callback mOnSuccessCallback_37{ OnSuccessCallback_37, this }; - chip::Callback::Callback mOnFailureCallback_38{ OnFailureCallback_38, this }; - chip::Callback::Callback mOnSuccessCallback_38{ OnSuccessCallback_38, this }; - chip::Callback::Callback mOnFailureCallback_39{ OnFailureCallback_39, this }; - chip::Callback::Callback mOnSuccessCallback_39{ OnSuccessCallback_39, this }; - chip::Callback::Callback mOnFailureCallback_40{ OnFailureCallback_40, this }; - chip::Callback::Callback mOnSuccessCallback_40{ OnSuccessCallback_40, this }; - chip::Callback::Callback mOnFailureCallback_41{ OnFailureCallback_41, this }; - chip::Callback::Callback mOnSuccessCallback_41{ OnSuccessCallback_41, this }; - chip::Callback::Callback mOnFailureCallback_42{ OnFailureCallback_42, this }; - chip::Callback::Callback mOnSuccessCallback_42{ OnSuccessCallback_42, this }; - chip::Callback::Callback mOnFailureCallback_43{ OnFailureCallback_43, this }; - chip::Callback::Callback mOnSuccessCallback_43{ OnSuccessCallback_43, this }; - chip::Callback::Callback mOnFailureCallback_44{ OnFailureCallback_44, this }; - chip::Callback::Callback mOnSuccessCallback_44{ OnSuccessCallback_44, this }; - chip::Callback::Callback mOnFailureCallback_45{ OnFailureCallback_45, this }; - chip::Callback::Callback mOnSuccessCallback_45{ OnSuccessCallback_45, this }; - chip::Callback::Callback mOnFailureCallback_46{ OnFailureCallback_46, this }; - chip::Callback::Callback mOnSuccessCallback_46{ OnSuccessCallback_46, this }; - chip::Callback::Callback mOnFailureCallback_47{ OnFailureCallback_47, this }; - chip::Callback::Callback mOnSuccessCallback_47{ OnSuccessCallback_47, this }; - chip::Callback::Callback mOnFailureCallback_48{ OnFailureCallback_48, this }; - chip::Callback::Callback mOnSuccessCallback_48{ OnSuccessCallback_48, this }; - chip::Callback::Callback mOnFailureCallback_49{ OnFailureCallback_49, this }; - chip::Callback::Callback mOnSuccessCallback_49{ OnSuccessCallback_49, this }; - chip::Callback::Callback mOnFailureCallback_50{ OnFailureCallback_50, this }; - chip::Callback::Callback mOnSuccessCallback_50{ OnSuccessCallback_50, this }; - chip::Callback::Callback mOnFailureCallback_51{ OnFailureCallback_51, this }; - chip::Callback::Callback mOnSuccessCallback_51{ OnSuccessCallback_51, this }; - chip::Callback::Callback mOnFailureCallback_52{ OnFailureCallback_52, this }; - chip::Callback::Callback mOnSuccessCallback_52{ OnSuccessCallback_52, this }; - chip::Callback::Callback mOnFailureCallback_53{ OnFailureCallback_53, this }; - chip::Callback::Callback mOnSuccessCallback_53{ OnSuccessCallback_53, this }; - chip::Callback::Callback mOnFailureCallback_54{ OnFailureCallback_54, this }; - chip::Callback::Callback mOnSuccessCallback_54{ OnSuccessCallback_54, this }; - chip::Callback::Callback mOnFailureCallback_55{ OnFailureCallback_55, this }; - chip::Callback::Callback mOnSuccessCallback_55{ OnSuccessCallback_55, this }; - chip::Callback::Callback mOnFailureCallback_56{ OnFailureCallback_56, this }; - chip::Callback::Callback mOnSuccessCallback_56{ OnSuccessCallback_56, this }; - chip::Callback::Callback mOnFailureCallback_57{ OnFailureCallback_57, this }; - chip::Callback::Callback mOnSuccessCallback_57{ OnSuccessCallback_57, this }; - chip::Callback::Callback mOnFailureCallback_58{ OnFailureCallback_58, this }; - chip::Callback::Callback mOnSuccessCallback_58{ OnSuccessCallback_58, this }; - chip::Callback::Callback mOnFailureCallback_59{ OnFailureCallback_59, this }; - chip::Callback::Callback mOnSuccessCallback_59{ OnSuccessCallback_59, this }; - chip::Callback::Callback mOnFailureCallback_60{ OnFailureCallback_60, this }; - chip::Callback::Callback mOnSuccessCallback_60{ OnSuccessCallback_60, this }; - chip::Callback::Callback mOnFailureCallback_61{ OnFailureCallback_61, this }; - chip::Callback::Callback mOnSuccessCallback_61{ OnSuccessCallback_61, this }; - chip::Callback::Callback mOnFailureCallback_62{ OnFailureCallback_62, this }; - chip::Callback::Callback mOnSuccessCallback_62{ OnSuccessCallback_62, this }; - chip::Callback::Callback mOnFailureCallback_63{ OnFailureCallback_63, this }; - chip::Callback::Callback mOnSuccessCallback_63{ OnSuccessCallback_63, this }; - chip::Callback::Callback mOnFailureCallback_64{ OnFailureCallback_64, this }; - chip::Callback::Callback mOnSuccessCallback_64{ OnSuccessCallback_64, this }; - chip::Callback::Callback mOnFailureCallback_65{ OnFailureCallback_65, this }; - chip::Callback::Callback mOnSuccessCallback_65{ OnSuccessCallback_65, this }; - chip::Callback::Callback mOnFailureCallback_66{ OnFailureCallback_66, this }; - chip::Callback::Callback mOnSuccessCallback_66{ OnSuccessCallback_66, this }; - chip::Callback::Callback mOnFailureCallback_67{ OnFailureCallback_67, this }; - chip::Callback::Callback mOnSuccessCallback_67{ OnSuccessCallback_67, this }; - chip::Callback::Callback mOnFailureCallback_68{ OnFailureCallback_68, this }; - chip::Callback::Callback mOnSuccessCallback_68{ OnSuccessCallback_68, this }; - chip::Callback::Callback mOnFailureCallback_69{ OnFailureCallback_69, this }; - chip::Callback::Callback mOnSuccessCallback_69{ OnSuccessCallback_69, this }; - chip::Callback::Callback mOnFailureCallback_70{ OnFailureCallback_70, this }; - chip::Callback::Callback mOnSuccessCallback_70{ OnSuccessCallback_70, this }; - chip::Callback::Callback mOnFailureCallback_71{ OnFailureCallback_71, this }; - chip::Callback::Callback mOnSuccessCallback_71{ OnSuccessCallback_71, this }; - chip::Callback::Callback mOnFailureCallback_72{ OnFailureCallback_72, this }; - chip::Callback::Callback mOnSuccessCallback_72{ OnSuccessCallback_72, this }; - chip::Callback::Callback mOnFailureCallback_73{ OnFailureCallback_73, this }; - chip::Callback::Callback mOnSuccessCallback_73{ OnSuccessCallback_73, this }; - chip::Callback::Callback mOnFailureCallback_74{ OnFailureCallback_74, this }; - chip::Callback::Callback mOnSuccessCallback_74{ OnSuccessCallback_74, this }; - chip::Callback::Callback mOnFailureCallback_75{ OnFailureCallback_75, this }; - chip::Callback::Callback mOnSuccessCallback_75{ OnSuccessCallback_75, this }; - chip::Callback::Callback mOnFailureCallback_76{ OnFailureCallback_76, this }; - chip::Callback::Callback mOnSuccessCallback_76{ OnSuccessCallback_76, this }; - chip::Callback::Callback mOnFailureCallback_77{ OnFailureCallback_77, this }; - chip::Callback::Callback mOnSuccessCallback_77{ OnSuccessCallback_77, this }; - chip::Callback::Callback mOnFailureCallback_78{ OnFailureCallback_78, this }; - chip::Callback::Callback mOnSuccessCallback_78{ OnSuccessCallback_78, this }; - chip::Callback::Callback mOnFailureCallback_79{ OnFailureCallback_79, this }; - chip::Callback::Callback mOnSuccessCallback_79{ OnSuccessCallback_79, this }; - chip::Callback::Callback mOnFailureCallback_80{ OnFailureCallback_80, this }; - chip::Callback::Callback mOnSuccessCallback_80{ OnSuccessCallback_80, this }; - chip::Callback::Callback mOnFailureCallback_81{ OnFailureCallback_81, this }; - chip::Callback::Callback mOnSuccessCallback_81{ OnSuccessCallback_81, this }; - chip::Callback::Callback mOnFailureCallback_82{ OnFailureCallback_82, this }; - chip::Callback::Callback mOnSuccessCallback_82{ OnSuccessCallback_82, this }; - chip::Callback::Callback mOnFailureCallback_83{ OnFailureCallback_83, this }; - chip::Callback::Callback mOnSuccessCallback_83{ OnSuccessCallback_83, this }; - chip::Callback::Callback mOnFailureCallback_84{ OnFailureCallback_84, this }; - chip::Callback::Callback mOnSuccessCallback_84{ OnSuccessCallback_84, this }; - chip::Callback::Callback mOnFailureCallback_85{ OnFailureCallback_85, this }; - chip::Callback::Callback mOnSuccessCallback_85{ OnSuccessCallback_85, this }; - chip::Callback::Callback mOnFailureCallback_86{ OnFailureCallback_86, this }; - chip::Callback::Callback mOnSuccessCallback_86{ OnSuccessCallback_86, this }; - chip::Callback::Callback mOnFailureCallback_87{ OnFailureCallback_87, this }; - chip::Callback::Callback mOnSuccessCallback_87{ OnSuccessCallback_87, this }; - chip::Callback::Callback mOnFailureCallback_88{ OnFailureCallback_88, this }; - chip::Callback::Callback mOnSuccessCallback_88{ OnSuccessCallback_88, - this }; - chip::Callback::Callback mOnFailureCallback_89{ OnFailureCallback_89, this }; - chip::Callback::Callback mOnSuccessCallback_89{ OnSuccessCallback_89, - this }; - chip::Callback::Callback mOnFailureCallback_90{ OnFailureCallback_90, this }; - chip::Callback::Callback mOnSuccessCallback_90{ OnSuccessCallback_90, - this }; - chip::Callback::Callback mOnFailureCallback_91{ OnFailureCallback_91, this }; - chip::Callback::Callback mOnSuccessCallback_91{ OnSuccessCallback_91, - this }; - chip::Callback::Callback mOnFailureCallback_92{ OnFailureCallback_92, this }; - chip::Callback::Callback mOnSuccessCallback_92{ OnSuccessCallback_92, - this }; - chip::Callback::Callback mOnFailureCallback_93{ OnFailureCallback_93, this }; - chip::Callback::Callback mOnSuccessCallback_93{ OnSuccessCallback_93, - this }; - chip::Callback::Callback mOnFailureCallback_94{ OnFailureCallback_94, this }; - chip::Callback::Callback mOnSuccessCallback_94{ OnSuccessCallback_94, - this }; - chip::Callback::Callback mOnFailureCallback_95{ OnFailureCallback_95, this }; - chip::Callback::Callback mOnSuccessCallback_95{ OnSuccessCallback_95, - this }; - chip::Callback::Callback mOnFailureCallback_96{ OnFailureCallback_96, this }; - chip::Callback::Callback mOnSuccessCallback_96{ OnSuccessCallback_96, - this }; - chip::Callback::Callback mOnFailureCallback_97{ OnFailureCallback_97, this }; - chip::Callback::Callback mOnSuccessCallback_97{ OnSuccessCallback_97, - this }; - chip::Callback::Callback mOnFailureCallback_98{ OnFailureCallback_98, this }; - chip::Callback::Callback mOnSuccessCallback_98{ OnSuccessCallback_98, - this }; - chip::Callback::Callback mOnFailureCallback_99{ OnFailureCallback_99, this }; - chip::Callback::Callback mOnSuccessCallback_99{ OnSuccessCallback_99, - this }; - chip::Callback::Callback mOnFailureCallback_100{ OnFailureCallback_100, this }; - chip::Callback::Callback mOnSuccessCallback_100{ OnSuccessCallback_100, - this }; - chip::Callback::Callback mOnFailureCallback_101{ OnFailureCallback_101, this }; - chip::Callback::Callback mOnSuccessCallback_101{ OnSuccessCallback_101, - this }; - chip::Callback::Callback mOnFailureCallback_102{ OnFailureCallback_102, this }; - chip::Callback::Callback mOnSuccessCallback_102{ OnSuccessCallback_102, - this }; - chip::Callback::Callback mOnFailureCallback_103{ OnFailureCallback_103, this }; - chip::Callback::Callback mOnSuccessCallback_103{ OnSuccessCallback_103, - this }; - chip::Callback::Callback mOnFailureCallback_104{ OnFailureCallback_104, this }; - chip::Callback::Callback mOnSuccessCallback_104{ OnSuccessCallback_104, - this }; - chip::Callback::Callback mOnFailureCallback_105{ OnFailureCallback_105, this }; - chip::Callback::Callback mOnSuccessCallback_105{ OnSuccessCallback_105, - this }; - chip::Callback::Callback mOnFailureCallback_106{ OnFailureCallback_106, this }; - chip::Callback::Callback mOnSuccessCallback_106{ - OnSuccessCallback_106, this - }; - chip::Callback::Callback mOnFailureCallback_107{ OnFailureCallback_107, this }; - chip::Callback::Callback mOnSuccessCallback_107{ - OnSuccessCallback_107, this - }; - chip::Callback::Callback mOnFailureCallback_108{ OnFailureCallback_108, this }; - chip::Callback::Callback - mOnSuccessCallback_108{ OnSuccessCallback_108, this }; - chip::Callback::Callback mOnFailureCallback_109{ OnFailureCallback_109, this }; - chip::Callback::Callback mOnSuccessCallback_109{ OnSuccessCallback_109, this }; - chip::Callback::Callback mOnFailureCallback_110{ OnFailureCallback_110, this }; - chip::Callback::Callback mOnSuccessCallback_110{ OnSuccessCallback_110, this }; - chip::Callback::Callback mOnFailureCallback_111{ OnFailureCallback_111, this }; - chip::Callback::Callback mOnSuccessCallback_111{ OnSuccessCallback_111, this }; - chip::Callback::Callback mOnFailureCallback_112{ OnFailureCallback_112, this }; - chip::Callback::Callback mOnSuccessCallback_112{ OnSuccessCallback_112, this }; - chip::Callback::Callback mOnFailureCallback_113{ OnFailureCallback_113, this }; - chip::Callback::Callback mOnSuccessCallback_113{ OnSuccessCallback_113, this }; - chip::Callback::Callback mOnFailureCallback_114{ OnFailureCallback_114, this }; - chip::Callback::Callback mOnSuccessCallback_114{ OnSuccessCallback_114, this }; - chip::Callback::Callback mOnFailureCallback_115{ OnFailureCallback_115, this }; - chip::Callback::Callback mOnSuccessCallback_115{ OnSuccessCallback_115, this }; - chip::Callback::Callback mOnFailureCallback_116{ OnFailureCallback_116, this }; - chip::Callback::Callback mOnSuccessCallback_116{ OnSuccessCallback_116, this }; - chip::Callback::Callback mOnFailureCallback_117{ OnFailureCallback_117, this }; - chip::Callback::Callback mOnSuccessCallback_117{ OnSuccessCallback_117, this }; - chip::Callback::Callback mOnFailureCallback_118{ OnFailureCallback_118, this }; - chip::Callback::Callback mOnSuccessCallback_118{ OnSuccessCallback_118, this }; - chip::Callback::Callback mOnFailureCallback_119{ OnFailureCallback_119, this }; - chip::Callback::Callback mOnSuccessCallback_119{ OnSuccessCallback_119, this }; - chip::Callback::Callback mOnFailureCallback_120{ OnFailureCallback_120, this }; - chip::Callback::Callback mOnSuccessCallback_120{ OnSuccessCallback_120, this }; - chip::Callback::Callback mOnFailureCallback_121{ OnFailureCallback_121, this }; - chip::Callback::Callback mOnSuccessCallback_121{ OnSuccessCallback_121, this }; + } + + if (CHIP_NO_ERROR != err) + { + ChipLogError(chipTool, " ***** Test Failure: %s\n", chip::ErrorStr(err)); + SetCommandExitStatus(err); + } + } + +private: + std::atomic_uint16_t mTestIndex; + const uint16_t mTestCount = 11; + + chip::Callback::Callback mOnFailureCallback_0{ OnFailureCallback_0, this }; + chip::Callback::Callback mOnSuccessCallback_0{ OnSuccessCallback_0, this }; + chip::Callback::Callback mOnFailureCallback_1{ OnFailureCallback_1, this }; + chip::Callback::Callback mOnSuccessCallback_1{ OnSuccessCallback_1, this }; + chip::Callback::Callback mOnFailureCallback_2{ OnFailureCallback_2, this }; + chip::Callback::Callback mOnSuccessCallback_2{ OnSuccessCallback_2, this }; + chip::Callback::Callback mOnFailureCallback_3{ OnFailureCallback_3, this }; + chip::Callback::Callback mOnSuccessCallback_3{ OnSuccessCallback_3, this }; + chip::Callback::Callback mOnFailureCallback_4{ OnFailureCallback_4, this }; + chip::Callback::Callback mOnSuccessCallback_4{ OnSuccessCallback_4, this }; + chip::Callback::Callback mOnFailureCallback_5{ OnFailureCallback_5, this }; + chip::Callback::Callback mOnSuccessCallback_5{ OnSuccessCallback_5, this }; + chip::Callback::Callback mOnFailureCallback_6{ OnFailureCallback_6, this }; + chip::Callback::Callback mOnSuccessCallback_6{ OnSuccessCallback_6, this }; + chip::Callback::Callback mOnFailureCallback_7{ OnFailureCallback_7, this }; + chip::Callback::Callback mOnSuccessCallback_7{ OnSuccessCallback_7, this }; + chip::Callback::Callback mOnFailureCallback_8{ OnFailureCallback_8, this }; + chip::Callback::Callback mOnSuccessCallback_8{ OnSuccessCallback_8, this }; + chip::Callback::Callback mOnFailureCallback_9{ OnFailureCallback_9, this }; + chip::Callback::Callback mOnSuccessCallback_9{ OnSuccessCallback_9, this }; + chip::Callback::Callback mOnFailureCallback_10{ OnFailureCallback_10, this }; + chip::Callback::Callback mOnSuccessCallback_10{ OnSuccessCallback_10, this }; + + static void OnFailureCallback_0(void * context, uint8_t status) + { + (static_cast(context))->OnFailureResponse_0(status); + } + + static void OnSuccessCallback_0(void * context, uint8_t type) + { + (static_cast(context))->OnSuccessResponse_0(type); + } + + static void OnFailureCallback_1(void * context, uint8_t status) + { + (static_cast(context))->OnFailureResponse_1(status); + } + + static void OnSuccessCallback_1(void * context, uint8_t type) + { + (static_cast(context))->OnSuccessResponse_1(type); + } + + static void OnFailureCallback_2(void * context, uint8_t status) + { + (static_cast(context))->OnFailureResponse_2(status); + } + + static void OnSuccessCallback_2(void * context, uint8_t configStatus) + { + (static_cast(context))->OnSuccessResponse_2(configStatus); + } + + static void OnFailureCallback_3(void * context, uint8_t status) + { + (static_cast(context))->OnFailureResponse_3(status); + } + + static void OnSuccessCallback_3(void * context, uint8_t configStatus) + { + (static_cast(context))->OnSuccessResponse_3(configStatus); + } + + static void OnFailureCallback_4(void * context, uint8_t status) + { + (static_cast(context))->OnFailureResponse_4(status); + } + + static void OnSuccessCallback_4(void * context, uint8_t operationalStatus) + { + (static_cast(context))->OnSuccessResponse_4(operationalStatus); + } + + static void OnFailureCallback_5(void * context, uint8_t status) + { + (static_cast(context))->OnFailureResponse_5(status); + } + + static void OnSuccessCallback_5(void * context, uint8_t operationalStatus) + { + (static_cast(context))->OnSuccessResponse_5(operationalStatus); + } + + static void OnFailureCallback_6(void * context, uint8_t status) + { + (static_cast(context))->OnFailureResponse_6(status); + } + + static void OnSuccessCallback_6(void * context, uint8_t endProductType) + { + (static_cast(context))->OnSuccessResponse_6(endProductType); + } + + static void OnFailureCallback_7(void * context, uint8_t status) + { + (static_cast(context))->OnFailureResponse_7(status); + } + + static void OnSuccessCallback_7(void * context, uint8_t endProductType) + { + (static_cast(context))->OnSuccessResponse_7(endProductType); + } + + static void OnFailureCallback_8(void * context, uint8_t status) + { + (static_cast(context))->OnFailureResponse_8(status); + } + + static void OnSuccessCallback_8(void * context, uint8_t mode) + { + (static_cast(context))->OnSuccessResponse_8(mode); + } + + static void OnFailureCallback_9(void * context, uint8_t status) + { + (static_cast(context))->OnFailureResponse_9(status); + } + + static void OnSuccessCallback_9(void * context, uint8_t mode) + { + (static_cast(context))->OnSuccessResponse_9(mode); + } + + static void OnFailureCallback_10(void * context, uint8_t status) + { + (static_cast(context))->OnFailureResponse_10(status); + } + + static void OnSuccessCallback_10(void * context, uint8_t mode) + { + (static_cast(context))->OnSuccessResponse_10(mode); + } + + // + // Tests methods + // + + CHIP_ERROR TestReadTheRoMandatoryAttributeDefaultType_0() + { + chip::Controller::WindowCoveringClusterTest cluster; + cluster.Associate(mDevice, 1); + + return cluster.ReadAttributeType(mOnSuccessCallback_0.Cancel(), mOnFailureCallback_0.Cancel()); + } + + void OnFailureResponse_0(uint8_t status) { ThrowFailureResponse(); } + + void OnSuccessResponse_0(uint8_t type) + { + VerifyOrReturn(CheckValue("type", type, 0)); + NextTest(); + } + + CHIP_ERROR TestReadsBackTheRoMandatoryAttributeType_1() + { + chip::Controller::WindowCoveringClusterTest cluster; + cluster.Associate(mDevice, 1); + + return cluster.ReadAttributeType(mOnSuccessCallback_1.Cancel(), mOnFailureCallback_1.Cancel()); + } + + void OnFailureResponse_1(uint8_t status) { ThrowFailureResponse(); } + + void OnSuccessResponse_1(uint8_t type) + { + VerifyOrReturn(CheckValue("type", type, 0)); + NextTest(); + } + + CHIP_ERROR TestReadTheRoMandatoryAttributeDefaultConfigStatus_2() + { + chip::Controller::WindowCoveringClusterTest cluster; + cluster.Associate(mDevice, 1); + + return cluster.ReadAttributeConfigStatus(mOnSuccessCallback_2.Cancel(), mOnFailureCallback_2.Cancel()); + } + + void OnFailureResponse_2(uint8_t status) { ThrowFailureResponse(); } + + void OnSuccessResponse_2(uint8_t configStatus) + { + VerifyOrReturn(CheckValue("configStatus", configStatus, 3)); + NextTest(); + } + + CHIP_ERROR TestReadsBackTheRoMandatoryAttributeConfigStatus_3() + { + chip::Controller::WindowCoveringClusterTest cluster; + cluster.Associate(mDevice, 1); + + return cluster.ReadAttributeConfigStatus(mOnSuccessCallback_3.Cancel(), mOnFailureCallback_3.Cancel()); + } + + void OnFailureResponse_3(uint8_t status) { ThrowFailureResponse(); } + + void OnSuccessResponse_3(uint8_t configStatus) + { + VerifyOrReturn(CheckValue("configStatus", configStatus, 3)); + NextTest(); + } + + CHIP_ERROR TestReadTheRoMandatoryAttributeDefaultOperationalStatus_4() + { + chip::Controller::WindowCoveringClusterTest cluster; + cluster.Associate(mDevice, 1); + + return cluster.ReadAttributeOperationalStatus(mOnSuccessCallback_4.Cancel(), mOnFailureCallback_4.Cancel()); + } + + void OnFailureResponse_4(uint8_t status) { ThrowFailureResponse(); } + + void OnSuccessResponse_4(uint8_t operationalStatus) + { + VerifyOrReturn(CheckValue("operationalStatus", operationalStatus, 0)); + NextTest(); + } + + CHIP_ERROR TestReadsBackTheRoMandatoryAttributeOperationalStatus_5() + { + chip::Controller::WindowCoveringClusterTest cluster; + cluster.Associate(mDevice, 1); + + return cluster.ReadAttributeOperationalStatus(mOnSuccessCallback_5.Cancel(), mOnFailureCallback_5.Cancel()); + } + + void OnFailureResponse_5(uint8_t status) { ThrowFailureResponse(); } + + void OnSuccessResponse_5(uint8_t operationalStatus) + { + VerifyOrReturn(CheckValue("operationalStatus", operationalStatus, 0)); + NextTest(); + } + + CHIP_ERROR TestReadTheRoMandatoryAttributeDefaultEndProductType_6() + { + chip::Controller::WindowCoveringClusterTest cluster; + cluster.Associate(mDevice, 1); + + return cluster.ReadAttributeEndProductType(mOnSuccessCallback_6.Cancel(), mOnFailureCallback_6.Cancel()); + } + + void OnFailureResponse_6(uint8_t status) { ThrowFailureResponse(); } + + void OnSuccessResponse_6(uint8_t endProductType) + { + VerifyOrReturn(CheckValue("endProductType", endProductType, 0)); + NextTest(); + } + + CHIP_ERROR TestReadsBackTheRoMandatoryAttributeEndProductType_7() + { + chip::Controller::WindowCoveringClusterTest cluster; + cluster.Associate(mDevice, 1); + + return cluster.ReadAttributeEndProductType(mOnSuccessCallback_7.Cancel(), mOnFailureCallback_7.Cancel()); + } + + void OnFailureResponse_7(uint8_t status) { ThrowFailureResponse(); } + + void OnSuccessResponse_7(uint8_t endProductType) + { + VerifyOrReturn(CheckValue("endProductType", endProductType, 0)); + NextTest(); + } + + CHIP_ERROR TestReadTheRwMandatoryAttributeDefaultMode_8() + { + chip::Controller::WindowCoveringClusterTest cluster; + cluster.Associate(mDevice, 1); + + return cluster.ReadAttributeMode(mOnSuccessCallback_8.Cancel(), mOnFailureCallback_8.Cancel()); + } + + void OnFailureResponse_8(uint8_t status) { ThrowFailureResponse(); } + + void OnSuccessResponse_8(uint8_t mode) + { + VerifyOrReturn(CheckValue("mode", mode, 0)); + NextTest(); + } + + CHIP_ERROR TestWriteAValueIntoTheRwMandatoryAttributeMode_9() + { + chip::Controller::WindowCoveringClusterTest cluster; + cluster.Associate(mDevice, 1); + + uint8_t modeArgument = 7; + + return cluster.WriteAttributeMode(mOnSuccessCallback_9.Cancel(), mOnFailureCallback_9.Cancel(), modeArgument); + } + + void OnFailureResponse_9(uint8_t status) { ThrowFailureResponse(); } + + void OnSuccessResponse_9(uint8_t mode) { NextTest(); } + + CHIP_ERROR TestReadsBackTheRwMandatoryAttributeMode_10() + { + chip::Controller::WindowCoveringClusterTest cluster; + cluster.Associate(mDevice, 1); + + return cluster.ReadAttributeMode(mOnSuccessCallback_10.Cancel(), mOnFailureCallback_10.Cancel()); + } + + void OnFailureResponse_10(uint8_t status) { ThrowFailureResponse(); } + + void OnSuccessResponse_10(uint8_t mode) + { + VerifyOrReturn(CheckValue("mode", mode, 7)); + NextTest(); + } +}; + +class Test_TC_WNCV_3_1 : public TestCommand +{ +public: + Test_TC_WNCV_3_1() : TestCommand("Test_TC_WNCV_3_1"), mTestIndex(0) {} + + /////////// TestCommand Interface ///////// + void NextTest() override + { + CHIP_ERROR err = CHIP_NO_ERROR; + + if (0 == mTestIndex) + { + ChipLogProgress(chipTool, " **** Test Start: Test_TC_WNCV_3_1\n"); + } + + if (mTestCount == mTestIndex) + { + ChipLogProgress(chipTool, " **** Test Complete: Test_TC_WNCV_3_1\n"); + SetCommandExitStatus(CHIP_NO_ERROR); + return; + } + + // Ensure we increment mTestIndex before we start running the relevant + // command. That way if we lose the timeslice after we send the message + // but before our function call returns, we won't end up with an + // incorrect mTestIndex value observed when we get the response. + switch (mTestIndex++) + { + case 0: + ChipLogProgress(chipTool, " ***** Test Step 0 : 1a: TH adjusts the the DUT to a non-open position\n"); + err = Test1aThAdjustsTheTheDutToANonOpenPosition_0(); + break; + case 1: + ChipLogProgress(chipTool, " ***** Test Step 1 : 2a: TH sends UpOrOpen command to DUT\n"); + err = Test2aThSendsUpOrOpenCommandToDut_1(); + break; + case 2: + ChipLogProgress(chipTool, " ***** Test Step 2 : 3a: TH reads OperationalStatus attribute from DUT\n"); + err = Test3aThReadsOperationalStatusAttributeFromDut_2(); + break; + } + + if (CHIP_NO_ERROR != err) + { + ChipLogError(chipTool, " ***** Test Failure: %s\n", chip::ErrorStr(err)); + SetCommandExitStatus(err); + } + } + +private: + std::atomic_uint16_t mTestIndex; + const uint16_t mTestCount = 3; + + chip::Callback::Callback mOnFailureCallback_0{ OnFailureCallback_0, this }; + chip::Callback::Callback mOnSuccessCallback_0{ OnSuccessCallback_0, this }; + chip::Callback::Callback mOnFailureCallback_1{ OnFailureCallback_1, this }; + chip::Callback::Callback mOnSuccessCallback_1{ OnSuccessCallback_1, this }; + chip::Callback::Callback mOnFailureCallback_2{ OnFailureCallback_2, this }; + chip::Callback::Callback mOnSuccessCallback_2{ OnSuccessCallback_2, this }; + + static void OnFailureCallback_0(void * context, uint8_t status) + { + (static_cast(context))->OnFailureResponse_0(status); + } + + static void OnSuccessCallback_0(void * context) { (static_cast(context))->OnSuccessResponse_0(); } + + static void OnFailureCallback_1(void * context, uint8_t status) + { + (static_cast(context))->OnFailureResponse_1(status); + } + + static void OnSuccessCallback_1(void * context) { (static_cast(context))->OnSuccessResponse_1(); } + + static void OnFailureCallback_2(void * context, uint8_t status) + { + (static_cast(context))->OnFailureResponse_2(status); + } + + static void OnSuccessCallback_2(void * context, uint8_t operationalStatus) + { + (static_cast(context))->OnSuccessResponse_2(operationalStatus); + } + + // + // Tests methods + // + + CHIP_ERROR Test1aThAdjustsTheTheDutToANonOpenPosition_0() + { + chip::Controller::WindowCoveringClusterTest cluster; + cluster.Associate(mDevice, 1); + + return cluster.DownOrClose(mOnSuccessCallback_0.Cancel(), mOnFailureCallback_0.Cancel()); + } + + void OnFailureResponse_0(uint8_t status) { ThrowFailureResponse(); } + + void OnSuccessResponse_0() { NextTest(); } + + CHIP_ERROR Test2aThSendsUpOrOpenCommandToDut_1() + { + chip::Controller::WindowCoveringClusterTest cluster; + cluster.Associate(mDevice, 1); + + return cluster.UpOrOpen(mOnSuccessCallback_1.Cancel(), mOnFailureCallback_1.Cancel()); + } + + void OnFailureResponse_1(uint8_t status) { ThrowFailureResponse(); } + + void OnSuccessResponse_1() { NextTest(); } + + CHIP_ERROR Test3aThReadsOperationalStatusAttributeFromDut_2() + { + chip::Controller::WindowCoveringClusterTest cluster; + cluster.Associate(mDevice, 1); + + return cluster.ReadAttributeOperationalStatus(mOnSuccessCallback_2.Cancel(), mOnFailureCallback_2.Cancel()); + } + + void OnFailureResponse_2(uint8_t status) { ThrowFailureResponse(); } + + void OnSuccessResponse_2(uint8_t operationalStatus) + { + VerifyOrReturn(CheckValue("operationalStatus", operationalStatus, 0)); + NextTest(); + } +}; + +class Test_TC_WNCV_3_2 : public TestCommand +{ +public: + Test_TC_WNCV_3_2() : TestCommand("Test_TC_WNCV_3_2"), mTestIndex(0) {} + + /////////// TestCommand Interface ///////// + void NextTest() override + { + CHIP_ERROR err = CHIP_NO_ERROR; + + if (0 == mTestIndex) + { + ChipLogProgress(chipTool, " **** Test Start: Test_TC_WNCV_3_2\n"); + } + + if (mTestCount == mTestIndex) + { + ChipLogProgress(chipTool, " **** Test Complete: Test_TC_WNCV_3_2\n"); + SetCommandExitStatus(CHIP_NO_ERROR); + return; + } + + // Ensure we increment mTestIndex before we start running the relevant + // command. That way if we lose the timeslice after we send the message + // but before our function call returns, we won't end up with an + // incorrect mTestIndex value observed when we get the response. + switch (mTestIndex++) + { + case 0: + ChipLogProgress(chipTool, " ***** Test Step 0 : 1a: TH adjusts the the DUT to a non-closed position\n"); + err = Test1aThAdjustsTheTheDutToANonClosedPosition_0(); + break; + case 1: + ChipLogProgress(chipTool, " ***** Test Step 1 : 2a: TH sends DownOrClose command to DUT\n"); + err = Test2aThSendsDownOrCloseCommandToDut_1(); + break; + case 2: + ChipLogProgress(chipTool, " ***** Test Step 2 : 3a: TH reads OperationalStatus attribute from DUT\n"); + err = Test3aThReadsOperationalStatusAttributeFromDut_2(); + break; + } + + if (CHIP_NO_ERROR != err) + { + ChipLogError(chipTool, " ***** Test Failure: %s\n", chip::ErrorStr(err)); + SetCommandExitStatus(err); + } + } + +private: + std::atomic_uint16_t mTestIndex; + const uint16_t mTestCount = 3; + + chip::Callback::Callback mOnFailureCallback_0{ OnFailureCallback_0, this }; + chip::Callback::Callback mOnSuccessCallback_0{ OnSuccessCallback_0, this }; + chip::Callback::Callback mOnFailureCallback_1{ OnFailureCallback_1, this }; + chip::Callback::Callback mOnSuccessCallback_1{ OnSuccessCallback_1, this }; + chip::Callback::Callback mOnFailureCallback_2{ OnFailureCallback_2, this }; + chip::Callback::Callback mOnSuccessCallback_2{ OnSuccessCallback_2, this }; static void OnFailureCallback_0(void * context, uint8_t status) { - (static_cast(context))->OnFailureResponse_0(status); + (static_cast(context))->OnFailureResponse_0(status); + } + + static void OnSuccessCallback_0(void * context) { (static_cast(context))->OnSuccessResponse_0(); } + + static void OnFailureCallback_1(void * context, uint8_t status) + { + (static_cast(context))->OnFailureResponse_1(status); + } + + static void OnSuccessCallback_1(void * context) { (static_cast(context))->OnSuccessResponse_1(); } + + static void OnFailureCallback_2(void * context, uint8_t status) + { + (static_cast(context))->OnFailureResponse_2(status); + } + + static void OnSuccessCallback_2(void * context, uint8_t operationalStatus) + { + (static_cast(context))->OnSuccessResponse_2(operationalStatus); + } + + // + // Tests methods + // + + CHIP_ERROR Test1aThAdjustsTheTheDutToANonClosedPosition_0() + { + chip::Controller::WindowCoveringClusterTest cluster; + cluster.Associate(mDevice, 1); + + return cluster.UpOrOpen(mOnSuccessCallback_0.Cancel(), mOnFailureCallback_0.Cancel()); + } + + void OnFailureResponse_0(uint8_t status) { ThrowFailureResponse(); } + + void OnSuccessResponse_0() { NextTest(); } + + CHIP_ERROR Test2aThSendsDownOrCloseCommandToDut_1() + { + chip::Controller::WindowCoveringClusterTest cluster; + cluster.Associate(mDevice, 1); + + return cluster.DownOrClose(mOnSuccessCallback_1.Cancel(), mOnFailureCallback_1.Cancel()); + } + + void OnFailureResponse_1(uint8_t status) { ThrowFailureResponse(); } + + void OnSuccessResponse_1() { NextTest(); } + + CHIP_ERROR Test3aThReadsOperationalStatusAttributeFromDut_2() + { + chip::Controller::WindowCoveringClusterTest cluster; + cluster.Associate(mDevice, 1); + + return cluster.ReadAttributeOperationalStatus(mOnSuccessCallback_2.Cancel(), mOnFailureCallback_2.Cancel()); + } + + void OnFailureResponse_2(uint8_t status) { ThrowFailureResponse(); } + + void OnSuccessResponse_2(uint8_t operationalStatus) + { + VerifyOrReturn(CheckValue("operationalStatus", operationalStatus, 0)); + NextTest(); + } +}; + +class Test_TC_WNCV_3_3 : public TestCommand +{ +public: + Test_TC_WNCV_3_3() : TestCommand("Test_TC_WNCV_3_3"), mTestIndex(0) {} + + /////////// TestCommand Interface ///////// + void NextTest() override + { + CHIP_ERROR err = CHIP_NO_ERROR; + + if (0 == mTestIndex) + { + ChipLogProgress(chipTool, " **** Test Start: Test_TC_WNCV_3_3\n"); + } + + if (mTestCount == mTestIndex) + { + ChipLogProgress(chipTool, " **** Test Complete: Test_TC_WNCV_3_3\n"); + SetCommandExitStatus(CHIP_NO_ERROR); + return; + } + + // Ensure we increment mTestIndex before we start running the relevant + // command. That way if we lose the timeslice after we send the message + // but before our function call returns, we won't end up with an + // incorrect mTestIndex value observed when we get the response. + switch (mTestIndex++) + { + case 0: + ChipLogProgress(chipTool, " ***** Test Step 0 : 1a: TH adjusts the the DUT to a non-open position\n"); + err = Test1aThAdjustsTheTheDutToANonOpenPosition_0(); + break; + case 1: + ChipLogProgress(chipTool, " ***** Test Step 1 : 2a: TH sends StopMotion command to DUT\n"); + err = Test2aThSendsStopMotionCommandToDut_1(); + break; + case 2: + ChipLogProgress(chipTool, " ***** Test Step 2 : 2b: TH reads OperationalStatus attribute from DUT\n"); + err = Test2bThReadsOperationalStatusAttributeFromDut_2(); + break; + } + + if (CHIP_NO_ERROR != err) + { + ChipLogError(chipTool, " ***** Test Failure: %s\n", chip::ErrorStr(err)); + SetCommandExitStatus(err); + } + } + +private: + std::atomic_uint16_t mTestIndex; + const uint16_t mTestCount = 3; + + chip::Callback::Callback mOnFailureCallback_0{ OnFailureCallback_0, this }; + chip::Callback::Callback mOnSuccessCallback_0{ OnSuccessCallback_0, this }; + chip::Callback::Callback mOnFailureCallback_1{ OnFailureCallback_1, this }; + chip::Callback::Callback mOnSuccessCallback_1{ OnSuccessCallback_1, this }; + chip::Callback::Callback mOnFailureCallback_2{ OnFailureCallback_2, this }; + chip::Callback::Callback mOnSuccessCallback_2{ OnSuccessCallback_2, this }; + + static void OnFailureCallback_0(void * context, uint8_t status) + { + (static_cast(context))->OnFailureResponse_0(status); + } + + static void OnSuccessCallback_0(void * context) { (static_cast(context))->OnSuccessResponse_0(); } + + static void OnFailureCallback_1(void * context, uint8_t status) + { + (static_cast(context))->OnFailureResponse_1(status); + } + + static void OnSuccessCallback_1(void * context) { (static_cast(context))->OnSuccessResponse_1(); } + + static void OnFailureCallback_2(void * context, uint8_t status) + { + (static_cast(context))->OnFailureResponse_2(status); + } + + static void OnSuccessCallback_2(void * context, uint8_t operationalStatus) + { + (static_cast(context))->OnSuccessResponse_2(operationalStatus); + } + + // + // Tests methods + // + + CHIP_ERROR Test1aThAdjustsTheTheDutToANonOpenPosition_0() + { + chip::Controller::WindowCoveringClusterTest cluster; + cluster.Associate(mDevice, 1); + + return cluster.UpOrOpen(mOnSuccessCallback_0.Cancel(), mOnFailureCallback_0.Cancel()); + } + + void OnFailureResponse_0(uint8_t status) { ThrowFailureResponse(); } + + void OnSuccessResponse_0() { NextTest(); } + + CHIP_ERROR Test2aThSendsStopMotionCommandToDut_1() + { + chip::Controller::WindowCoveringClusterTest cluster; + cluster.Associate(mDevice, 1); + + return cluster.StopMotion(mOnSuccessCallback_1.Cancel(), mOnFailureCallback_1.Cancel()); + } + + void OnFailureResponse_1(uint8_t status) { ThrowFailureResponse(); } + + void OnSuccessResponse_1() { NextTest(); } + + CHIP_ERROR Test2bThReadsOperationalStatusAttributeFromDut_2() + { + chip::Controller::WindowCoveringClusterTest cluster; + cluster.Associate(mDevice, 1); + + return cluster.ReadAttributeOperationalStatus(mOnSuccessCallback_2.Cancel(), mOnFailureCallback_2.Cancel()); } - static void OnSuccessCallback_0(void * context) { (static_cast(context))->OnSuccessResponse_0(); } + void OnFailureResponse_2(uint8_t status) { ThrowFailureResponse(); } - static void OnFailureCallback_1(void * context, uint8_t status) + void OnSuccessResponse_2(uint8_t operationalStatus) { - (static_cast(context))->OnFailureResponse_1(status); + VerifyOrReturn(CheckValue("operationalStatus", operationalStatus, 0)); + NextTest(); } +}; - static void OnSuccessCallback_1(void * context) { (static_cast(context))->OnSuccessResponse_1(); } +class Test_TC_BI_1_1 : public TestCommand +{ +public: + Test_TC_BI_1_1() : TestCommand("Test_TC_BI_1_1"), mTestIndex(0) {} - static void OnFailureCallback_2(void * context, uint8_t status) + /////////// TestCommand Interface ///////// + void NextTest() override { - (static_cast(context))->OnFailureResponse_2(status); + CHIP_ERROR err = CHIP_NO_ERROR; + + if (0 == mTestIndex) + { + ChipLogProgress(chipTool, " **** Test Start: Test_TC_BI_1_1\n"); + } + + if (mTestCount == mTestIndex) + { + ChipLogProgress(chipTool, " **** Test Complete: Test_TC_BI_1_1\n"); + SetCommandExitStatus(CHIP_NO_ERROR); + return; + } + + // Ensure we increment mTestIndex before we start running the relevant + // command. That way if we lose the timeslice after we send the message + // but before our function call returns, we won't end up with an + // incorrect mTestIndex value observed when we get the response. + switch (mTestIndex++) + { + case 0: + ChipLogProgress(chipTool, " ***** Test Step 0 : read the global attribute: ClusterRevision\n"); + err = TestReadTheGlobalAttributeClusterRevision_0(); + break; + case 1: + ChipLogProgress(chipTool, + " ***** Test Step 1 : write the default values to mandatory global attribute: ClusterRevision\n"); + err = TestWriteTheDefaultValuesToMandatoryGlobalAttributeClusterRevision_1(); + break; + case 2: + ChipLogProgress(chipTool, " ***** Test Step 2 : reads back global attribute: ClusterRevision\n"); + err = TestReadsBackGlobalAttributeClusterRevision_2(); + break; + } + + if (CHIP_NO_ERROR != err) + { + ChipLogError(chipTool, " ***** Test Failure: %s\n", chip::ErrorStr(err)); + SetCommandExitStatus(err); + } } - static void OnSuccessCallback_2(void * context, uint8_t returnValue) +private: + std::atomic_uint16_t mTestIndex; + const uint16_t mTestCount = 3; + + chip::Callback::Callback mOnFailureCallback_0{ OnFailureCallback_0, this }; + chip::Callback::Callback mOnSuccessCallback_0{ OnSuccessCallback_0, this }; + chip::Callback::Callback mOnFailureCallback_1{ OnFailureCallback_1, this }; + chip::Callback::Callback mOnSuccessCallback_1{ OnSuccessCallback_1, this }; + chip::Callback::Callback mOnFailureCallback_2{ OnFailureCallback_2, this }; + chip::Callback::Callback mOnSuccessCallback_2{ OnSuccessCallback_2, this }; + + static void OnFailureCallback_0(void * context, uint8_t status) { - (static_cast(context))->OnSuccessResponse_2(returnValue); + (static_cast(context))->OnFailureResponse_0(status); } - static void OnFailureCallback_3(void * context, uint8_t status) + static void OnSuccessCallback_0(void * context, uint16_t clusterRevision) { - (static_cast(context))->OnFailureResponse_3(status); + (static_cast(context))->OnSuccessResponse_0(clusterRevision); } - static void OnSuccessCallback_3(void * context, uint8_t returnValue) + static void OnFailureCallback_1(void * context, uint8_t status) { - (static_cast(context))->OnSuccessResponse_3(returnValue); + (static_cast(context))->OnFailureResponse_1(status); } - static void OnFailureCallback_4(void * context, uint8_t status) + static void OnSuccessCallback_1(void * context, uint16_t clusterRevision) { - (static_cast(context))->OnFailureResponse_4(status); + (static_cast(context))->OnSuccessResponse_1(clusterRevision); } - static void OnSuccessCallback_4(void * context, uint8_t returnValue) + static void OnFailureCallback_2(void * context, uint8_t status) { - (static_cast(context))->OnSuccessResponse_4(returnValue); + (static_cast(context))->OnFailureResponse_2(status); } - static void OnFailureCallback_5(void * context, uint8_t status) + static void OnSuccessCallback_2(void * context, uint16_t clusterRevision) { - (static_cast(context))->OnFailureResponse_5(status); + (static_cast(context))->OnSuccessResponse_2(clusterRevision); } - static void OnSuccessCallback_5(void * context, bool boolean) + // + // Tests methods + // + + CHIP_ERROR TestReadTheGlobalAttributeClusterRevision_0() { - (static_cast(context))->OnSuccessResponse_5(boolean); + chip::Controller::BinaryInputBasicClusterTest cluster; + cluster.Associate(mDevice, 1); + + return cluster.ReadAttributeClusterRevision(mOnSuccessCallback_0.Cancel(), mOnFailureCallback_0.Cancel()); } - static void OnFailureCallback_6(void * context, uint8_t status) + void OnFailureResponse_0(uint8_t status) { ThrowFailureResponse(); } + + void OnSuccessResponse_0(uint16_t clusterRevision) { - (static_cast(context))->OnFailureResponse_6(status); + VerifyOrReturn(CheckValue("clusterRevision", clusterRevision, 1U)); + NextTest(); } - static void OnSuccessCallback_6(void * context, bool boolean) + CHIP_ERROR TestWriteTheDefaultValuesToMandatoryGlobalAttributeClusterRevision_1() { - (static_cast(context))->OnSuccessResponse_6(boolean); + chip::Controller::BinaryInputBasicClusterTest cluster; + cluster.Associate(mDevice, 1); + + uint16_t clusterRevisionArgument = 1U; + + return cluster.WriteAttributeClusterRevision(mOnSuccessCallback_1.Cancel(), mOnFailureCallback_1.Cancel(), + clusterRevisionArgument); } - static void OnFailureCallback_7(void * context, uint8_t status) + void OnFailureResponse_1(uint8_t status) { NextTest(); } + + void OnSuccessResponse_1(uint16_t clusterRevision) { ThrowSuccessResponse(); } + + CHIP_ERROR TestReadsBackGlobalAttributeClusterRevision_2() { - (static_cast(context))->OnFailureResponse_7(status); + chip::Controller::BinaryInputBasicClusterTest cluster; + cluster.Associate(mDevice, 1); + + return cluster.ReadAttributeClusterRevision(mOnSuccessCallback_2.Cancel(), mOnFailureCallback_2.Cancel()); } - static void OnSuccessCallback_7(void * context, bool boolean) + void OnFailureResponse_2(uint8_t status) { ThrowFailureResponse(); } + + void OnSuccessResponse_2(uint16_t clusterRevision) { - (static_cast(context))->OnSuccessResponse_7(boolean); + VerifyOrReturn(CheckValue("clusterRevision", clusterRevision, 1U)); + NextTest(); } +}; - static void OnFailureCallback_8(void * context, uint8_t status) +class Test_TC_FLW_1_1 : public TestCommand +{ +public: + Test_TC_FLW_1_1() : TestCommand("Test_TC_FLW_1_1"), mTestIndex(0) {} + + /////////// TestCommand Interface ///////// + void NextTest() override { - (static_cast(context))->OnFailureResponse_8(status); + CHIP_ERROR err = CHIP_NO_ERROR; + + if (0 == mTestIndex) + { + ChipLogProgress(chipTool, " **** Test Start: Test_TC_FLW_1_1\n"); + } + + if (mTestCount == mTestIndex) + { + ChipLogProgress(chipTool, " **** Test Complete: Test_TC_FLW_1_1\n"); + SetCommandExitStatus(CHIP_NO_ERROR); + return; + } + + // Ensure we increment mTestIndex before we start running the relevant + // command. That way if we lose the timeslice after we send the message + // but before our function call returns, we won't end up with an + // incorrect mTestIndex value observed when we get the response. + switch (mTestIndex++) + { + case 0: + ChipLogProgress(chipTool, + " ***** Test Step 0 : write the default values to mandatory global attribute: ClusterRevision\n"); + err = TestWriteTheDefaultValuesToMandatoryGlobalAttributeClusterRevision_0(); + break; + } + + if (CHIP_NO_ERROR != err) + { + ChipLogError(chipTool, " ***** Test Failure: %s\n", chip::ErrorStr(err)); + SetCommandExitStatus(err); + } } - static void OnSuccessCallback_8(void * context, bool boolean) +private: + std::atomic_uint16_t mTestIndex; + const uint16_t mTestCount = 1; + + chip::Callback::Callback mOnFailureCallback_0{ OnFailureCallback_0, this }; + chip::Callback::Callback mOnSuccessCallback_0{ OnSuccessCallback_0, this }; + + static void OnFailureCallback_0(void * context, uint8_t status) { - (static_cast(context))->OnSuccessResponse_8(boolean); + (static_cast(context))->OnFailureResponse_0(status); } - static void OnFailureCallback_9(void * context, uint8_t status) + static void OnSuccessCallback_0(void * context, uint16_t clusterRevision) { - (static_cast(context))->OnFailureResponse_9(status); + (static_cast(context))->OnSuccessResponse_0(clusterRevision); } - static void OnSuccessCallback_9(void * context, bool boolean) + // + // Tests methods + // + + CHIP_ERROR TestWriteTheDefaultValuesToMandatoryGlobalAttributeClusterRevision_0() { - (static_cast(context))->OnSuccessResponse_9(boolean); + chip::Controller::FlowMeasurementClusterTest cluster; + cluster.Associate(mDevice, 1); + + uint16_t clusterRevisionArgument = 2U; + + return cluster.WriteAttributeClusterRevision(mOnSuccessCallback_0.Cancel(), mOnFailureCallback_0.Cancel(), + clusterRevisionArgument); } - static void OnFailureCallback_10(void * context, uint8_t status) + void OnFailureResponse_0(uint8_t status) { NextTest(); } + + void OnSuccessResponse_0(uint16_t clusterRevision) { ThrowSuccessResponse(); } +}; + +class Test_TC_TM_1_1 : public TestCommand +{ +public: + Test_TC_TM_1_1() : TestCommand("Test_TC_TM_1_1"), mTestIndex(0) {} + + /////////// TestCommand Interface ///////// + void NextTest() override { - (static_cast(context))->OnFailureResponse_10(status); - } + CHIP_ERROR err = CHIP_NO_ERROR; + + if (0 == mTestIndex) + { + ChipLogProgress(chipTool, " **** Test Start: Test_TC_TM_1_1\n"); + } + + if (mTestCount == mTestIndex) + { + ChipLogProgress(chipTool, " **** Test Complete: Test_TC_TM_1_1\n"); + SetCommandExitStatus(CHIP_NO_ERROR); + return; + } + + // Ensure we increment mTestIndex before we start running the relevant + // command. That way if we lose the timeslice after we send the message + // but before our function call returns, we won't end up with an + // incorrect mTestIndex value observed when we get the response. + switch (mTestIndex++) + { + case 0: + ChipLogProgress(chipTool, " ***** Test Step 0 : read the global attribute: ClusterRevision\n"); + err = TestReadTheGlobalAttributeClusterRevision_0(); + break; + case 1: + ChipLogProgress(chipTool, + " ***** Test Step 1 : write the default values to mandatory global attribute: ClusterRevision\n"); + err = TestWriteTheDefaultValuesToMandatoryGlobalAttributeClusterRevision_1(); + break; + case 2: + ChipLogProgress(chipTool, " ***** Test Step 2 : reads back global attribute: ClusterRevision\n"); + err = TestReadsBackGlobalAttributeClusterRevision_2(); + break; + } - static void OnSuccessCallback_10(void * context, uint8_t bitmap8) - { - (static_cast(context))->OnSuccessResponse_10(bitmap8); + if (CHIP_NO_ERROR != err) + { + ChipLogError(chipTool, " ***** Test Failure: %s\n", chip::ErrorStr(err)); + SetCommandExitStatus(err); + } } - static void OnFailureCallback_11(void * context, uint8_t status) - { - (static_cast(context))->OnFailureResponse_11(status); - } +private: + std::atomic_uint16_t mTestIndex; + const uint16_t mTestCount = 3; - static void OnSuccessCallback_11(void * context, uint8_t bitmap8) - { - (static_cast(context))->OnSuccessResponse_11(bitmap8); - } + chip::Callback::Callback mOnFailureCallback_0{ OnFailureCallback_0, this }; + chip::Callback::Callback mOnSuccessCallback_0{ OnSuccessCallback_0, this }; + chip::Callback::Callback mOnFailureCallback_1{ OnFailureCallback_1, this }; + chip::Callback::Callback mOnSuccessCallback_1{ OnSuccessCallback_1, this }; + chip::Callback::Callback mOnFailureCallback_2{ OnFailureCallback_2, this }; + chip::Callback::Callback mOnSuccessCallback_2{ OnSuccessCallback_2, this }; - static void OnFailureCallback_12(void * context, uint8_t status) + static void OnFailureCallback_0(void * context, uint8_t status) { - (static_cast(context))->OnFailureResponse_12(status); + (static_cast(context))->OnFailureResponse_0(status); } - static void OnSuccessCallback_12(void * context, uint8_t bitmap8) + static void OnSuccessCallback_0(void * context, uint16_t clusterRevision) { - (static_cast(context))->OnSuccessResponse_12(bitmap8); + (static_cast(context))->OnSuccessResponse_0(clusterRevision); } - static void OnFailureCallback_13(void * context, uint8_t status) + static void OnFailureCallback_1(void * context, uint8_t status) { - (static_cast(context))->OnFailureResponse_13(status); + (static_cast(context))->OnFailureResponse_1(status); } - static void OnSuccessCallback_13(void * context, uint8_t bitmap8) + static void OnSuccessCallback_1(void * context, uint16_t clusterRevision) { - (static_cast(context))->OnSuccessResponse_13(bitmap8); + (static_cast(context))->OnSuccessResponse_1(clusterRevision); } - static void OnFailureCallback_14(void * context, uint8_t status) + static void OnFailureCallback_2(void * context, uint8_t status) { - (static_cast(context))->OnFailureResponse_14(status); + (static_cast(context))->OnFailureResponse_2(status); } - static void OnSuccessCallback_14(void * context, uint8_t bitmap8) + static void OnSuccessCallback_2(void * context, uint16_t clusterRevision) { - (static_cast(context))->OnSuccessResponse_14(bitmap8); + (static_cast(context))->OnSuccessResponse_2(clusterRevision); } - static void OnFailureCallback_15(void * context, uint8_t status) - { - (static_cast(context))->OnFailureResponse_15(status); - } + // + // Tests methods + // - static void OnSuccessCallback_15(void * context, uint16_t bitmap16) + CHIP_ERROR TestReadTheGlobalAttributeClusterRevision_0() { - (static_cast(context))->OnSuccessResponse_15(bitmap16); - } + chip::Controller::TemperatureMeasurementClusterTest cluster; + cluster.Associate(mDevice, 1); - static void OnFailureCallback_16(void * context, uint8_t status) - { - (static_cast(context))->OnFailureResponse_16(status); + return cluster.ReadAttributeClusterRevision(mOnSuccessCallback_0.Cancel(), mOnFailureCallback_0.Cancel()); } - static void OnSuccessCallback_16(void * context, uint16_t bitmap16) - { - (static_cast(context))->OnSuccessResponse_16(bitmap16); - } + void OnFailureResponse_0(uint8_t status) { ThrowFailureResponse(); } - static void OnFailureCallback_17(void * context, uint8_t status) + void OnSuccessResponse_0(uint16_t clusterRevision) { - (static_cast(context))->OnFailureResponse_17(status); + VerifyOrReturn(CheckValue("clusterRevision", clusterRevision, 3U)); + NextTest(); } - static void OnSuccessCallback_17(void * context, uint16_t bitmap16) + CHIP_ERROR TestWriteTheDefaultValuesToMandatoryGlobalAttributeClusterRevision_1() { - (static_cast(context))->OnSuccessResponse_17(bitmap16); - } + chip::Controller::TemperatureMeasurementClusterTest cluster; + cluster.Associate(mDevice, 1); - static void OnFailureCallback_18(void * context, uint8_t status) - { - (static_cast(context))->OnFailureResponse_18(status); - } + uint16_t clusterRevisionArgument = 3U; - static void OnSuccessCallback_18(void * context, uint16_t bitmap16) - { - (static_cast(context))->OnSuccessResponse_18(bitmap16); + return cluster.WriteAttributeClusterRevision(mOnSuccessCallback_1.Cancel(), mOnFailureCallback_1.Cancel(), + clusterRevisionArgument); } - static void OnFailureCallback_19(void * context, uint8_t status) - { - (static_cast(context))->OnFailureResponse_19(status); - } + void OnFailureResponse_1(uint8_t status) { NextTest(); } - static void OnSuccessCallback_19(void * context, uint16_t bitmap16) - { - (static_cast(context))->OnSuccessResponse_19(bitmap16); - } + void OnSuccessResponse_1(uint16_t clusterRevision) { ThrowSuccessResponse(); } - static void OnFailureCallback_20(void * context, uint8_t status) + CHIP_ERROR TestReadsBackGlobalAttributeClusterRevision_2() { - (static_cast(context))->OnFailureResponse_20(status); - } + chip::Controller::TemperatureMeasurementClusterTest cluster; + cluster.Associate(mDevice, 1); - static void OnSuccessCallback_20(void * context, uint32_t bitmap32) - { - (static_cast(context))->OnSuccessResponse_20(bitmap32); + return cluster.ReadAttributeClusterRevision(mOnSuccessCallback_2.Cancel(), mOnFailureCallback_2.Cancel()); } - static void OnFailureCallback_21(void * context, uint8_t status) - { - (static_cast(context))->OnFailureResponse_21(status); - } + void OnFailureResponse_2(uint8_t status) { ThrowFailureResponse(); } - static void OnSuccessCallback_21(void * context, uint32_t bitmap32) + void OnSuccessResponse_2(uint16_t clusterRevision) { - (static_cast(context))->OnSuccessResponse_21(bitmap32); + VerifyOrReturn(CheckValue("clusterRevision", clusterRevision, 3U)); + NextTest(); } +}; - static void OnFailureCallback_22(void * context, uint8_t status) - { - (static_cast(context))->OnFailureResponse_22(status); - } +class Test_TC_TM_2_1 : public TestCommand +{ +public: + Test_TC_TM_2_1() : TestCommand("Test_TC_TM_2_1"), mTestIndex(0) {} - static void OnSuccessCallback_22(void * context, uint32_t bitmap32) + /////////// TestCommand Interface ///////// + void NextTest() override { - (static_cast(context))->OnSuccessResponse_22(bitmap32); - } + CHIP_ERROR err = CHIP_NO_ERROR; - static void OnFailureCallback_23(void * context, uint8_t status) - { - (static_cast(context))->OnFailureResponse_23(status); - } + if (0 == mTestIndex) + { + ChipLogProgress(chipTool, " **** Test Start: Test_TC_TM_2_1\n"); + } - static void OnSuccessCallback_23(void * context, uint32_t bitmap32) - { - (static_cast(context))->OnSuccessResponse_23(bitmap32); - } + if (mTestCount == mTestIndex) + { + ChipLogProgress(chipTool, " **** Test Complete: Test_TC_TM_2_1\n"); + SetCommandExitStatus(CHIP_NO_ERROR); + return; + } - static void OnFailureCallback_24(void * context, uint8_t status) - { - (static_cast(context))->OnFailureResponse_24(status); - } + // Ensure we increment mTestIndex before we start running the relevant + // command. That way if we lose the timeslice after we send the message + // but before our function call returns, we won't end up with an + // incorrect mTestIndex value observed when we get the response. + switch (mTestIndex++) + { + case 0: + ChipLogProgress(chipTool, " ***** Test Step 0 : read the mandatory attribute: MeasuredValue\n"); + err = TestReadTheMandatoryAttributeMeasuredValue_0(); + break; + } - static void OnSuccessCallback_24(void * context, uint32_t bitmap32) - { - (static_cast(context))->OnSuccessResponse_24(bitmap32); + if (CHIP_NO_ERROR != err) + { + ChipLogError(chipTool, " ***** Test Failure: %s\n", chip::ErrorStr(err)); + SetCommandExitStatus(err); + } } - static void OnFailureCallback_25(void * context, uint8_t status) - { - (static_cast(context))->OnFailureResponse_25(status); - } +private: + std::atomic_uint16_t mTestIndex; + const uint16_t mTestCount = 1; - static void OnSuccessCallback_25(void * context, uint64_t bitmap64) - { - (static_cast(context))->OnSuccessResponse_25(bitmap64); - } + chip::Callback::Callback mOnFailureCallback_0{ OnFailureCallback_0, this }; + chip::Callback::Callback mOnSuccessCallback_0{ OnSuccessCallback_0, this }; - static void OnFailureCallback_26(void * context, uint8_t status) + static void OnFailureCallback_0(void * context, uint8_t status) { - (static_cast(context))->OnFailureResponse_26(status); + (static_cast(context))->OnFailureResponse_0(status); } - static void OnSuccessCallback_26(void * context, uint64_t bitmap64) + static void OnSuccessCallback_0(void * context, int16_t measuredValue) { - (static_cast(context))->OnSuccessResponse_26(bitmap64); + (static_cast(context))->OnSuccessResponse_0(measuredValue); } - static void OnFailureCallback_27(void * context, uint8_t status) - { - (static_cast(context))->OnFailureResponse_27(status); - } + // + // Tests methods + // - static void OnSuccessCallback_27(void * context, uint64_t bitmap64) + CHIP_ERROR TestReadTheMandatoryAttributeMeasuredValue_0() { - (static_cast(context))->OnSuccessResponse_27(bitmap64); - } + chip::Controller::TemperatureMeasurementClusterTest cluster; + cluster.Associate(mDevice, 1); - static void OnFailureCallback_28(void * context, uint8_t status) - { - (static_cast(context))->OnFailureResponse_28(status); + return cluster.ReadAttributeMeasuredValue(mOnSuccessCallback_0.Cancel(), mOnFailureCallback_0.Cancel()); } - static void OnSuccessCallback_28(void * context, uint64_t bitmap64) - { - (static_cast(context))->OnSuccessResponse_28(bitmap64); - } + void OnFailureResponse_0(uint8_t status) { ThrowFailureResponse(); } - static void OnFailureCallback_29(void * context, uint8_t status) + void OnSuccessResponse_0(int16_t measuredValue) { - (static_cast(context))->OnFailureResponse_29(status); + VerifyOrReturn(CheckConstraintType("measuredValue", "", "int16")); + NextTest(); } +}; - static void OnSuccessCallback_29(void * context, uint64_t bitmap64) - { - (static_cast(context))->OnSuccessResponse_29(bitmap64); - } +class Test_TC_OCC_1_1 : public TestCommand +{ +public: + Test_TC_OCC_1_1() : TestCommand("Test_TC_OCC_1_1"), mTestIndex(0) {} - static void OnFailureCallback_30(void * context, uint8_t status) + /////////// TestCommand Interface ///////// + void NextTest() override { - (static_cast(context))->OnFailureResponse_30(status); - } + CHIP_ERROR err = CHIP_NO_ERROR; - static void OnSuccessCallback_30(void * context, uint8_t int8u) - { - (static_cast(context))->OnSuccessResponse_30(int8u); - } + if (0 == mTestIndex) + { + ChipLogProgress(chipTool, " **** Test Start: Test_TC_OCC_1_1\n"); + } + + if (mTestCount == mTestIndex) + { + ChipLogProgress(chipTool, " **** Test Complete: Test_TC_OCC_1_1\n"); + SetCommandExitStatus(CHIP_NO_ERROR); + return; + } - static void OnFailureCallback_31(void * context, uint8_t status) - { - (static_cast(context))->OnFailureResponse_31(status); - } + // Ensure we increment mTestIndex before we start running the relevant + // command. That way if we lose the timeslice after we send the message + // but before our function call returns, we won't end up with an + // incorrect mTestIndex value observed when we get the response. + switch (mTestIndex++) + { + case 0: + ChipLogProgress(chipTool, " ***** Test Step 0 : read the global attribute: ClusterRevision\n"); + err = TestReadTheGlobalAttributeClusterRevision_0(); + break; + case 1: + ChipLogProgress(chipTool, + " ***** Test Step 1 : write the default values to mandatory global attribute: ClusterRevision\n"); + err = TestWriteTheDefaultValuesToMandatoryGlobalAttributeClusterRevision_1(); + break; + } - static void OnSuccessCallback_31(void * context, uint8_t int8u) - { - (static_cast(context))->OnSuccessResponse_31(int8u); + if (CHIP_NO_ERROR != err) + { + ChipLogError(chipTool, " ***** Test Failure: %s\n", chip::ErrorStr(err)); + SetCommandExitStatus(err); + } } - static void OnFailureCallback_32(void * context, uint8_t status) - { - (static_cast(context))->OnFailureResponse_32(status); - } +private: + std::atomic_uint16_t mTestIndex; + const uint16_t mTestCount = 2; - static void OnSuccessCallback_32(void * context, uint8_t int8u) - { - (static_cast(context))->OnSuccessResponse_32(int8u); - } + chip::Callback::Callback mOnFailureCallback_0{ OnFailureCallback_0, this }; + chip::Callback::Callback mOnSuccessCallback_0{ OnSuccessCallback_0, this }; + chip::Callback::Callback mOnFailureCallback_1{ OnFailureCallback_1, this }; + chip::Callback::Callback mOnSuccessCallback_1{ OnSuccessCallback_1, this }; - static void OnFailureCallback_33(void * context, uint8_t status) + static void OnFailureCallback_0(void * context, uint8_t status) { - (static_cast(context))->OnFailureResponse_33(status); + (static_cast(context))->OnFailureResponse_0(status); } - static void OnSuccessCallback_33(void * context, uint8_t int8u) + static void OnSuccessCallback_0(void * context, uint16_t clusterRevision) { - (static_cast(context))->OnSuccessResponse_33(int8u); + (static_cast(context))->OnSuccessResponse_0(clusterRevision); } - static void OnFailureCallback_34(void * context, uint8_t status) + static void OnFailureCallback_1(void * context, uint8_t status) { - (static_cast(context))->OnFailureResponse_34(status); + (static_cast(context))->OnFailureResponse_1(status); } - static void OnSuccessCallback_34(void * context, uint8_t int8u) + static void OnSuccessCallback_1(void * context, uint16_t clusterRevision) { - (static_cast(context))->OnSuccessResponse_34(int8u); + (static_cast(context))->OnSuccessResponse_1(clusterRevision); } - static void OnFailureCallback_35(void * context, uint8_t status) - { - (static_cast(context))->OnFailureResponse_35(status); - } + // + // Tests methods + // - static void OnSuccessCallback_35(void * context, uint16_t int16u) + CHIP_ERROR TestReadTheGlobalAttributeClusterRevision_0() { - (static_cast(context))->OnSuccessResponse_35(int16u); - } + chip::Controller::OccupancySensingClusterTest cluster; + cluster.Associate(mDevice, 1); - static void OnFailureCallback_36(void * context, uint8_t status) - { - (static_cast(context))->OnFailureResponse_36(status); + return cluster.ReadAttributeClusterRevision(mOnSuccessCallback_0.Cancel(), mOnFailureCallback_0.Cancel()); } - static void OnSuccessCallback_36(void * context, uint16_t int16u) - { - (static_cast(context))->OnSuccessResponse_36(int16u); - } + void OnFailureResponse_0(uint8_t status) { ThrowFailureResponse(); } - static void OnFailureCallback_37(void * context, uint8_t status) + void OnSuccessResponse_0(uint16_t clusterRevision) { - (static_cast(context))->OnFailureResponse_37(status); + VerifyOrReturn(CheckValue("clusterRevision", clusterRevision, 2U)); + NextTest(); } - static void OnSuccessCallback_37(void * context, uint16_t int16u) + CHIP_ERROR TestWriteTheDefaultValuesToMandatoryGlobalAttributeClusterRevision_1() { - (static_cast(context))->OnSuccessResponse_37(int16u); - } + chip::Controller::OccupancySensingClusterTest cluster; + cluster.Associate(mDevice, 1); - static void OnFailureCallback_38(void * context, uint8_t status) - { - (static_cast(context))->OnFailureResponse_38(status); - } + uint16_t clusterRevisionArgument = 2U; - static void OnSuccessCallback_38(void * context, uint16_t int16u) - { - (static_cast(context))->OnSuccessResponse_38(int16u); + return cluster.WriteAttributeClusterRevision(mOnSuccessCallback_1.Cancel(), mOnFailureCallback_1.Cancel(), + clusterRevisionArgument); } - static void OnFailureCallback_39(void * context, uint8_t status) - { - (static_cast(context))->OnFailureResponse_39(status); - } + void OnFailureResponse_1(uint8_t status) { NextTest(); } - static void OnSuccessCallback_39(void * context, uint16_t int16u) - { - (static_cast(context))->OnSuccessResponse_39(int16u); - } + void OnSuccessResponse_1(uint16_t clusterRevision) { ThrowSuccessResponse(); } +}; - static void OnFailureCallback_40(void * context, uint8_t status) - { - (static_cast(context))->OnFailureResponse_40(status); - } +class Test_TC_LVL_1_1 : public TestCommand +{ +public: + Test_TC_LVL_1_1() : TestCommand("Test_TC_LVL_1_1"), mTestIndex(0) {} - static void OnSuccessCallback_40(void * context, uint32_t int32u) + /////////// TestCommand Interface ///////// + void NextTest() override { - (static_cast(context))->OnSuccessResponse_40(int32u); - } + CHIP_ERROR err = CHIP_NO_ERROR; - static void OnFailureCallback_41(void * context, uint8_t status) - { - (static_cast(context))->OnFailureResponse_41(status); - } + if (0 == mTestIndex) + { + ChipLogProgress(chipTool, " **** Test Start: Test_TC_LVL_1_1\n"); + } - static void OnSuccessCallback_41(void * context, uint32_t int32u) - { - (static_cast(context))->OnSuccessResponse_41(int32u); - } + if (mTestCount == mTestIndex) + { + ChipLogProgress(chipTool, " **** Test Complete: Test_TC_LVL_1_1\n"); + SetCommandExitStatus(CHIP_NO_ERROR); + return; + } - static void OnFailureCallback_42(void * context, uint8_t status) - { - (static_cast(context))->OnFailureResponse_42(status); - } + // Ensure we increment mTestIndex before we start running the relevant + // command. That way if we lose the timeslice after we send the message + // but before our function call returns, we won't end up with an + // incorrect mTestIndex value observed when we get the response. + switch (mTestIndex++) + { + case 0: + ChipLogProgress(chipTool, + " ***** Test Step 0 : write the default values to mandatory global attribute: ClusterRevision\n"); + err = TestWriteTheDefaultValuesToMandatoryGlobalAttributeClusterRevision_0(); + break; + } - static void OnSuccessCallback_42(void * context, uint32_t int32u) - { - (static_cast(context))->OnSuccessResponse_42(int32u); + if (CHIP_NO_ERROR != err) + { + ChipLogError(chipTool, " ***** Test Failure: %s\n", chip::ErrorStr(err)); + SetCommandExitStatus(err); + } } - static void OnFailureCallback_43(void * context, uint8_t status) - { - (static_cast(context))->OnFailureResponse_43(status); - } +private: + std::atomic_uint16_t mTestIndex; + const uint16_t mTestCount = 1; - static void OnSuccessCallback_43(void * context, uint32_t int32u) - { - (static_cast(context))->OnSuccessResponse_43(int32u); - } + chip::Callback::Callback mOnFailureCallback_0{ OnFailureCallback_0, this }; + chip::Callback::Callback mOnSuccessCallback_0{ OnSuccessCallback_0, this }; - static void OnFailureCallback_44(void * context, uint8_t status) + static void OnFailureCallback_0(void * context, uint8_t status) { - (static_cast(context))->OnFailureResponse_44(status); + (static_cast(context))->OnFailureResponse_0(status); } - static void OnSuccessCallback_44(void * context, uint32_t int32u) + static void OnSuccessCallback_0(void * context, uint16_t clusterRevision) { - (static_cast(context))->OnSuccessResponse_44(int32u); + (static_cast(context))->OnSuccessResponse_0(clusterRevision); } - static void OnFailureCallback_45(void * context, uint8_t status) - { - (static_cast(context))->OnFailureResponse_45(status); - } + // + // Tests methods + // - static void OnSuccessCallback_45(void * context, uint64_t int64u) + CHIP_ERROR TestWriteTheDefaultValuesToMandatoryGlobalAttributeClusterRevision_0() { - (static_cast(context))->OnSuccessResponse_45(int64u); - } + chip::Controller::LevelControlClusterTest cluster; + cluster.Associate(mDevice, 1); - static void OnFailureCallback_46(void * context, uint8_t status) - { - (static_cast(context))->OnFailureResponse_46(status); - } + uint16_t clusterRevisionArgument = 4U; - static void OnSuccessCallback_46(void * context, uint64_t int64u) - { - (static_cast(context))->OnSuccessResponse_46(int64u); + return cluster.WriteAttributeClusterRevision(mOnSuccessCallback_0.Cancel(), mOnFailureCallback_0.Cancel(), + clusterRevisionArgument); } - static void OnFailureCallback_47(void * context, uint8_t status) - { - (static_cast(context))->OnFailureResponse_47(status); - } + void OnFailureResponse_0(uint8_t status) { NextTest(); } - static void OnSuccessCallback_47(void * context, uint64_t int64u) - { - (static_cast(context))->OnSuccessResponse_47(int64u); - } + void OnSuccessResponse_0(uint16_t clusterRevision) { ThrowSuccessResponse(); } +}; - static void OnFailureCallback_48(void * context, uint8_t status) - { - (static_cast(context))->OnFailureResponse_48(status); - } +class Test_TC_RH_1_1 : public TestCommand +{ +public: + Test_TC_RH_1_1() : TestCommand("Test_TC_RH_1_1"), mTestIndex(0) {} - static void OnSuccessCallback_48(void * context, uint64_t int64u) + /////////// TestCommand Interface ///////// + void NextTest() override { - (static_cast(context))->OnSuccessResponse_48(int64u); - } + CHIP_ERROR err = CHIP_NO_ERROR; - static void OnFailureCallback_49(void * context, uint8_t status) - { - (static_cast(context))->OnFailureResponse_49(status); - } + if (0 == mTestIndex) + { + ChipLogProgress(chipTool, " **** Test Start: Test_TC_RH_1_1\n"); + } - static void OnSuccessCallback_49(void * context, uint64_t int64u) - { - (static_cast(context))->OnSuccessResponse_49(int64u); - } + if (mTestCount == mTestIndex) + { + ChipLogProgress(chipTool, " **** Test Complete: Test_TC_RH_1_1\n"); + SetCommandExitStatus(CHIP_NO_ERROR); + return; + } - static void OnFailureCallback_50(void * context, uint8_t status) - { - (static_cast(context))->OnFailureResponse_50(status); - } + // Ensure we increment mTestIndex before we start running the relevant + // command. That way if we lose the timeslice after we send the message + // but before our function call returns, we won't end up with an + // incorrect mTestIndex value observed when we get the response. + switch (mTestIndex++) + { + case 0: + ChipLogProgress(chipTool, + " ***** Test Step 0 : write the default values to mandatory global attribute: ClusterRevision\n"); + err = TestWriteTheDefaultValuesToMandatoryGlobalAttributeClusterRevision_0(); + break; + } - static void OnSuccessCallback_50(void * context, int8_t int8s) - { - (static_cast(context))->OnSuccessResponse_50(int8s); + if (CHIP_NO_ERROR != err) + { + ChipLogError(chipTool, " ***** Test Failure: %s\n", chip::ErrorStr(err)); + SetCommandExitStatus(err); + } } - static void OnFailureCallback_51(void * context, uint8_t status) - { - (static_cast(context))->OnFailureResponse_51(status); - } +private: + std::atomic_uint16_t mTestIndex; + const uint16_t mTestCount = 1; - static void OnSuccessCallback_51(void * context, int8_t int8s) - { - (static_cast(context))->OnSuccessResponse_51(int8s); - } + chip::Callback::Callback mOnFailureCallback_0{ OnFailureCallback_0, this }; + chip::Callback::Callback mOnSuccessCallback_0{ OnSuccessCallback_0, this }; - static void OnFailureCallback_52(void * context, uint8_t status) + static void OnFailureCallback_0(void * context, uint8_t status) { - (static_cast(context))->OnFailureResponse_52(status); + (static_cast(context))->OnFailureResponse_0(status); } - static void OnSuccessCallback_52(void * context, int8_t int8s) + static void OnSuccessCallback_0(void * context, uint16_t clusterRevision) { - (static_cast(context))->OnSuccessResponse_52(int8s); + (static_cast(context))->OnSuccessResponse_0(clusterRevision); } - static void OnFailureCallback_53(void * context, uint8_t status) - { - (static_cast(context))->OnFailureResponse_53(status); - } + // + // Tests methods + // - static void OnSuccessCallback_53(void * context, int8_t int8s) + CHIP_ERROR TestWriteTheDefaultValuesToMandatoryGlobalAttributeClusterRevision_0() { - (static_cast(context))->OnSuccessResponse_53(int8s); - } + chip::Controller::RelativeHumidityMeasurementClusterTest cluster; + cluster.Associate(mDevice, 1); - static void OnFailureCallback_54(void * context, uint8_t status) - { - (static_cast(context))->OnFailureResponse_54(status); - } + uint16_t clusterRevisionArgument = 1U; - static void OnSuccessCallback_54(void * context, int8_t int8s) - { - (static_cast(context))->OnSuccessResponse_54(int8s); + return cluster.WriteAttributeClusterRevision(mOnSuccessCallback_0.Cancel(), mOnFailureCallback_0.Cancel(), + clusterRevisionArgument); } - static void OnFailureCallback_55(void * context, uint8_t status) - { - (static_cast(context))->OnFailureResponse_55(status); - } + void OnFailureResponse_0(uint8_t status) { NextTest(); } - static void OnSuccessCallback_55(void * context, int8_t int8s) - { - (static_cast(context))->OnSuccessResponse_55(int8s); - } + void OnSuccessResponse_0(uint16_t clusterRevision) { ThrowSuccessResponse(); } +}; - static void OnFailureCallback_56(void * context, uint8_t status) - { - (static_cast(context))->OnFailureResponse_56(status); - } +class Test_TC_MC_1_1 : public TestCommand +{ +public: + Test_TC_MC_1_1() : TestCommand("Test_TC_MC_1_1"), mTestIndex(0) {} - static void OnSuccessCallback_56(void * context, int8_t int8s) + /////////// TestCommand Interface ///////// + void NextTest() override { - (static_cast(context))->OnSuccessResponse_56(int8s); - } + CHIP_ERROR err = CHIP_NO_ERROR; - static void OnFailureCallback_57(void * context, uint8_t status) - { - (static_cast(context))->OnFailureResponse_57(status); - } + if (0 == mTestIndex) + { + ChipLogProgress(chipTool, " **** Test Start: Test_TC_MC_1_1\n"); + } - static void OnSuccessCallback_57(void * context, int16_t int16s) - { - (static_cast(context))->OnSuccessResponse_57(int16s); - } + if (mTestCount == mTestIndex) + { + ChipLogProgress(chipTool, " **** Test Complete: Test_TC_MC_1_1\n"); + SetCommandExitStatus(CHIP_NO_ERROR); + return; + } - static void OnFailureCallback_58(void * context, uint8_t status) - { - (static_cast(context))->OnFailureResponse_58(status); - } + // Ensure we increment mTestIndex before we start running the relevant + // command. That way if we lose the timeslice after we send the message + // but before our function call returns, we won't end up with an + // incorrect mTestIndex value observed when we get the response. + switch (mTestIndex++) + { + case 0: + ChipLogProgress(chipTool, + " ***** Test Step 0 : write the default values to mandatory global attribute: ClusterRevision\n"); + err = TestWriteTheDefaultValuesToMandatoryGlobalAttributeClusterRevision_0(); + break; + } - static void OnSuccessCallback_58(void * context, int16_t int16s) - { - (static_cast(context))->OnSuccessResponse_58(int16s); + if (CHIP_NO_ERROR != err) + { + ChipLogError(chipTool, " ***** Test Failure: %s\n", chip::ErrorStr(err)); + SetCommandExitStatus(err); + } } - static void OnFailureCallback_59(void * context, uint8_t status) - { - (static_cast(context))->OnFailureResponse_59(status); - } +private: + std::atomic_uint16_t mTestIndex; + const uint16_t mTestCount = 1; - static void OnSuccessCallback_59(void * context, int16_t int16s) - { - (static_cast(context))->OnSuccessResponse_59(int16s); - } + chip::Callback::Callback mOnFailureCallback_0{ OnFailureCallback_0, this }; + chip::Callback::Callback mOnSuccessCallback_0{ OnSuccessCallback_0, this }; - static void OnFailureCallback_60(void * context, uint8_t status) + static void OnFailureCallback_0(void * context, uint8_t status) { - (static_cast(context))->OnFailureResponse_60(status); + (static_cast(context))->OnFailureResponse_0(status); } - static void OnSuccessCallback_60(void * context, int16_t int16s) + static void OnSuccessCallback_0(void * context, uint16_t clusterRevision) { - (static_cast(context))->OnSuccessResponse_60(int16s); + (static_cast(context))->OnSuccessResponse_0(clusterRevision); } - static void OnFailureCallback_61(void * context, uint8_t status) - { - (static_cast(context))->OnFailureResponse_61(status); - } + // + // Tests methods + // - static void OnSuccessCallback_61(void * context, int16_t int16s) + CHIP_ERROR TestWriteTheDefaultValuesToMandatoryGlobalAttributeClusterRevision_0() { - (static_cast(context))->OnSuccessResponse_61(int16s); - } + chip::Controller::RelativeHumidityMeasurementClusterTest cluster; + cluster.Associate(mDevice, 1); - static void OnFailureCallback_62(void * context, uint8_t status) - { - (static_cast(context))->OnFailureResponse_62(status); - } + uint16_t clusterRevisionArgument = 1U; - static void OnSuccessCallback_62(void * context, int16_t int16s) - { - (static_cast(context))->OnSuccessResponse_62(int16s); + return cluster.WriteAttributeClusterRevision(mOnSuccessCallback_0.Cancel(), mOnFailureCallback_0.Cancel(), + clusterRevisionArgument); } - static void OnFailureCallback_63(void * context, uint8_t status) - { - (static_cast(context))->OnFailureResponse_63(status); - } + void OnFailureResponse_0(uint8_t status) { NextTest(); } - static void OnSuccessCallback_63(void * context, int16_t int16s) - { - (static_cast(context))->OnSuccessResponse_63(int16s); - } + void OnSuccessResponse_0(uint16_t clusterRevision) { ThrowSuccessResponse(); } +}; - static void OnFailureCallback_64(void * context, uint8_t status) - { - (static_cast(context))->OnFailureResponse_64(status); - } +class Test_TC_TSTAT_1_1 : public TestCommand +{ +public: + Test_TC_TSTAT_1_1() : TestCommand("Test_TC_TSTAT_1_1"), mTestIndex(0) {} - static void OnSuccessCallback_64(void * context, int32_t int32s) + /////////// TestCommand Interface ///////// + void NextTest() override { - (static_cast(context))->OnSuccessResponse_64(int32s); - } + CHIP_ERROR err = CHIP_NO_ERROR; - static void OnFailureCallback_65(void * context, uint8_t status) - { - (static_cast(context))->OnFailureResponse_65(status); - } + if (0 == mTestIndex) + { + ChipLogProgress(chipTool, " **** Test Start: Test_TC_TSTAT_1_1\n"); + } - static void OnSuccessCallback_65(void * context, int32_t int32s) - { - (static_cast(context))->OnSuccessResponse_65(int32s); - } + if (mTestCount == mTestIndex) + { + ChipLogProgress(chipTool, " **** Test Complete: Test_TC_TSTAT_1_1\n"); + SetCommandExitStatus(CHIP_NO_ERROR); + return; + } - static void OnFailureCallback_66(void * context, uint8_t status) - { - (static_cast(context))->OnFailureResponse_66(status); - } + // Ensure we increment mTestIndex before we start running the relevant + // command. That way if we lose the timeslice after we send the message + // but before our function call returns, we won't end up with an + // incorrect mTestIndex value observed when we get the response. + switch (mTestIndex++) + { + case 0: + ChipLogProgress(chipTool, + " ***** Test Step 0 : write the default values to mandatory global attribute: ClusterRevision\n"); + err = TestWriteTheDefaultValuesToMandatoryGlobalAttributeClusterRevision_0(); + break; + } - static void OnSuccessCallback_66(void * context, int32_t int32s) - { - (static_cast(context))->OnSuccessResponse_66(int32s); + if (CHIP_NO_ERROR != err) + { + ChipLogError(chipTool, " ***** Test Failure: %s\n", chip::ErrorStr(err)); + SetCommandExitStatus(err); + } } - static void OnFailureCallback_67(void * context, uint8_t status) - { - (static_cast(context))->OnFailureResponse_67(status); - } +private: + std::atomic_uint16_t mTestIndex; + const uint16_t mTestCount = 1; + + chip::Callback::Callback mOnFailureCallback_0{ OnFailureCallback_0, this }; + chip::Callback::Callback mOnSuccessCallback_0{ OnSuccessCallback_0, this }; - static void OnSuccessCallback_67(void * context, int32_t int32s) + static void OnFailureCallback_0(void * context, uint8_t status) { - (static_cast(context))->OnSuccessResponse_67(int32s); + (static_cast(context))->OnFailureResponse_0(status); } - static void OnFailureCallback_68(void * context, uint8_t status) + static void OnSuccessCallback_0(void * context, uint16_t clusterRevision) { - (static_cast(context))->OnFailureResponse_68(status); + (static_cast(context))->OnSuccessResponse_0(clusterRevision); } - static void OnSuccessCallback_68(void * context, int32_t int32s) - { - (static_cast(context))->OnSuccessResponse_68(int32s); - } + // + // Tests methods + // - static void OnFailureCallback_69(void * context, uint8_t status) + CHIP_ERROR TestWriteTheDefaultValuesToMandatoryGlobalAttributeClusterRevision_0() { - (static_cast(context))->OnFailureResponse_69(status); - } + chip::Controller::ThermostatClusterTest cluster; + cluster.Associate(mDevice, 1); - static void OnSuccessCallback_69(void * context, int32_t int32s) - { - (static_cast(context))->OnSuccessResponse_69(int32s); - } + uint16_t clusterRevisionArgument = 5U; - static void OnFailureCallback_70(void * context, uint8_t status) - { - (static_cast(context))->OnFailureResponse_70(status); + return cluster.WriteAttributeClusterRevision(mOnSuccessCallback_0.Cancel(), mOnFailureCallback_0.Cancel(), + clusterRevisionArgument); } - static void OnSuccessCallback_70(void * context, int32_t int32s) - { - (static_cast(context))->OnSuccessResponse_70(int32s); - } + void OnFailureResponse_0(uint8_t status) { NextTest(); } - static void OnFailureCallback_71(void * context, uint8_t status) - { - (static_cast(context))->OnFailureResponse_71(status); - } + void OnSuccessResponse_0(uint16_t clusterRevision) { ThrowSuccessResponse(); } +}; - static void OnSuccessCallback_71(void * context, int64_t int64s) - { - (static_cast(context))->OnSuccessResponse_71(int64s); - } +class Test_TC_PCC_1_1 : public TestCommand +{ +public: + Test_TC_PCC_1_1() : TestCommand("Test_TC_PCC_1_1"), mTestIndex(0) {} - static void OnFailureCallback_72(void * context, uint8_t status) + /////////// TestCommand Interface ///////// + void NextTest() override { - (static_cast(context))->OnFailureResponse_72(status); - } + CHIP_ERROR err = CHIP_NO_ERROR; - static void OnSuccessCallback_72(void * context, int64_t int64s) - { - (static_cast(context))->OnSuccessResponse_72(int64s); - } + if (0 == mTestIndex) + { + ChipLogProgress(chipTool, " **** Test Start: Test_TC_PCC_1_1\n"); + } - static void OnFailureCallback_73(void * context, uint8_t status) - { - (static_cast(context))->OnFailureResponse_73(status); - } + if (mTestCount == mTestIndex) + { + ChipLogProgress(chipTool, " **** Test Complete: Test_TC_PCC_1_1\n"); + SetCommandExitStatus(CHIP_NO_ERROR); + return; + } - static void OnSuccessCallback_73(void * context, int64_t int64s) - { - (static_cast(context))->OnSuccessResponse_73(int64s); - } + // Ensure we increment mTestIndex before we start running the relevant + // command. That way if we lose the timeslice after we send the message + // but before our function call returns, we won't end up with an + // incorrect mTestIndex value observed when we get the response. + switch (mTestIndex++) + { + case 0: + ChipLogProgress(chipTool, + " ***** Test Step 0 : write the default values to mandatory global attribute: ClusterRevision\n"); + err = TestWriteTheDefaultValuesToMandatoryGlobalAttributeClusterRevision_0(); + break; + } - static void OnFailureCallback_74(void * context, uint8_t status) - { - (static_cast(context))->OnFailureResponse_74(status); + if (CHIP_NO_ERROR != err) + { + ChipLogError(chipTool, " ***** Test Failure: %s\n", chip::ErrorStr(err)); + SetCommandExitStatus(err); + } } - static void OnSuccessCallback_74(void * context, int64_t int64s) - { - (static_cast(context))->OnSuccessResponse_74(int64s); - } +private: + std::atomic_uint16_t mTestIndex; + const uint16_t mTestCount = 1; - static void OnFailureCallback_75(void * context, uint8_t status) - { - (static_cast(context))->OnFailureResponse_75(status); - } + chip::Callback::Callback mOnFailureCallback_0{ OnFailureCallback_0, this }; + chip::Callback::Callback mOnSuccessCallback_0{ OnSuccessCallback_0, this }; - static void OnSuccessCallback_75(void * context, int64_t int64s) + static void OnFailureCallback_0(void * context, uint8_t status) { - (static_cast(context))->OnSuccessResponse_75(int64s); + (static_cast(context))->OnFailureResponse_0(status); } - static void OnFailureCallback_76(void * context, uint8_t status) + static void OnSuccessCallback_0(void * context, uint16_t clusterRevision) { - (static_cast(context))->OnFailureResponse_76(status); + (static_cast(context))->OnSuccessResponse_0(clusterRevision); } - static void OnSuccessCallback_76(void * context, int64_t int64s) - { - (static_cast(context))->OnSuccessResponse_76(int64s); - } + // + // Tests methods + // - static void OnFailureCallback_77(void * context, uint8_t status) + CHIP_ERROR TestWriteTheDefaultValuesToMandatoryGlobalAttributeClusterRevision_0() { - (static_cast(context))->OnFailureResponse_77(status); - } + chip::Controller::PumpConfigurationAndControlClusterTest cluster; + cluster.Associate(mDevice, 1); - static void OnSuccessCallback_77(void * context, int64_t int64s) - { - (static_cast(context))->OnSuccessResponse_77(int64s); - } + uint16_t clusterRevisionArgument = 3U; - static void OnFailureCallback_78(void * context, uint8_t status) - { - (static_cast(context))->OnFailureResponse_78(status); + return cluster.WriteAttributeClusterRevision(mOnSuccessCallback_0.Cancel(), mOnFailureCallback_0.Cancel(), + clusterRevisionArgument); } - static void OnSuccessCallback_78(void * context, uint8_t enum8) - { - (static_cast(context))->OnSuccessResponse_78(enum8); - } + void OnFailureResponse_0(uint8_t status) { NextTest(); } - static void OnFailureCallback_79(void * context, uint8_t status) - { - (static_cast(context))->OnFailureResponse_79(status); - } + void OnSuccessResponse_0(uint16_t clusterRevision) { ThrowSuccessResponse(); } +}; - static void OnSuccessCallback_79(void * context, uint8_t enum8) - { - (static_cast(context))->OnSuccessResponse_79(enum8); - } +class Test_TC_PCC_2_1 : public TestCommand +{ +public: + Test_TC_PCC_2_1() : TestCommand("Test_TC_PCC_2_1"), mTestIndex(0) {} - static void OnFailureCallback_80(void * context, uint8_t status) + /////////// TestCommand Interface ///////// + void NextTest() override { - (static_cast(context))->OnFailureResponse_80(status); - } + CHIP_ERROR err = CHIP_NO_ERROR; - static void OnSuccessCallback_80(void * context, uint8_t enum8) - { - (static_cast(context))->OnSuccessResponse_80(enum8); - } + if (0 == mTestIndex) + { + ChipLogProgress(chipTool, " **** Test Start: Test_TC_PCC_2_1\n"); + } - static void OnFailureCallback_81(void * context, uint8_t status) - { - (static_cast(context))->OnFailureResponse_81(status); + if (mTestCount == mTestIndex) + { + ChipLogProgress(chipTool, " **** Test Complete: Test_TC_PCC_2_1\n"); + SetCommandExitStatus(CHIP_NO_ERROR); + return; + } + + // Ensure we increment mTestIndex before we start running the relevant + // command. That way if we lose the timeslice after we send the message + // but before our function call returns, we won't end up with an + // incorrect mTestIndex value observed when we get the response. + switch (mTestIndex++) + { + case 0: + ChipLogProgress(chipTool, " ***** Test Step 0 : read the mandatory attribute: MaxPressure\n"); + err = TestReadTheMandatoryAttributeMaxPressure_0(); + break; + case 1: + ChipLogProgress(chipTool, " ***** Test Step 1 : read the mandatory attribute: EffectiveOperationMode\n"); + err = TestReadTheMandatoryAttributeEffectiveOperationMode_1(); + break; + case 2: + ChipLogProgress(chipTool, " ***** Test Step 2 : read the mandatory attribute: EffectiveControlMode\n"); + err = TestReadTheMandatoryAttributeEffectiveControlMode_2(); + break; + case 3: + ChipLogProgress(chipTool, " ***** Test Step 3 : read the mandatory attribute: Capacity\n"); + err = TestReadTheMandatoryAttributeCapacity_3(); + break; + case 4: + ChipLogProgress(chipTool, " ***** Test Step 4 : read the mandatory attribute: MaxPressure\n"); + err = TestReadTheMandatoryAttributeMaxPressure_4(); + break; + case 5: + ChipLogProgress(chipTool, " ***** Test Step 5 : read the mandatory attribute: EffectiveOperationMode\n"); + err = TestReadTheMandatoryAttributeEffectiveOperationMode_5(); + break; + case 6: + ChipLogProgress(chipTool, " ***** Test Step 6 : read the mandatory attribute: EffectiveControlMode\n"); + err = TestReadTheMandatoryAttributeEffectiveControlMode_6(); + break; + case 7: + ChipLogProgress(chipTool, " ***** Test Step 7 : read the mandatory attribute: Capacity\n"); + err = TestReadTheMandatoryAttributeCapacity_7(); + break; + } + + if (CHIP_NO_ERROR != err) + { + ChipLogError(chipTool, " ***** Test Failure: %s\n", chip::ErrorStr(err)); + SetCommandExitStatus(err); + } } - static void OnSuccessCallback_81(void * context, uint8_t enum8) +private: + std::atomic_uint16_t mTestIndex; + const uint16_t mTestCount = 8; + + chip::Callback::Callback mOnFailureCallback_0{ OnFailureCallback_0, this }; + chip::Callback::Callback mOnSuccessCallback_0{ OnSuccessCallback_0, this }; + chip::Callback::Callback mOnFailureCallback_1{ OnFailureCallback_1, this }; + chip::Callback::Callback mOnSuccessCallback_1{ OnSuccessCallback_1, + this }; + chip::Callback::Callback mOnFailureCallback_2{ OnFailureCallback_2, this }; + chip::Callback::Callback mOnSuccessCallback_2{ OnSuccessCallback_2, + this }; + chip::Callback::Callback mOnFailureCallback_3{ OnFailureCallback_3, this }; + chip::Callback::Callback mOnSuccessCallback_3{ OnSuccessCallback_3, this }; + chip::Callback::Callback mOnFailureCallback_4{ OnFailureCallback_4, this }; + chip::Callback::Callback mOnSuccessCallback_4{ OnSuccessCallback_4, this }; + chip::Callback::Callback mOnFailureCallback_5{ OnFailureCallback_5, this }; + chip::Callback::Callback mOnSuccessCallback_5{ OnSuccessCallback_5, + this }; + chip::Callback::Callback mOnFailureCallback_6{ OnFailureCallback_6, this }; + chip::Callback::Callback mOnSuccessCallback_6{ OnSuccessCallback_6, + this }; + chip::Callback::Callback mOnFailureCallback_7{ OnFailureCallback_7, this }; + chip::Callback::Callback mOnSuccessCallback_7{ OnSuccessCallback_7, this }; + + static void OnFailureCallback_0(void * context, uint8_t status) { - (static_cast(context))->OnSuccessResponse_81(enum8); + (static_cast(context))->OnFailureResponse_0(status); } - static void OnFailureCallback_82(void * context, uint8_t status) + static void OnSuccessCallback_0(void * context, int16_t maxPressure) { - (static_cast(context))->OnFailureResponse_82(status); + (static_cast(context))->OnSuccessResponse_0(maxPressure); } - static void OnSuccessCallback_82(void * context, uint8_t enum8) + static void OnFailureCallback_1(void * context, uint8_t status) { - (static_cast(context))->OnSuccessResponse_82(enum8); + (static_cast(context))->OnFailureResponse_1(status); } - static void OnFailureCallback_83(void * context, uint8_t status) + static void OnSuccessCallback_1(void * context, uint8_t effectiveOperationMode) { - (static_cast(context))->OnFailureResponse_83(status); + (static_cast(context))->OnSuccessResponse_1(effectiveOperationMode); } - static void OnSuccessCallback_83(void * context, uint16_t enum16) + static void OnFailureCallback_2(void * context, uint8_t status) { - (static_cast(context))->OnSuccessResponse_83(enum16); + (static_cast(context))->OnFailureResponse_2(status); } - static void OnFailureCallback_84(void * context, uint8_t status) + static void OnSuccessCallback_2(void * context, uint8_t effectiveControlMode) { - (static_cast(context))->OnFailureResponse_84(status); + (static_cast(context))->OnSuccessResponse_2(effectiveControlMode); } - static void OnSuccessCallback_84(void * context, uint16_t enum16) + static void OnFailureCallback_3(void * context, uint8_t status) { - (static_cast(context))->OnSuccessResponse_84(enum16); + (static_cast(context))->OnFailureResponse_3(status); } - static void OnFailureCallback_85(void * context, uint8_t status) + static void OnSuccessCallback_3(void * context, int16_t capacity) { - (static_cast(context))->OnFailureResponse_85(status); + (static_cast(context))->OnSuccessResponse_3(capacity); } - static void OnSuccessCallback_85(void * context, uint16_t enum16) + static void OnFailureCallback_4(void * context, uint8_t status) { - (static_cast(context))->OnSuccessResponse_85(enum16); + (static_cast(context))->OnFailureResponse_4(status); } - static void OnFailureCallback_86(void * context, uint8_t status) + static void OnSuccessCallback_4(void * context, int16_t maxPressure) { - (static_cast(context))->OnFailureResponse_86(status); + (static_cast(context))->OnSuccessResponse_4(maxPressure); } - static void OnSuccessCallback_86(void * context, uint16_t enum16) + static void OnFailureCallback_5(void * context, uint8_t status) { - (static_cast(context))->OnSuccessResponse_86(enum16); + (static_cast(context))->OnFailureResponse_5(status); } - static void OnFailureCallback_87(void * context, uint8_t status) + static void OnSuccessCallback_5(void * context, uint8_t effectiveOperationMode) { - (static_cast(context))->OnFailureResponse_87(status); + (static_cast(context))->OnSuccessResponse_5(effectiveOperationMode); } - static void OnSuccessCallback_87(void * context, uint16_t enum16) + static void OnFailureCallback_6(void * context, uint8_t status) { - (static_cast(context))->OnSuccessResponse_87(enum16); + (static_cast(context))->OnFailureResponse_6(status); } - static void OnFailureCallback_88(void * context, uint8_t status) + static void OnSuccessCallback_6(void * context, uint8_t effectiveControlMode) { - (static_cast(context))->OnFailureResponse_88(status); + (static_cast(context))->OnSuccessResponse_6(effectiveControlMode); } - static void OnSuccessCallback_88(void * context, chip::ByteSpan octetString) + static void OnFailureCallback_7(void * context, uint8_t status) { - (static_cast(context))->OnSuccessResponse_88(octetString); + (static_cast(context))->OnFailureResponse_7(status); } - static void OnFailureCallback_89(void * context, uint8_t status) + static void OnSuccessCallback_7(void * context, int16_t capacity) { - (static_cast(context))->OnFailureResponse_89(status); + (static_cast(context))->OnSuccessResponse_7(capacity); } - static void OnSuccessCallback_89(void * context, chip::ByteSpan octetString) - { - (static_cast(context))->OnSuccessResponse_89(octetString); - } + // + // Tests methods + // - static void OnFailureCallback_90(void * context, uint8_t status) + CHIP_ERROR TestReadTheMandatoryAttributeMaxPressure_0() { - (static_cast(context))->OnFailureResponse_90(status); - } + chip::Controller::PumpConfigurationAndControlClusterTest cluster; + cluster.Associate(mDevice, 1); - static void OnSuccessCallback_90(void * context, chip::ByteSpan octetString) - { - (static_cast(context))->OnSuccessResponse_90(octetString); + return cluster.ReadAttributeMaxPressure(mOnSuccessCallback_0.Cancel(), mOnFailureCallback_0.Cancel()); } - static void OnFailureCallback_91(void * context, uint8_t status) - { - (static_cast(context))->OnFailureResponse_91(status); - } + void OnFailureResponse_0(uint8_t status) { ThrowFailureResponse(); } - static void OnSuccessCallback_91(void * context, chip::ByteSpan octetString) + void OnSuccessResponse_0(int16_t maxPressure) { - (static_cast(context))->OnSuccessResponse_91(octetString); + VerifyOrReturn(CheckConstraintType("maxPressure", "", "int16")); + NextTest(); } - static void OnFailureCallback_92(void * context, uint8_t status) + CHIP_ERROR TestReadTheMandatoryAttributeEffectiveOperationMode_1() { - (static_cast(context))->OnFailureResponse_92(status); - } + chip::Controller::PumpConfigurationAndControlClusterTest cluster; + cluster.Associate(mDevice, 1); - static void OnSuccessCallback_92(void * context, chip::ByteSpan octetString) - { - (static_cast(context))->OnSuccessResponse_92(octetString); + return cluster.ReadAttributeEffectiveOperationMode(mOnSuccessCallback_1.Cancel(), mOnFailureCallback_1.Cancel()); } - static void OnFailureCallback_93(void * context, uint8_t status) - { - (static_cast(context))->OnFailureResponse_93(status); - } + void OnFailureResponse_1(uint8_t status) { ThrowFailureResponse(); } - static void OnSuccessCallback_93(void * context, chip::ByteSpan octetString) + void OnSuccessResponse_1(uint8_t effectiveOperationMode) { - (static_cast(context))->OnSuccessResponse_93(octetString); + VerifyOrReturn(CheckConstraintType("effectiveOperationMode", "", "enum8")); + NextTest(); } - static void OnFailureCallback_94(void * context, uint8_t status) + CHIP_ERROR TestReadTheMandatoryAttributeEffectiveControlMode_2() { - (static_cast(context))->OnFailureResponse_94(status); - } + chip::Controller::PumpConfigurationAndControlClusterTest cluster; + cluster.Associate(mDevice, 1); - static void OnSuccessCallback_94(void * context, chip::ByteSpan longOctetString) - { - (static_cast(context))->OnSuccessResponse_94(longOctetString); + return cluster.ReadAttributeEffectiveControlMode(mOnSuccessCallback_2.Cancel(), mOnFailureCallback_2.Cancel()); } - static void OnFailureCallback_95(void * context, uint8_t status) - { - (static_cast(context))->OnFailureResponse_95(status); - } + void OnFailureResponse_2(uint8_t status) { ThrowFailureResponse(); } - static void OnSuccessCallback_95(void * context, chip::ByteSpan longOctetString) + void OnSuccessResponse_2(uint8_t effectiveControlMode) { - (static_cast(context))->OnSuccessResponse_95(longOctetString); + VerifyOrReturn(CheckConstraintType("effectiveControlMode", "", "enum8")); + NextTest(); } - static void OnFailureCallback_96(void * context, uint8_t status) + CHIP_ERROR TestReadTheMandatoryAttributeCapacity_3() { - (static_cast(context))->OnFailureResponse_96(status); - } + chip::Controller::PumpConfigurationAndControlClusterTest cluster; + cluster.Associate(mDevice, 1); - static void OnSuccessCallback_96(void * context, chip::ByteSpan longOctetString) - { - (static_cast(context))->OnSuccessResponse_96(longOctetString); + return cluster.ReadAttributeCapacity(mOnSuccessCallback_3.Cancel(), mOnFailureCallback_3.Cancel()); } - static void OnFailureCallback_97(void * context, uint8_t status) - { - (static_cast(context))->OnFailureResponse_97(status); - } + void OnFailureResponse_3(uint8_t status) { ThrowFailureResponse(); } - static void OnSuccessCallback_97(void * context, chip::ByteSpan longOctetString) + void OnSuccessResponse_3(int16_t capacity) { - (static_cast(context))->OnSuccessResponse_97(longOctetString); + VerifyOrReturn(CheckConstraintType("capacity", "", "int16")); + NextTest(); } - static void OnFailureCallback_98(void * context, uint8_t status) + CHIP_ERROR TestReadTheMandatoryAttributeMaxPressure_4() { - (static_cast(context))->OnFailureResponse_98(status); - } + chip::Controller::PumpConfigurationAndControlClusterTest cluster; + cluster.Associate(mDevice, 1); - static void OnSuccessCallback_98(void * context, chip::ByteSpan charString) - { - (static_cast(context))->OnSuccessResponse_98(charString); + return cluster.ReadAttributeMaxPressure(mOnSuccessCallback_4.Cancel(), mOnFailureCallback_4.Cancel()); } - static void OnFailureCallback_99(void * context, uint8_t status) - { - (static_cast(context))->OnFailureResponse_99(status); - } + void OnFailureResponse_4(uint8_t status) { ThrowFailureResponse(); } - static void OnSuccessCallback_99(void * context, chip::ByteSpan charString) + void OnSuccessResponse_4(int16_t maxPressure) { - (static_cast(context))->OnSuccessResponse_99(charString); + VerifyOrReturn(CheckConstraintType("maxPressure", "", "int16")); + NextTest(); } - static void OnFailureCallback_100(void * context, uint8_t status) + CHIP_ERROR TestReadTheMandatoryAttributeEffectiveOperationMode_5() { - (static_cast(context))->OnFailureResponse_100(status); - } + chip::Controller::PumpConfigurationAndControlClusterTest cluster; + cluster.Associate(mDevice, 1); - static void OnSuccessCallback_100(void * context, chip::ByteSpan charString) - { - (static_cast(context))->OnSuccessResponse_100(charString); + return cluster.ReadAttributeEffectiveOperationMode(mOnSuccessCallback_5.Cancel(), mOnFailureCallback_5.Cancel()); } - static void OnFailureCallback_101(void * context, uint8_t status) - { - (static_cast(context))->OnFailureResponse_101(status); - } + void OnFailureResponse_5(uint8_t status) { ThrowFailureResponse(); } - static void OnSuccessCallback_101(void * context, chip::ByteSpan charString) + void OnSuccessResponse_5(uint8_t effectiveOperationMode) { - (static_cast(context))->OnSuccessResponse_101(charString); + VerifyOrReturn(CheckConstraintType("effectiveOperationMode", "", "enum8")); + NextTest(); } - static void OnFailureCallback_102(void * context, uint8_t status) + CHIP_ERROR TestReadTheMandatoryAttributeEffectiveControlMode_6() { - (static_cast(context))->OnFailureResponse_102(status); - } + chip::Controller::PumpConfigurationAndControlClusterTest cluster; + cluster.Associate(mDevice, 1); - static void OnSuccessCallback_102(void * context, chip::ByteSpan longCharString) - { - (static_cast(context))->OnSuccessResponse_102(longCharString); + return cluster.ReadAttributeEffectiveControlMode(mOnSuccessCallback_6.Cancel(), mOnFailureCallback_6.Cancel()); } - static void OnFailureCallback_103(void * context, uint8_t status) - { - (static_cast(context))->OnFailureResponse_103(status); - } + void OnFailureResponse_6(uint8_t status) { ThrowFailureResponse(); } - static void OnSuccessCallback_103(void * context, chip::ByteSpan longCharString) + void OnSuccessResponse_6(uint8_t effectiveControlMode) { - (static_cast(context))->OnSuccessResponse_103(longCharString); + VerifyOrReturn(CheckConstraintType("effectiveControlMode", "", "enum8")); + NextTest(); } - static void OnFailureCallback_104(void * context, uint8_t status) + CHIP_ERROR TestReadTheMandatoryAttributeCapacity_7() { - (static_cast(context))->OnFailureResponse_104(status); - } + chip::Controller::PumpConfigurationAndControlClusterTest cluster; + cluster.Associate(mDevice, 1); - static void OnSuccessCallback_104(void * context, chip::ByteSpan longCharString) - { - (static_cast(context))->OnSuccessResponse_104(longCharString); + return cluster.ReadAttributeCapacity(mOnSuccessCallback_7.Cancel(), mOnFailureCallback_7.Cancel()); } - static void OnFailureCallback_105(void * context, uint8_t status) + void OnFailureResponse_7(uint8_t status) { ThrowFailureResponse(); } + + void OnSuccessResponse_7(int16_t capacity) { - (static_cast(context))->OnFailureResponse_105(status); + VerifyOrReturn(CheckConstraintType("capacity", "", "int16")); + NextTest(); } +}; - static void OnSuccessCallback_105(void * context, chip::ByteSpan longCharString) +class Test_TC_TSUIC_1_1 : public TestCommand +{ +public: + Test_TC_TSUIC_1_1() : TestCommand("Test_TC_TSUIC_1_1"), mTestIndex(0) {} + + /////////// TestCommand Interface ///////// + void NextTest() override { - (static_cast(context))->OnSuccessResponse_105(longCharString); - } + CHIP_ERROR err = CHIP_NO_ERROR; + + if (0 == mTestIndex) + { + ChipLogProgress(chipTool, " **** Test Start: Test_TC_TSUIC_1_1\n"); + } + + if (mTestCount == mTestIndex) + { + ChipLogProgress(chipTool, " **** Test Complete: Test_TC_TSUIC_1_1\n"); + SetCommandExitStatus(CHIP_NO_ERROR); + return; + } + + // Ensure we increment mTestIndex before we start running the relevant + // command. That way if we lose the timeslice after we send the message + // but before our function call returns, we won't end up with an + // incorrect mTestIndex value observed when we get the response. + switch (mTestIndex++) + { + case 0: + ChipLogProgress(chipTool, + " ***** Test Step 0 : write the default values to mandatory global attribute: ClusterRevision\n"); + err = TestWriteTheDefaultValuesToMandatoryGlobalAttributeClusterRevision_0(); + break; + } - static void OnFailureCallback_106(void * context, uint8_t status) - { - (static_cast(context))->OnFailureResponse_106(status); + if (CHIP_NO_ERROR != err) + { + ChipLogError(chipTool, " ***** Test Failure: %s\n", chip::ErrorStr(err)); + SetCommandExitStatus(err); + } } - static void OnSuccessCallback_106(void * context, uint16_t count, uint8_t * listInt8u) - { - (static_cast(context))->OnSuccessResponse_106(count, listInt8u); - } +private: + std::atomic_uint16_t mTestIndex; + const uint16_t mTestCount = 1; - static void OnFailureCallback_107(void * context, uint8_t status) - { - (static_cast(context))->OnFailureResponse_107(status); - } + chip::Callback::Callback mOnFailureCallback_0{ OnFailureCallback_0, this }; + chip::Callback::Callback mOnSuccessCallback_0{ OnSuccessCallback_0, this }; - static void OnSuccessCallback_107(void * context, uint16_t count, chip::ByteSpan * listOctetString) + static void OnFailureCallback_0(void * context, uint8_t status) { - (static_cast(context))->OnSuccessResponse_107(count, listOctetString); + (static_cast(context))->OnFailureResponse_0(status); } - static void OnFailureCallback_108(void * context, uint8_t status) + static void OnSuccessCallback_0(void * context, uint16_t clusterRevision) { - (static_cast(context))->OnFailureResponse_108(status); + (static_cast(context))->OnSuccessResponse_0(clusterRevision); } - static void OnSuccessCallback_108(void * context, uint16_t count, _TestListStructOctet * listStructOctetString) - { - (static_cast(context))->OnSuccessResponse_108(count, listStructOctetString); - } + // + // Tests methods + // - static void OnFailureCallback_109(void * context, uint8_t status) + CHIP_ERROR TestWriteTheDefaultValuesToMandatoryGlobalAttributeClusterRevision_0() { - (static_cast(context))->OnFailureResponse_109(status); - } + chip::Controller::ThermostatUserInterfaceConfigurationClusterTest cluster; + cluster.Associate(mDevice, 1); - static void OnSuccessCallback_109(void * context, uint64_t epochUs) - { - (static_cast(context))->OnSuccessResponse_109(epochUs); - } + uint16_t clusterRevisionArgument = 2U; - static void OnFailureCallback_110(void * context, uint8_t status) - { - (static_cast(context))->OnFailureResponse_110(status); + return cluster.WriteAttributeClusterRevision(mOnSuccessCallback_0.Cancel(), mOnFailureCallback_0.Cancel(), + clusterRevisionArgument); } - static void OnSuccessCallback_110(void * context, uint64_t epochUs) - { - (static_cast(context))->OnSuccessResponse_110(epochUs); - } + void OnFailureResponse_0(uint8_t status) { NextTest(); } - static void OnFailureCallback_111(void * context, uint8_t status) - { - (static_cast(context))->OnFailureResponse_111(status); - } + void OnSuccessResponse_0(uint16_t clusterRevision) { ThrowSuccessResponse(); } +}; - static void OnSuccessCallback_111(void * context, uint64_t epochUs) - { - (static_cast(context))->OnSuccessResponse_111(epochUs); - } +class Test_TC_TSUIC_2_1 : public TestCommand +{ +public: + Test_TC_TSUIC_2_1() : TestCommand("Test_TC_TSUIC_2_1"), mTestIndex(0) {} - static void OnFailureCallback_112(void * context, uint8_t status) + /////////// TestCommand Interface ///////// + void NextTest() override { - (static_cast(context))->OnFailureResponse_112(status); - } + CHIP_ERROR err = CHIP_NO_ERROR; - static void OnSuccessCallback_112(void * context, uint64_t epochUs) - { - (static_cast(context))->OnSuccessResponse_112(epochUs); - } + if (0 == mTestIndex) + { + ChipLogProgress(chipTool, " **** Test Start: Test_TC_TSUIC_2_1\n"); + } - static void OnFailureCallback_113(void * context, uint8_t status) - { - (static_cast(context))->OnFailureResponse_113(status); - } + if (mTestCount == mTestIndex) + { + ChipLogProgress(chipTool, " **** Test Complete: Test_TC_TSUIC_2_1\n"); + SetCommandExitStatus(CHIP_NO_ERROR); + return; + } - static void OnSuccessCallback_113(void * context, uint64_t epochUs) - { - (static_cast(context))->OnSuccessResponse_113(epochUs); - } + // Ensure we increment mTestIndex before we start running the relevant + // command. That way if we lose the timeslice after we send the message + // but before our function call returns, we won't end up with an + // incorrect mTestIndex value observed when we get the response. + switch (mTestIndex++) + { + case 0: + ChipLogProgress(chipTool, " ***** Test Step 0 : read the mandatory attribute: TemperatureDisplayMode\n"); + err = TestReadTheMandatoryAttributeTemperatureDisplayMode_0(); + break; + case 1: + ChipLogProgress(chipTool, " ***** Test Step 1 : read the mandatory attribute: TemperatureDisplayMode\n"); + err = TestReadTheMandatoryAttributeTemperatureDisplayMode_1(); + break; + case 2: + ChipLogProgress(chipTool, " ***** Test Step 2 : write to the mandatory attribute: TemperatureDisplayMode\n"); + err = TestWriteToTheMandatoryAttributeTemperatureDisplayMode_2(); + break; + case 3: + ChipLogProgress(chipTool, " ***** Test Step 3 : read the mandatory attribute: TemperatureDisplayMode\n"); + err = TestReadTheMandatoryAttributeTemperatureDisplayMode_3(); + break; + case 4: + ChipLogProgress(chipTool, " ***** Test Step 4 : read the mandatory attribute: TemperatureDisplayMode\n"); + err = TestReadTheMandatoryAttributeTemperatureDisplayMode_4(); + break; + case 5: + ChipLogProgress(chipTool, " ***** Test Step 5 : read the mandatory attribute: KeypadLockout\n"); + err = TestReadTheMandatoryAttributeKeypadLockout_5(); + break; + case 6: + ChipLogProgress(chipTool, " ***** Test Step 6 : read the mandatory attribute: KeypadLockout\n"); + err = TestReadTheMandatoryAttributeKeypadLockout_6(); + break; + case 7: + ChipLogProgress(chipTool, " ***** Test Step 7 : write to the mandatory attribute: KeypadLockout\n"); + err = TestWriteToTheMandatoryAttributeKeypadLockout_7(); + break; + case 8: + ChipLogProgress(chipTool, " ***** Test Step 8 : read the mandatory attribute: KeypadLockout\n"); + err = TestReadTheMandatoryAttributeKeypadLockout_8(); + break; + case 9: + ChipLogProgress(chipTool, " ***** Test Step 9 : read the mandatory attribute: KeypadLockout\n"); + err = TestReadTheMandatoryAttributeKeypadLockout_9(); + break; + case 10: + ChipLogProgress(chipTool, " ***** Test Step 10 : read the optional attribute: ScheduleProgrammingVisibility\n"); + err = TestReadTheOptionalAttributeScheduleProgrammingVisibility_10(); + break; + case 11: + ChipLogProgress(chipTool, " ***** Test Step 11 : read the optional attribute: ScheduleProgrammingVisibility\n"); + err = TestReadTheOptionalAttributeScheduleProgrammingVisibility_11(); + break; + case 12: + ChipLogProgress(chipTool, " ***** Test Step 12 : write to the mandatory attribute: ScheduleProgrammingVisibility\n"); + err = TestWriteToTheMandatoryAttributeScheduleProgrammingVisibility_12(); + break; + case 13: + ChipLogProgress(chipTool, " ***** Test Step 13 : read the optional attribute: ScheduleProgrammingVisibility\n"); + err = TestReadTheOptionalAttributeScheduleProgrammingVisibility_13(); + break; + case 14: + ChipLogProgress(chipTool, " ***** Test Step 14 : read the optional attribute: ScheduleProgrammingVisibility\n"); + err = TestReadTheOptionalAttributeScheduleProgrammingVisibility_14(); + break; + } - static void OnFailureCallback_114(void * context, uint8_t status) - { - (static_cast(context))->OnFailureResponse_114(status); + if (CHIP_NO_ERROR != err) + { + ChipLogError(chipTool, " ***** Test Failure: %s\n", chip::ErrorStr(err)); + SetCommandExitStatus(err); + } } - static void OnSuccessCallback_114(void * context, uint32_t epochS) - { - (static_cast(context))->OnSuccessResponse_114(epochS); - } +private: + std::atomic_uint16_t mTestIndex; + const uint16_t mTestCount = 15; - static void OnFailureCallback_115(void * context, uint8_t status) - { - (static_cast(context))->OnFailureResponse_115(status); - } + chip::Callback::Callback mOnFailureCallback_0{ OnFailureCallback_0, this }; + chip::Callback::Callback mOnSuccessCallback_0{ OnSuccessCallback_0, + this }; + chip::Callback::Callback mOnFailureCallback_1{ OnFailureCallback_1, this }; + chip::Callback::Callback mOnSuccessCallback_1{ OnSuccessCallback_1, + this }; + chip::Callback::Callback mOnFailureCallback_2{ OnFailureCallback_2, this }; + chip::Callback::Callback mOnSuccessCallback_2{ OnSuccessCallback_2, + this }; + chip::Callback::Callback mOnFailureCallback_3{ OnFailureCallback_3, this }; + chip::Callback::Callback mOnSuccessCallback_3{ OnSuccessCallback_3, + this }; + chip::Callback::Callback mOnFailureCallback_4{ OnFailureCallback_4, this }; + chip::Callback::Callback mOnSuccessCallback_4{ OnSuccessCallback_4, + this }; + chip::Callback::Callback mOnFailureCallback_5{ OnFailureCallback_5, this }; + chip::Callback::Callback mOnSuccessCallback_5{ OnSuccessCallback_5, this }; + chip::Callback::Callback mOnFailureCallback_6{ OnFailureCallback_6, this }; + chip::Callback::Callback mOnSuccessCallback_6{ OnSuccessCallback_6, this }; + chip::Callback::Callback mOnFailureCallback_7{ OnFailureCallback_7, this }; + chip::Callback::Callback mOnSuccessCallback_7{ OnSuccessCallback_7, this }; + chip::Callback::Callback mOnFailureCallback_8{ OnFailureCallback_8, this }; + chip::Callback::Callback mOnSuccessCallback_8{ OnSuccessCallback_8, this }; + chip::Callback::Callback mOnFailureCallback_9{ OnFailureCallback_9, this }; + chip::Callback::Callback mOnSuccessCallback_9{ OnSuccessCallback_9, this }; + chip::Callback::Callback mOnFailureCallback_10{ OnFailureCallback_10, this }; + chip::Callback::Callback mOnSuccessCallback_10{ + OnSuccessCallback_10, this + }; + chip::Callback::Callback mOnFailureCallback_11{ OnFailureCallback_11, this }; + chip::Callback::Callback mOnSuccessCallback_11{ + OnSuccessCallback_11, this + }; + chip::Callback::Callback mOnFailureCallback_12{ OnFailureCallback_12, this }; + chip::Callback::Callback mOnSuccessCallback_12{ + OnSuccessCallback_12, this + }; + chip::Callback::Callback mOnFailureCallback_13{ OnFailureCallback_13, this }; + chip::Callback::Callback mOnSuccessCallback_13{ + OnSuccessCallback_13, this + }; + chip::Callback::Callback mOnFailureCallback_14{ OnFailureCallback_14, this }; + chip::Callback::Callback mOnSuccessCallback_14{ + OnSuccessCallback_14, this + }; - static void OnSuccessCallback_115(void * context, uint32_t epochS) + static void OnFailureCallback_0(void * context, uint8_t status) { - (static_cast(context))->OnSuccessResponse_115(epochS); + (static_cast(context))->OnFailureResponse_0(status); } - static void OnFailureCallback_116(void * context, uint8_t status) + static void OnSuccessCallback_0(void * context, uint8_t temperatureDisplayMode) { - (static_cast(context))->OnFailureResponse_116(status); + (static_cast(context))->OnSuccessResponse_0(temperatureDisplayMode); } - static void OnSuccessCallback_116(void * context, uint32_t epochS) + static void OnFailureCallback_1(void * context, uint8_t status) { - (static_cast(context))->OnSuccessResponse_116(epochS); + (static_cast(context))->OnFailureResponse_1(status); } - static void OnFailureCallback_117(void * context, uint8_t status) + static void OnSuccessCallback_1(void * context, uint8_t temperatureDisplayMode) { - (static_cast(context))->OnFailureResponse_117(status); + (static_cast(context))->OnSuccessResponse_1(temperatureDisplayMode); } - static void OnSuccessCallback_117(void * context, uint32_t epochS) + static void OnFailureCallback_2(void * context, uint8_t status) { - (static_cast(context))->OnSuccessResponse_117(epochS); + (static_cast(context))->OnFailureResponse_2(status); } - static void OnFailureCallback_118(void * context, uint8_t status) + static void OnSuccessCallback_2(void * context, uint8_t temperatureDisplayMode) { - (static_cast(context))->OnFailureResponse_118(status); + (static_cast(context))->OnSuccessResponse_2(temperatureDisplayMode); } - static void OnSuccessCallback_118(void * context, uint32_t epochS) + static void OnFailureCallback_3(void * context, uint8_t status) { - (static_cast(context))->OnSuccessResponse_118(epochS); + (static_cast(context))->OnFailureResponse_3(status); } - static void OnFailureCallback_119(void * context, uint8_t status) + static void OnSuccessCallback_3(void * context, uint8_t temperatureDisplayMode) { - (static_cast(context))->OnFailureResponse_119(status); + (static_cast(context))->OnSuccessResponse_3(temperatureDisplayMode); } - static void OnSuccessCallback_119(void * context, bool unsupported) + static void OnFailureCallback_4(void * context, uint8_t status) { - (static_cast(context))->OnSuccessResponse_119(unsupported); + (static_cast(context))->OnFailureResponse_4(status); } - static void OnFailureCallback_120(void * context, uint8_t status) + static void OnSuccessCallback_4(void * context, uint8_t temperatureDisplayMode) { - (static_cast(context))->OnFailureResponse_120(status); + (static_cast(context))->OnSuccessResponse_4(temperatureDisplayMode); } - static void OnSuccessCallback_120(void * context, bool unsupported) + static void OnFailureCallback_5(void * context, uint8_t status) { - (static_cast(context))->OnSuccessResponse_120(unsupported); + (static_cast(context))->OnFailureResponse_5(status); } - static void OnFailureCallback_121(void * context, uint8_t status) + static void OnSuccessCallback_5(void * context, uint8_t keypadLockout) { - (static_cast(context))->OnFailureResponse_121(status); + (static_cast(context))->OnSuccessResponse_5(keypadLockout); } - static void OnSuccessCallback_121(void * context) { (static_cast(context))->OnSuccessResponse_121(); } - - // - // Tests methods - // - - CHIP_ERROR TestSendTestCommand_0() + static void OnFailureCallback_6(void * context, uint8_t status) { - chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevice, 1); - - return cluster.Test(mOnSuccessCallback_0.Cancel(), mOnFailureCallback_0.Cancel()); + (static_cast(context))->OnFailureResponse_6(status); } - void OnFailureResponse_0(uint8_t status) { ThrowFailureResponse(); } - - void OnSuccessResponse_0() { NextTest(); } - - CHIP_ERROR TestSendTestNotHandledCommand_1() + static void OnSuccessCallback_6(void * context, uint8_t keypadLockout) { - chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevice, 1); - - return cluster.TestNotHandled(mOnSuccessCallback_1.Cancel(), mOnFailureCallback_1.Cancel()); + (static_cast(context))->OnSuccessResponse_6(keypadLockout); } - void OnFailureResponse_1(uint8_t status) { NextTest(); } - - void OnSuccessResponse_1() { ThrowSuccessResponse(); } - - CHIP_ERROR TestSendTestSpecificCommand_2() + static void OnFailureCallback_7(void * context, uint8_t status) { - chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevice, 1); - - return cluster.TestSpecific(mOnSuccessCallback_2.Cancel(), mOnFailureCallback_2.Cancel()); + (static_cast(context))->OnFailureResponse_7(status); } - void OnFailureResponse_2(uint8_t status) { ThrowFailureResponse(); } - - void OnSuccessResponse_2(uint8_t returnValue) + static void OnSuccessCallback_7(void * context, uint8_t keypadLockout) { - VerifyOrReturn(CheckValue("returnValue", returnValue, 7)); - NextTest(); + (static_cast(context))->OnSuccessResponse_7(keypadLockout); } - CHIP_ERROR TestSendTestAddArgumentsCommand_3() + static void OnFailureCallback_8(void * context, uint8_t status) { - chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevice, 1); - - uint8_t arg1Argument = 3; - uint8_t arg2Argument = 17; - - return cluster.TestAddArguments(mOnSuccessCallback_3.Cancel(), mOnFailureCallback_3.Cancel(), arg1Argument, arg2Argument); + (static_cast(context))->OnFailureResponse_8(status); } - void OnFailureResponse_3(uint8_t status) { ThrowFailureResponse(); } - - void OnSuccessResponse_3(uint8_t returnValue) + static void OnSuccessCallback_8(void * context, uint8_t keypadLockout) { - VerifyOrReturn(CheckValue("returnValue", returnValue, 20)); - NextTest(); + (static_cast(context))->OnSuccessResponse_8(keypadLockout); } - CHIP_ERROR TestSendFailingTestAddArgumentsCommand_4() + static void OnFailureCallback_9(void * context, uint8_t status) { - chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevice, 1); - - uint8_t arg1Argument = 250; - uint8_t arg2Argument = 6; - - return cluster.TestAddArguments(mOnSuccessCallback_4.Cancel(), mOnFailureCallback_4.Cancel(), arg1Argument, arg2Argument); + (static_cast(context))->OnFailureResponse_9(status); } - void OnFailureResponse_4(uint8_t status) { NextTest(); } - - void OnSuccessResponse_4(uint8_t returnValue) { ThrowSuccessResponse(); } - - CHIP_ERROR TestReadAttributeBooleanDefaultValue_5() + static void OnSuccessCallback_9(void * context, uint8_t keypadLockout) { - chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevice, 1); - - return cluster.ReadAttributeBoolean(mOnSuccessCallback_5.Cancel(), mOnFailureCallback_5.Cancel()); + (static_cast(context))->OnSuccessResponse_9(keypadLockout); } - void OnFailureResponse_5(uint8_t status) { ThrowFailureResponse(); } - - void OnSuccessResponse_5(bool boolean) + static void OnFailureCallback_10(void * context, uint8_t status) { - VerifyOrReturn(CheckValue("boolean", boolean, 0)); - NextTest(); + (static_cast(context))->OnFailureResponse_10(status); } - CHIP_ERROR TestWriteAttributeBooleanTrue_6() + static void OnSuccessCallback_10(void * context, uint8_t scheduleProgrammingVisibility) { - chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevice, 1); - - bool booleanArgument = 1; - - return cluster.WriteAttributeBoolean(mOnSuccessCallback_6.Cancel(), mOnFailureCallback_6.Cancel(), booleanArgument); + (static_cast(context))->OnSuccessResponse_10(scheduleProgrammingVisibility); } - void OnFailureResponse_6(uint8_t status) { ThrowFailureResponse(); } - - void OnSuccessResponse_6(bool boolean) { NextTest(); } - - CHIP_ERROR TestReadAttributeBooleanTrue_7() + static void OnFailureCallback_11(void * context, uint8_t status) { - chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevice, 1); - - return cluster.ReadAttributeBoolean(mOnSuccessCallback_7.Cancel(), mOnFailureCallback_7.Cancel()); + (static_cast(context))->OnFailureResponse_11(status); } - void OnFailureResponse_7(uint8_t status) { ThrowFailureResponse(); } - - void OnSuccessResponse_7(bool boolean) + static void OnSuccessCallback_11(void * context, uint8_t scheduleProgrammingVisibility) { - VerifyOrReturn(CheckValue("boolean", boolean, 1)); - NextTest(); + (static_cast(context))->OnSuccessResponse_11(scheduleProgrammingVisibility); } - CHIP_ERROR TestWriteAttributeBooleanFalse_8() + static void OnFailureCallback_12(void * context, uint8_t status) { - chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevice, 1); - - bool booleanArgument = 0; - - return cluster.WriteAttributeBoolean(mOnSuccessCallback_8.Cancel(), mOnFailureCallback_8.Cancel(), booleanArgument); + (static_cast(context))->OnFailureResponse_12(status); } - void OnFailureResponse_8(uint8_t status) { ThrowFailureResponse(); } - - void OnSuccessResponse_8(bool boolean) { NextTest(); } - - CHIP_ERROR TestReadAttributeBooleanFalse_9() + static void OnSuccessCallback_12(void * context, uint8_t scheduleProgrammingVisibility) { - chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevice, 1); - - return cluster.ReadAttributeBoolean(mOnSuccessCallback_9.Cancel(), mOnFailureCallback_9.Cancel()); + (static_cast(context))->OnSuccessResponse_12(scheduleProgrammingVisibility); } - void OnFailureResponse_9(uint8_t status) { ThrowFailureResponse(); } - - void OnSuccessResponse_9(bool boolean) + static void OnFailureCallback_13(void * context, uint8_t status) { - VerifyOrReturn(CheckValue("boolean", boolean, 0)); - NextTest(); + (static_cast(context))->OnFailureResponse_13(status); } - CHIP_ERROR TestReadAttributeBitmap8DefaultValue_10() + static void OnSuccessCallback_13(void * context, uint8_t scheduleProgrammingVisibility) { - chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevice, 1); - - return cluster.ReadAttributeBitmap8(mOnSuccessCallback_10.Cancel(), mOnFailureCallback_10.Cancel()); + (static_cast(context))->OnSuccessResponse_13(scheduleProgrammingVisibility); } - void OnFailureResponse_10(uint8_t status) { ThrowFailureResponse(); } + static void OnFailureCallback_14(void * context, uint8_t status) + { + (static_cast(context))->OnFailureResponse_14(status); + } - void OnSuccessResponse_10(uint8_t bitmap8) + static void OnSuccessCallback_14(void * context, uint8_t scheduleProgrammingVisibility) { - VerifyOrReturn(CheckValue("bitmap8", bitmap8, 0)); - NextTest(); + (static_cast(context))->OnSuccessResponse_14(scheduleProgrammingVisibility); } - CHIP_ERROR TestWriteAttributeBitmap8MaxValue_11() + // + // Tests methods + // + + CHIP_ERROR TestReadTheMandatoryAttributeTemperatureDisplayMode_0() { - chip::Controller::TestClusterClusterTest cluster; + chip::Controller::ThermostatUserInterfaceConfigurationClusterTest cluster; cluster.Associate(mDevice, 1); - uint8_t bitmap8Argument = 255; - - return cluster.WriteAttributeBitmap8(mOnSuccessCallback_11.Cancel(), mOnFailureCallback_11.Cancel(), bitmap8Argument); + return cluster.ReadAttributeTemperatureDisplayMode(mOnSuccessCallback_0.Cancel(), mOnFailureCallback_0.Cancel()); } - void OnFailureResponse_11(uint8_t status) { ThrowFailureResponse(); } + void OnFailureResponse_0(uint8_t status) { ThrowFailureResponse(); } - void OnSuccessResponse_11(uint8_t bitmap8) { NextTest(); } + void OnSuccessResponse_0(uint8_t temperatureDisplayMode) + { + VerifyOrReturn(CheckValue("temperatureDisplayMode", temperatureDisplayMode, 0)); + NextTest(); + } - CHIP_ERROR TestReadAttributeBitmap8MaxValue_12() + CHIP_ERROR TestReadTheMandatoryAttributeTemperatureDisplayMode_1() { - chip::Controller::TestClusterClusterTest cluster; + chip::Controller::ThermostatUserInterfaceConfigurationClusterTest cluster; cluster.Associate(mDevice, 1); - return cluster.ReadAttributeBitmap8(mOnSuccessCallback_12.Cancel(), mOnFailureCallback_12.Cancel()); + return cluster.ReadAttributeTemperatureDisplayMode(mOnSuccessCallback_1.Cancel(), mOnFailureCallback_1.Cancel()); } - void OnFailureResponse_12(uint8_t status) { ThrowFailureResponse(); } + void OnFailureResponse_1(uint8_t status) { ThrowFailureResponse(); } - void OnSuccessResponse_12(uint8_t bitmap8) + void OnSuccessResponse_1(uint8_t temperatureDisplayMode) { - VerifyOrReturn(CheckValue("bitmap8", bitmap8, 255)); + VerifyOrReturn(CheckConstraintType("temperatureDisplayMode", "", "enum8")); NextTest(); } - CHIP_ERROR TestWriteAttributeBitmap8MinValue_13() + CHIP_ERROR TestWriteToTheMandatoryAttributeTemperatureDisplayMode_2() { - chip::Controller::TestClusterClusterTest cluster; + chip::Controller::ThermostatUserInterfaceConfigurationClusterTest cluster; cluster.Associate(mDevice, 1); - uint8_t bitmap8Argument = 0; + uint8_t temperatureDisplayModeArgument = 0; - return cluster.WriteAttributeBitmap8(mOnSuccessCallback_13.Cancel(), mOnFailureCallback_13.Cancel(), bitmap8Argument); + return cluster.WriteAttributeTemperatureDisplayMode(mOnSuccessCallback_2.Cancel(), mOnFailureCallback_2.Cancel(), + temperatureDisplayModeArgument); } - void OnFailureResponse_13(uint8_t status) { ThrowFailureResponse(); } + void OnFailureResponse_2(uint8_t status) { ThrowFailureResponse(); } - void OnSuccessResponse_13(uint8_t bitmap8) { NextTest(); } + void OnSuccessResponse_2(uint8_t temperatureDisplayMode) { NextTest(); } - CHIP_ERROR TestReadAttributeBitmap8MinValue_14() + CHIP_ERROR TestReadTheMandatoryAttributeTemperatureDisplayMode_3() { - chip::Controller::TestClusterClusterTest cluster; + chip::Controller::ThermostatUserInterfaceConfigurationClusterTest cluster; cluster.Associate(mDevice, 1); - return cluster.ReadAttributeBitmap8(mOnSuccessCallback_14.Cancel(), mOnFailureCallback_14.Cancel()); + return cluster.ReadAttributeTemperatureDisplayMode(mOnSuccessCallback_3.Cancel(), mOnFailureCallback_3.Cancel()); } - void OnFailureResponse_14(uint8_t status) { ThrowFailureResponse(); } + void OnFailureResponse_3(uint8_t status) { ThrowFailureResponse(); } - void OnSuccessResponse_14(uint8_t bitmap8) + void OnSuccessResponse_3(uint8_t temperatureDisplayMode) { - VerifyOrReturn(CheckValue("bitmap8", bitmap8, 0)); + VerifyOrReturn(CheckValue("temperatureDisplayMode", temperatureDisplayMode, 0)); NextTest(); } - CHIP_ERROR TestReadAttributeBitmap16DefaultValue_15() + CHIP_ERROR TestReadTheMandatoryAttributeTemperatureDisplayMode_4() { - chip::Controller::TestClusterClusterTest cluster; + chip::Controller::ThermostatUserInterfaceConfigurationClusterTest cluster; cluster.Associate(mDevice, 1); - return cluster.ReadAttributeBitmap16(mOnSuccessCallback_15.Cancel(), mOnFailureCallback_15.Cancel()); + return cluster.ReadAttributeTemperatureDisplayMode(mOnSuccessCallback_4.Cancel(), mOnFailureCallback_4.Cancel()); } - void OnFailureResponse_15(uint8_t status) { ThrowFailureResponse(); } + void OnFailureResponse_4(uint8_t status) { ThrowFailureResponse(); } - void OnSuccessResponse_15(uint16_t bitmap16) + void OnSuccessResponse_4(uint8_t temperatureDisplayMode) { - VerifyOrReturn(CheckValue("bitmap16", bitmap16, 0U)); + VerifyOrReturn(CheckConstraintType("temperatureDisplayMode", "", "enum8")); NextTest(); } - CHIP_ERROR TestWriteAttributeBitmap16MaxValue_16() + CHIP_ERROR TestReadTheMandatoryAttributeKeypadLockout_5() { - chip::Controller::TestClusterClusterTest cluster; + chip::Controller::ThermostatUserInterfaceConfigurationClusterTest cluster; cluster.Associate(mDevice, 1); - uint16_t bitmap16Argument = 65535U; - - return cluster.WriteAttributeBitmap16(mOnSuccessCallback_16.Cancel(), mOnFailureCallback_16.Cancel(), bitmap16Argument); + return cluster.ReadAttributeKeypadLockout(mOnSuccessCallback_5.Cancel(), mOnFailureCallback_5.Cancel()); } - void OnFailureResponse_16(uint8_t status) { ThrowFailureResponse(); } + void OnFailureResponse_5(uint8_t status) { ThrowFailureResponse(); } - void OnSuccessResponse_16(uint16_t bitmap16) { NextTest(); } + void OnSuccessResponse_5(uint8_t keypadLockout) + { + VerifyOrReturn(CheckValue("keypadLockout", keypadLockout, 0)); + NextTest(); + } - CHIP_ERROR TestReadAttributeBitmap16MaxValue_17() + CHIP_ERROR TestReadTheMandatoryAttributeKeypadLockout_6() { - chip::Controller::TestClusterClusterTest cluster; + chip::Controller::ThermostatUserInterfaceConfigurationClusterTest cluster; cluster.Associate(mDevice, 1); - return cluster.ReadAttributeBitmap16(mOnSuccessCallback_17.Cancel(), mOnFailureCallback_17.Cancel()); + return cluster.ReadAttributeKeypadLockout(mOnSuccessCallback_6.Cancel(), mOnFailureCallback_6.Cancel()); } - void OnFailureResponse_17(uint8_t status) { ThrowFailureResponse(); } + void OnFailureResponse_6(uint8_t status) { ThrowFailureResponse(); } - void OnSuccessResponse_17(uint16_t bitmap16) + void OnSuccessResponse_6(uint8_t keypadLockout) { - VerifyOrReturn(CheckValue("bitmap16", bitmap16, 65535U)); + VerifyOrReturn(CheckConstraintType("keypadLockout", "", "enum8")); NextTest(); } - CHIP_ERROR TestWriteAttributeBitmap16MinValue_18() + CHIP_ERROR TestWriteToTheMandatoryAttributeKeypadLockout_7() { - chip::Controller::TestClusterClusterTest cluster; + chip::Controller::ThermostatUserInterfaceConfigurationClusterTest cluster; cluster.Associate(mDevice, 1); - uint16_t bitmap16Argument = 0U; + uint8_t keypadLockoutArgument = 0; - return cluster.WriteAttributeBitmap16(mOnSuccessCallback_18.Cancel(), mOnFailureCallback_18.Cancel(), bitmap16Argument); + return cluster.WriteAttributeKeypadLockout(mOnSuccessCallback_7.Cancel(), mOnFailureCallback_7.Cancel(), + keypadLockoutArgument); } - void OnFailureResponse_18(uint8_t status) { ThrowFailureResponse(); } + void OnFailureResponse_7(uint8_t status) { ThrowFailureResponse(); } - void OnSuccessResponse_18(uint16_t bitmap16) { NextTest(); } + void OnSuccessResponse_7(uint8_t keypadLockout) { NextTest(); } - CHIP_ERROR TestReadAttributeBitmap16MinValue_19() + CHIP_ERROR TestReadTheMandatoryAttributeKeypadLockout_8() { - chip::Controller::TestClusterClusterTest cluster; + chip::Controller::ThermostatUserInterfaceConfigurationClusterTest cluster; cluster.Associate(mDevice, 1); - return cluster.ReadAttributeBitmap16(mOnSuccessCallback_19.Cancel(), mOnFailureCallback_19.Cancel()); + return cluster.ReadAttributeKeypadLockout(mOnSuccessCallback_8.Cancel(), mOnFailureCallback_8.Cancel()); } - void OnFailureResponse_19(uint8_t status) { ThrowFailureResponse(); } + void OnFailureResponse_8(uint8_t status) { ThrowFailureResponse(); } - void OnSuccessResponse_19(uint16_t bitmap16) + void OnSuccessResponse_8(uint8_t keypadLockout) { - VerifyOrReturn(CheckValue("bitmap16", bitmap16, 0U)); + VerifyOrReturn(CheckValue("keypadLockout", keypadLockout, 0)); NextTest(); } - CHIP_ERROR TestReadAttributeBitmap32DefaultValue_20() + CHIP_ERROR TestReadTheMandatoryAttributeKeypadLockout_9() { - chip::Controller::TestClusterClusterTest cluster; + chip::Controller::ThermostatUserInterfaceConfigurationClusterTest cluster; cluster.Associate(mDevice, 1); - return cluster.ReadAttributeBitmap32(mOnSuccessCallback_20.Cancel(), mOnFailureCallback_20.Cancel()); + return cluster.ReadAttributeKeypadLockout(mOnSuccessCallback_9.Cancel(), mOnFailureCallback_9.Cancel()); } - void OnFailureResponse_20(uint8_t status) { ThrowFailureResponse(); } + void OnFailureResponse_9(uint8_t status) { ThrowFailureResponse(); } - void OnSuccessResponse_20(uint32_t bitmap32) + void OnSuccessResponse_9(uint8_t keypadLockout) { - VerifyOrReturn(CheckValue("bitmap32", bitmap32, 0UL)); + VerifyOrReturn(CheckConstraintType("keypadLockout", "", "enum8")); NextTest(); } - CHIP_ERROR TestWriteAttributeBitmap32MaxValue_21() + CHIP_ERROR TestReadTheOptionalAttributeScheduleProgrammingVisibility_10() { - chip::Controller::TestClusterClusterTest cluster; + chip::Controller::ThermostatUserInterfaceConfigurationClusterTest cluster; cluster.Associate(mDevice, 1); - uint32_t bitmap32Argument = 4294967295UL; - - return cluster.WriteAttributeBitmap32(mOnSuccessCallback_21.Cancel(), mOnFailureCallback_21.Cancel(), bitmap32Argument); + return cluster.ReadAttributeScheduleProgrammingVisibility(mOnSuccessCallback_10.Cancel(), mOnFailureCallback_10.Cancel()); } - void OnFailureResponse_21(uint8_t status) { ThrowFailureResponse(); } + void OnFailureResponse_10(uint8_t status) { ThrowFailureResponse(); } - void OnSuccessResponse_21(uint32_t bitmap32) { NextTest(); } + void OnSuccessResponse_10(uint8_t scheduleProgrammingVisibility) + { + VerifyOrReturn(CheckValue("scheduleProgrammingVisibility", scheduleProgrammingVisibility, 0)); + NextTest(); + } - CHIP_ERROR TestReadAttributeBitmap32MaxValue_22() + CHIP_ERROR TestReadTheOptionalAttributeScheduleProgrammingVisibility_11() { - chip::Controller::TestClusterClusterTest cluster; + chip::Controller::ThermostatUserInterfaceConfigurationClusterTest cluster; cluster.Associate(mDevice, 1); - return cluster.ReadAttributeBitmap32(mOnSuccessCallback_22.Cancel(), mOnFailureCallback_22.Cancel()); + return cluster.ReadAttributeScheduleProgrammingVisibility(mOnSuccessCallback_11.Cancel(), mOnFailureCallback_11.Cancel()); } - void OnFailureResponse_22(uint8_t status) { ThrowFailureResponse(); } + void OnFailureResponse_11(uint8_t status) { ThrowFailureResponse(); } - void OnSuccessResponse_22(uint32_t bitmap32) + void OnSuccessResponse_11(uint8_t scheduleProgrammingVisibility) { - VerifyOrReturn(CheckValue("bitmap32", bitmap32, 4294967295UL)); + VerifyOrReturn(CheckConstraintType("scheduleProgrammingVisibility", "", "enum8")); NextTest(); } - CHIP_ERROR TestWriteAttributeBitmap32MinValue_23() + CHIP_ERROR TestWriteToTheMandatoryAttributeScheduleProgrammingVisibility_12() { - chip::Controller::TestClusterClusterTest cluster; + chip::Controller::ThermostatUserInterfaceConfigurationClusterTest cluster; cluster.Associate(mDevice, 1); - uint32_t bitmap32Argument = 0UL; + uint8_t scheduleProgrammingVisibilityArgument = 0; - return cluster.WriteAttributeBitmap32(mOnSuccessCallback_23.Cancel(), mOnFailureCallback_23.Cancel(), bitmap32Argument); + return cluster.WriteAttributeScheduleProgrammingVisibility(mOnSuccessCallback_12.Cancel(), mOnFailureCallback_12.Cancel(), + scheduleProgrammingVisibilityArgument); } - void OnFailureResponse_23(uint8_t status) { ThrowFailureResponse(); } + void OnFailureResponse_12(uint8_t status) { ThrowFailureResponse(); } - void OnSuccessResponse_23(uint32_t bitmap32) { NextTest(); } + void OnSuccessResponse_12(uint8_t scheduleProgrammingVisibility) { NextTest(); } - CHIP_ERROR TestReadAttributeBitmap32MinValue_24() + CHIP_ERROR TestReadTheOptionalAttributeScheduleProgrammingVisibility_13() { - chip::Controller::TestClusterClusterTest cluster; + chip::Controller::ThermostatUserInterfaceConfigurationClusterTest cluster; cluster.Associate(mDevice, 1); - return cluster.ReadAttributeBitmap32(mOnSuccessCallback_24.Cancel(), mOnFailureCallback_24.Cancel()); + return cluster.ReadAttributeScheduleProgrammingVisibility(mOnSuccessCallback_13.Cancel(), mOnFailureCallback_13.Cancel()); } - void OnFailureResponse_24(uint8_t status) { ThrowFailureResponse(); } + void OnFailureResponse_13(uint8_t status) { ThrowFailureResponse(); } - void OnSuccessResponse_24(uint32_t bitmap32) + void OnSuccessResponse_13(uint8_t scheduleProgrammingVisibility) { - VerifyOrReturn(CheckValue("bitmap32", bitmap32, 0UL)); + VerifyOrReturn(CheckValue("scheduleProgrammingVisibility", scheduleProgrammingVisibility, 0)); NextTest(); } - CHIP_ERROR TestReadAttributeBitmap64DefaultValue_25() + CHIP_ERROR TestReadTheOptionalAttributeScheduleProgrammingVisibility_14() { - chip::Controller::TestClusterClusterTest cluster; + chip::Controller::ThermostatUserInterfaceConfigurationClusterTest cluster; cluster.Associate(mDevice, 1); - return cluster.ReadAttributeBitmap64(mOnSuccessCallback_25.Cancel(), mOnFailureCallback_25.Cancel()); + return cluster.ReadAttributeScheduleProgrammingVisibility(mOnSuccessCallback_14.Cancel(), mOnFailureCallback_14.Cancel()); } - void OnFailureResponse_25(uint8_t status) { ThrowFailureResponse(); } + void OnFailureResponse_14(uint8_t status) { ThrowFailureResponse(); } - void OnSuccessResponse_25(uint64_t bitmap64) + void OnSuccessResponse_14(uint8_t scheduleProgrammingVisibility) { - VerifyOrReturn(CheckValue("bitmap64", bitmap64, 0ULL)); + VerifyOrReturn(CheckConstraintType("scheduleProgrammingVisibility", "", "enum8")); NextTest(); } +}; - CHIP_ERROR TestWriteAttributeBitmap64MaxValue_26() +class Test_TC_DIAGTH_1_1 : public TestCommand +{ +public: + Test_TC_DIAGTH_1_1() : TestCommand("Test_TC_DIAGTH_1_1"), mTestIndex(0) {} + + /////////// TestCommand Interface ///////// + void NextTest() override { - chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevice, 1); + CHIP_ERROR err = CHIP_NO_ERROR; - uint64_t bitmap64Argument = 18446744073709551615ULL; + if (0 == mTestIndex) + { + ChipLogProgress(chipTool, " **** Test Start: Test_TC_DIAGTH_1_1\n"); + } - return cluster.WriteAttributeBitmap64(mOnSuccessCallback_26.Cancel(), mOnFailureCallback_26.Cancel(), bitmap64Argument); + if (mTestCount == mTestIndex) + { + ChipLogProgress(chipTool, " **** Test Complete: Test_TC_DIAGTH_1_1\n"); + SetCommandExitStatus(CHIP_NO_ERROR); + return; + } + + // Ensure we increment mTestIndex before we start running the relevant + // command. That way if we lose the timeslice after we send the message + // but before our function call returns, we won't end up with an + // incorrect mTestIndex value observed when we get the response. + switch (mTestIndex++) + { + case 0: + ChipLogProgress(chipTool, " ***** Test Step 0 : read the global attribute: ClusterRevision\n"); + err = TestReadTheGlobalAttributeClusterRevision_0(); + break; + case 1: + ChipLogProgress(chipTool, + " ***** Test Step 1 : write the default values to mandatory global attribute: ClusterRevision\n"); + err = TestWriteTheDefaultValuesToMandatoryGlobalAttributeClusterRevision_1(); + break; + case 2: + ChipLogProgress(chipTool, " ***** Test Step 2 : reads back global attribute: ClusterRevision\n"); + err = TestReadsBackGlobalAttributeClusterRevision_2(); + break; + } + + if (CHIP_NO_ERROR != err) + { + ChipLogError(chipTool, " ***** Test Failure: %s\n", chip::ErrorStr(err)); + SetCommandExitStatus(err); + } } - void OnFailureResponse_26(uint8_t status) { ThrowFailureResponse(); } +private: + std::atomic_uint16_t mTestIndex; + const uint16_t mTestCount = 3; - void OnSuccessResponse_26(uint64_t bitmap64) { NextTest(); } + chip::Callback::Callback mOnFailureCallback_0{ OnFailureCallback_0, this }; + chip::Callback::Callback mOnSuccessCallback_0{ OnSuccessCallback_0, this }; + chip::Callback::Callback mOnFailureCallback_1{ OnFailureCallback_1, this }; + chip::Callback::Callback mOnSuccessCallback_1{ OnSuccessCallback_1, this }; + chip::Callback::Callback mOnFailureCallback_2{ OnFailureCallback_2, this }; + chip::Callback::Callback mOnSuccessCallback_2{ OnSuccessCallback_2, this }; - CHIP_ERROR TestReadAttributeBitmap64MaxValue_27() + static void OnFailureCallback_0(void * context, uint8_t status) { - chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevice, 1); - - return cluster.ReadAttributeBitmap64(mOnSuccessCallback_27.Cancel(), mOnFailureCallback_27.Cancel()); + (static_cast(context))->OnFailureResponse_0(status); } - void OnFailureResponse_27(uint8_t status) { ThrowFailureResponse(); } - - void OnSuccessResponse_27(uint64_t bitmap64) + static void OnSuccessCallback_0(void * context, uint16_t clusterRevision) { - VerifyOrReturn(CheckValue("bitmap64", bitmap64, 18446744073709551615ULL)); - NextTest(); + (static_cast(context))->OnSuccessResponse_0(clusterRevision); } - CHIP_ERROR TestWriteAttributeBitmap64MinValue_28() + static void OnFailureCallback_1(void * context, uint8_t status) { - chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevice, 1); - - uint64_t bitmap64Argument = 0ULL; - - return cluster.WriteAttributeBitmap64(mOnSuccessCallback_28.Cancel(), mOnFailureCallback_28.Cancel(), bitmap64Argument); + (static_cast(context))->OnFailureResponse_1(status); } - void OnFailureResponse_28(uint8_t status) { ThrowFailureResponse(); } - - void OnSuccessResponse_28(uint64_t bitmap64) { NextTest(); } - - CHIP_ERROR TestReadAttributeBitmap64MinValue_29() + static void OnSuccessCallback_1(void * context, uint16_t clusterRevision) { - chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevice, 1); - - return cluster.ReadAttributeBitmap64(mOnSuccessCallback_29.Cancel(), mOnFailureCallback_29.Cancel()); + (static_cast(context))->OnSuccessResponse_1(clusterRevision); } - void OnFailureResponse_29(uint8_t status) { ThrowFailureResponse(); } + static void OnFailureCallback_2(void * context, uint8_t status) + { + (static_cast(context))->OnFailureResponse_2(status); + } - void OnSuccessResponse_29(uint64_t bitmap64) + static void OnSuccessCallback_2(void * context, uint16_t clusterRevision) { - VerifyOrReturn(CheckValue("bitmap64", bitmap64, 0ULL)); - NextTest(); + (static_cast(context))->OnSuccessResponse_2(clusterRevision); } - CHIP_ERROR TestReadAttributeInt8uDefaultValue_30() + // + // Tests methods + // + + CHIP_ERROR TestReadTheGlobalAttributeClusterRevision_0() { - chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevice, 1); + chip::Controller::ThreadNetworkDiagnosticsClusterTest cluster; + cluster.Associate(mDevice, 0); - return cluster.ReadAttributeInt8u(mOnSuccessCallback_30.Cancel(), mOnFailureCallback_30.Cancel()); + return cluster.ReadAttributeClusterRevision(mOnSuccessCallback_0.Cancel(), mOnFailureCallback_0.Cancel()); } - void OnFailureResponse_30(uint8_t status) { ThrowFailureResponse(); } + void OnFailureResponse_0(uint8_t status) { ThrowFailureResponse(); } - void OnSuccessResponse_30(uint8_t int8u) + void OnSuccessResponse_0(uint16_t clusterRevision) { - VerifyOrReturn(CheckValue("int8u", int8u, 0)); + VerifyOrReturn(CheckValue("clusterRevision", clusterRevision, 1U)); NextTest(); } - CHIP_ERROR TestWriteAttributeInt8uMaxValue_31() + CHIP_ERROR TestWriteTheDefaultValuesToMandatoryGlobalAttributeClusterRevision_1() { - chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevice, 1); + chip::Controller::ThreadNetworkDiagnosticsClusterTest cluster; + cluster.Associate(mDevice, 0); - uint8_t int8uArgument = 255; + uint16_t clusterRevisionArgument = 1U; - return cluster.WriteAttributeInt8u(mOnSuccessCallback_31.Cancel(), mOnFailureCallback_31.Cancel(), int8uArgument); + return cluster.WriteAttributeClusterRevision(mOnSuccessCallback_1.Cancel(), mOnFailureCallback_1.Cancel(), + clusterRevisionArgument); } - void OnFailureResponse_31(uint8_t status) { ThrowFailureResponse(); } + void OnFailureResponse_1(uint8_t status) { NextTest(); } - void OnSuccessResponse_31(uint8_t int8u) { NextTest(); } + void OnSuccessResponse_1(uint16_t clusterRevision) { ThrowSuccessResponse(); } - CHIP_ERROR TestReadAttributeInt8uMaxValue_32() + CHIP_ERROR TestReadsBackGlobalAttributeClusterRevision_2() { - chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevice, 1); + chip::Controller::ThreadNetworkDiagnosticsClusterTest cluster; + cluster.Associate(mDevice, 0); - return cluster.ReadAttributeInt8u(mOnSuccessCallback_32.Cancel(), mOnFailureCallback_32.Cancel()); + return cluster.ReadAttributeClusterRevision(mOnSuccessCallback_2.Cancel(), mOnFailureCallback_2.Cancel()); } - void OnFailureResponse_32(uint8_t status) { ThrowFailureResponse(); } + void OnFailureResponse_2(uint8_t status) { ThrowFailureResponse(); } - void OnSuccessResponse_32(uint8_t int8u) + void OnSuccessResponse_2(uint16_t clusterRevision) { - VerifyOrReturn(CheckValue("int8u", int8u, 255)); + VerifyOrReturn(CheckValue("clusterRevision", clusterRevision, 1U)); NextTest(); } +}; - CHIP_ERROR TestWriteAttributeInt8uMinValue_33() +class Test_TC_CC_1_1 : public TestCommand +{ +public: + Test_TC_CC_1_1() : TestCommand("Test_TC_CC_1_1"), mTestIndex(0) {} + + /////////// TestCommand Interface ///////// + void NextTest() override { - chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevice, 1); + CHIP_ERROR err = CHIP_NO_ERROR; - uint8_t int8uArgument = 0; + if (0 == mTestIndex) + { + ChipLogProgress(chipTool, " **** Test Start: Test_TC_CC_1_1\n"); + } - return cluster.WriteAttributeInt8u(mOnSuccessCallback_33.Cancel(), mOnFailureCallback_33.Cancel(), int8uArgument); + if (mTestCount == mTestIndex) + { + ChipLogProgress(chipTool, " **** Test Complete: Test_TC_CC_1_1\n"); + SetCommandExitStatus(CHIP_NO_ERROR); + return; + } + + // Ensure we increment mTestIndex before we start running the relevant + // command. That way if we lose the timeslice after we send the message + // but before our function call returns, we won't end up with an + // incorrect mTestIndex value observed when we get the response. + switch (mTestIndex++) + { + case 0: + ChipLogProgress(chipTool, + " ***** Test Step 0 : write the default values to mandatory global attribute: ClusterRevision\n"); + err = TestWriteTheDefaultValuesToMandatoryGlobalAttributeClusterRevision_0(); + break; + } + + if (CHIP_NO_ERROR != err) + { + ChipLogError(chipTool, " ***** Test Failure: %s\n", chip::ErrorStr(err)); + SetCommandExitStatus(err); + } } - void OnFailureResponse_33(uint8_t status) { ThrowFailureResponse(); } +private: + std::atomic_uint16_t mTestIndex; + const uint16_t mTestCount = 1; - void OnSuccessResponse_33(uint8_t int8u) { NextTest(); } + chip::Callback::Callback mOnFailureCallback_0{ OnFailureCallback_0, this }; + chip::Callback::Callback mOnSuccessCallback_0{ OnSuccessCallback_0, this }; - CHIP_ERROR TestReadAttributeInt8uMinValue_34() + static void OnFailureCallback_0(void * context, uint8_t status) { - chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevice, 1); - - return cluster.ReadAttributeInt8u(mOnSuccessCallback_34.Cancel(), mOnFailureCallback_34.Cancel()); + (static_cast(context))->OnFailureResponse_0(status); } - void OnFailureResponse_34(uint8_t status) { ThrowFailureResponse(); } - - void OnSuccessResponse_34(uint8_t int8u) + static void OnSuccessCallback_0(void * context, uint16_t clusterRevision) { - VerifyOrReturn(CheckValue("int8u", int8u, 0)); - NextTest(); + (static_cast(context))->OnSuccessResponse_0(clusterRevision); } - CHIP_ERROR TestReadAttributeInt16uDefaultValue_35() + // + // Tests methods + // + + CHIP_ERROR TestWriteTheDefaultValuesToMandatoryGlobalAttributeClusterRevision_0() { - chip::Controller::TestClusterClusterTest cluster; + chip::Controller::ColorControlClusterTest cluster; cluster.Associate(mDevice, 1); - return cluster.ReadAttributeInt16u(mOnSuccessCallback_35.Cancel(), mOnFailureCallback_35.Cancel()); + uint16_t clusterRevisionArgument = 4U; + + return cluster.WriteAttributeClusterRevision(mOnSuccessCallback_0.Cancel(), mOnFailureCallback_0.Cancel(), + clusterRevisionArgument); } - void OnFailureResponse_35(uint8_t status) { ThrowFailureResponse(); } + void OnFailureResponse_0(uint8_t status) { NextTest(); } - void OnSuccessResponse_35(uint16_t int16u) - { - VerifyOrReturn(CheckValue("int16u", int16u, 0U)); - NextTest(); - } + void OnSuccessResponse_0(uint16_t clusterRevision) { ThrowSuccessResponse(); } +}; - CHIP_ERROR TestWriteAttributeInt16uMaxValue_36() +class Test_TC_CC_3_1 : public TestCommand +{ +public: + Test_TC_CC_3_1() : TestCommand("Test_TC_CC_3_1"), mTestIndex(0) {} + + /////////// TestCommand Interface ///////// + void NextTest() override { - chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevice, 1); + CHIP_ERROR err = CHIP_NO_ERROR; - uint16_t int16uArgument = 65535U; + if (0 == mTestIndex) + { + ChipLogProgress(chipTool, " **** Test Start: Test_TC_CC_3_1\n"); + } - return cluster.WriteAttributeInt16u(mOnSuccessCallback_36.Cancel(), mOnFailureCallback_36.Cancel(), int16uArgument); + if (mTestCount == mTestIndex) + { + ChipLogProgress(chipTool, " **** Test Complete: Test_TC_CC_3_1\n"); + SetCommandExitStatus(CHIP_NO_ERROR); + return; + } + + // Ensure we increment mTestIndex before we start running the relevant + // command. That way if we lose the timeslice after we send the message + // but before our function call returns, we won't end up with an + // incorrect mTestIndex value observed when we get the response. + switch (mTestIndex++) + { + case 0: + ChipLogProgress(chipTool, " ***** Test Step 0 : Turn on light for color control tests\n"); + err = TestTurnOnLightForColorControlTests_0(); + break; + case 1: + ChipLogProgress(chipTool, " ***** Test Step 1 : Check on/off attribute value is true after on command\n"); + err = TestCheckOnOffAttributeValueIsTrueAfterOnCommand_1(); + break; + case 2: + ChipLogProgress(chipTool, " ***** Test Step 2 : Move to hue shortest distance command\n"); + err = TestMoveToHueShortestDistanceCommand_2(); + break; + case 3: + ChipLogProgress(chipTool, " ***** Test Step 3 : Move to hue longest distance command\n"); + err = TestMoveToHueLongestDistanceCommand_3(); + break; + case 4: + ChipLogProgress(chipTool, " ***** Test Step 4 : Move to hue up command\n"); + err = TestMoveToHueUpCommand_4(); + break; + case 5: + ChipLogProgress(chipTool, " ***** Test Step 5 : Move to hue down command\n"); + err = TestMoveToHueDownCommand_5(); + break; + case 6: + ChipLogProgress(chipTool, " ***** Test Step 6 : Turn off light that we turned on\n"); + err = TestTurnOffLightThatWeTurnedOn_6(); + break; + case 7: + ChipLogProgress(chipTool, " ***** Test Step 7 : Check on/off attribute value is false after off command\n"); + err = TestCheckOnOffAttributeValueIsFalseAfterOffCommand_7(); + break; + } + + if (CHIP_NO_ERROR != err) + { + ChipLogError(chipTool, " ***** Test Failure: %s\n", chip::ErrorStr(err)); + SetCommandExitStatus(err); + } } - void OnFailureResponse_36(uint8_t status) { ThrowFailureResponse(); } +private: + std::atomic_uint16_t mTestIndex; + const uint16_t mTestCount = 8; - void OnSuccessResponse_36(uint16_t int16u) { NextTest(); } + chip::Callback::Callback mOnFailureCallback_0{ OnFailureCallback_0, this }; + chip::Callback::Callback mOnSuccessCallback_0{ OnSuccessCallback_0, this }; + chip::Callback::Callback mOnFailureCallback_1{ OnFailureCallback_1, this }; + chip::Callback::Callback mOnSuccessCallback_1{ OnSuccessCallback_1, this }; + chip::Callback::Callback mOnFailureCallback_2{ OnFailureCallback_2, this }; + chip::Callback::Callback mOnSuccessCallback_2{ OnSuccessCallback_2, this }; + chip::Callback::Callback mOnFailureCallback_3{ OnFailureCallback_3, this }; + chip::Callback::Callback mOnSuccessCallback_3{ OnSuccessCallback_3, this }; + chip::Callback::Callback mOnFailureCallback_4{ OnFailureCallback_4, this }; + chip::Callback::Callback mOnSuccessCallback_4{ OnSuccessCallback_4, this }; + chip::Callback::Callback mOnFailureCallback_5{ OnFailureCallback_5, this }; + chip::Callback::Callback mOnSuccessCallback_5{ OnSuccessCallback_5, this }; + chip::Callback::Callback mOnFailureCallback_6{ OnFailureCallback_6, this }; + chip::Callback::Callback mOnSuccessCallback_6{ OnSuccessCallback_6, this }; + chip::Callback::Callback mOnFailureCallback_7{ OnFailureCallback_7, this }; + chip::Callback::Callback mOnSuccessCallback_7{ OnSuccessCallback_7, this }; - CHIP_ERROR TestReadAttributeInt16uMaxValue_37() + static void OnFailureCallback_0(void * context, uint8_t status) { - chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevice, 1); - - return cluster.ReadAttributeInt16u(mOnSuccessCallback_37.Cancel(), mOnFailureCallback_37.Cancel()); + (static_cast(context))->OnFailureResponse_0(status); } - void OnFailureResponse_37(uint8_t status) { ThrowFailureResponse(); } + static void OnSuccessCallback_0(void * context) { (static_cast(context))->OnSuccessResponse_0(); } - void OnSuccessResponse_37(uint16_t int16u) + static void OnFailureCallback_1(void * context, uint8_t status) { - VerifyOrReturn(CheckValue("int16u", int16u, 65535U)); - NextTest(); + (static_cast(context))->OnFailureResponse_1(status); } - CHIP_ERROR TestWriteAttributeInt16uMinValue_38() + static void OnSuccessCallback_1(void * context, bool onOff) { - chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevice, 1); - - uint16_t int16uArgument = 0U; - - return cluster.WriteAttributeInt16u(mOnSuccessCallback_38.Cancel(), mOnFailureCallback_38.Cancel(), int16uArgument); + (static_cast(context))->OnSuccessResponse_1(onOff); } - void OnFailureResponse_38(uint8_t status) { ThrowFailureResponse(); } - - void OnSuccessResponse_38(uint16_t int16u) { NextTest(); } - - CHIP_ERROR TestReadAttributeInt16uMinValue_39() + static void OnFailureCallback_2(void * context, uint8_t status) { - chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevice, 1); - - return cluster.ReadAttributeInt16u(mOnSuccessCallback_39.Cancel(), mOnFailureCallback_39.Cancel()); + (static_cast(context))->OnFailureResponse_2(status); } - void OnFailureResponse_39(uint8_t status) { ThrowFailureResponse(); } + static void OnSuccessCallback_2(void * context) { (static_cast(context))->OnSuccessResponse_2(); } - void OnSuccessResponse_39(uint16_t int16u) + static void OnFailureCallback_3(void * context, uint8_t status) { - VerifyOrReturn(CheckValue("int16u", int16u, 0U)); - NextTest(); + (static_cast(context))->OnFailureResponse_3(status); } - CHIP_ERROR TestReadAttributeInt32uDefaultValue_40() - { - chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevice, 1); + static void OnSuccessCallback_3(void * context) { (static_cast(context))->OnSuccessResponse_3(); } - return cluster.ReadAttributeInt32u(mOnSuccessCallback_40.Cancel(), mOnFailureCallback_40.Cancel()); + static void OnFailureCallback_4(void * context, uint8_t status) + { + (static_cast(context))->OnFailureResponse_4(status); } - void OnFailureResponse_40(uint8_t status) { ThrowFailureResponse(); } + static void OnSuccessCallback_4(void * context) { (static_cast(context))->OnSuccessResponse_4(); } - void OnSuccessResponse_40(uint32_t int32u) + static void OnFailureCallback_5(void * context, uint8_t status) { - VerifyOrReturn(CheckValue("int32u", int32u, 0UL)); - NextTest(); + (static_cast(context))->OnFailureResponse_5(status); } - CHIP_ERROR TestWriteAttributeInt32uMaxValue_41() - { - chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevice, 1); - - uint32_t int32uArgument = 4294967295UL; + static void OnSuccessCallback_5(void * context) { (static_cast(context))->OnSuccessResponse_5(); } - return cluster.WriteAttributeInt32u(mOnSuccessCallback_41.Cancel(), mOnFailureCallback_41.Cancel(), int32uArgument); + static void OnFailureCallback_6(void * context, uint8_t status) + { + (static_cast(context))->OnFailureResponse_6(status); } - void OnFailureResponse_41(uint8_t status) { ThrowFailureResponse(); } - - void OnSuccessResponse_41(uint32_t int32u) { NextTest(); } + static void OnSuccessCallback_6(void * context) { (static_cast(context))->OnSuccessResponse_6(); } - CHIP_ERROR TestReadAttributeInt32uMaxValue_42() + static void OnFailureCallback_7(void * context, uint8_t status) { - chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevice, 1); - - return cluster.ReadAttributeInt32u(mOnSuccessCallback_42.Cancel(), mOnFailureCallback_42.Cancel()); + (static_cast(context))->OnFailureResponse_7(status); } - void OnFailureResponse_42(uint8_t status) { ThrowFailureResponse(); } - - void OnSuccessResponse_42(uint32_t int32u) + static void OnSuccessCallback_7(void * context, bool onOff) { - VerifyOrReturn(CheckValue("int32u", int32u, 4294967295UL)); - NextTest(); + (static_cast(context))->OnSuccessResponse_7(onOff); } - CHIP_ERROR TestWriteAttributeInt32uMinValue_43() + // + // Tests methods + // + + CHIP_ERROR TestTurnOnLightForColorControlTests_0() { - chip::Controller::TestClusterClusterTest cluster; + chip::Controller::OnOffClusterTest cluster; cluster.Associate(mDevice, 1); - uint32_t int32uArgument = 0UL; - - return cluster.WriteAttributeInt32u(mOnSuccessCallback_43.Cancel(), mOnFailureCallback_43.Cancel(), int32uArgument); + return cluster.On(mOnSuccessCallback_0.Cancel(), mOnFailureCallback_0.Cancel()); } - void OnFailureResponse_43(uint8_t status) { ThrowFailureResponse(); } + void OnFailureResponse_0(uint8_t status) { ThrowFailureResponse(); } - void OnSuccessResponse_43(uint32_t int32u) { NextTest(); } + void OnSuccessResponse_0() { NextTest(); } - CHIP_ERROR TestReadAttributeInt32uMinValue_44() + CHIP_ERROR TestCheckOnOffAttributeValueIsTrueAfterOnCommand_1() { - chip::Controller::TestClusterClusterTest cluster; + chip::Controller::OnOffClusterTest cluster; cluster.Associate(mDevice, 1); - return cluster.ReadAttributeInt32u(mOnSuccessCallback_44.Cancel(), mOnFailureCallback_44.Cancel()); + return cluster.ReadAttributeOnOff(mOnSuccessCallback_1.Cancel(), mOnFailureCallback_1.Cancel()); } - void OnFailureResponse_44(uint8_t status) { ThrowFailureResponse(); } + void OnFailureResponse_1(uint8_t status) { ThrowFailureResponse(); } - void OnSuccessResponse_44(uint32_t int32u) + void OnSuccessResponse_1(bool onOff) { - VerifyOrReturn(CheckValue("int32u", int32u, 0UL)); + VerifyOrReturn(CheckValue("onOff", onOff, 1)); NextTest(); } - CHIP_ERROR TestReadAttributeInt64uDefaultValue_45() + CHIP_ERROR TestMoveToHueShortestDistanceCommand_2() { - chip::Controller::TestClusterClusterTest cluster; + chip::Controller::ColorControlClusterTest cluster; cluster.Associate(mDevice, 1); - return cluster.ReadAttributeInt64u(mOnSuccessCallback_45.Cancel(), mOnFailureCallback_45.Cancel()); + uint8_t hueArgument = 150; + uint8_t directionArgument = 0; + uint16_t transitionTimeArgument = 100U; + uint8_t optionsMaskArgument = 0; + uint8_t optionsOverrideArgument = 0; + + return cluster.MoveToHue(mOnSuccessCallback_2.Cancel(), mOnFailureCallback_2.Cancel(), hueArgument, directionArgument, + transitionTimeArgument, optionsMaskArgument, optionsOverrideArgument); } - void OnFailureResponse_45(uint8_t status) { ThrowFailureResponse(); } + void OnFailureResponse_2(uint8_t status) { ThrowFailureResponse(); } - void OnSuccessResponse_45(uint64_t int64u) - { - VerifyOrReturn(CheckValue("int64u", int64u, 0ULL)); - NextTest(); - } + void OnSuccessResponse_2() { NextTest(); } - CHIP_ERROR TestWriteAttributeInt64uMaxValue_46() + CHIP_ERROR TestMoveToHueLongestDistanceCommand_3() { - chip::Controller::TestClusterClusterTest cluster; + chip::Controller::ColorControlClusterTest cluster; cluster.Associate(mDevice, 1); - uint64_t int64uArgument = 18446744073709551615ULL; + uint8_t hueArgument = 200; + uint8_t directionArgument = 1; + uint16_t transitionTimeArgument = 100U; + uint8_t optionsMaskArgument = 0; + uint8_t optionsOverrideArgument = 0; - return cluster.WriteAttributeInt64u(mOnSuccessCallback_46.Cancel(), mOnFailureCallback_46.Cancel(), int64uArgument); + return cluster.MoveToHue(mOnSuccessCallback_3.Cancel(), mOnFailureCallback_3.Cancel(), hueArgument, directionArgument, + transitionTimeArgument, optionsMaskArgument, optionsOverrideArgument); } - void OnFailureResponse_46(uint8_t status) { ThrowFailureResponse(); } + void OnFailureResponse_3(uint8_t status) { ThrowFailureResponse(); } - void OnSuccessResponse_46(uint64_t int64u) { NextTest(); } + void OnSuccessResponse_3() { NextTest(); } - CHIP_ERROR TestReadAttributeInt64uMaxValue_47() + CHIP_ERROR TestMoveToHueUpCommand_4() { - chip::Controller::TestClusterClusterTest cluster; + chip::Controller::ColorControlClusterTest cluster; cluster.Associate(mDevice, 1); - return cluster.ReadAttributeInt64u(mOnSuccessCallback_47.Cancel(), mOnFailureCallback_47.Cancel()); + uint8_t hueArgument = 250; + uint8_t directionArgument = 2; + uint16_t transitionTimeArgument = 100U; + uint8_t optionsMaskArgument = 0; + uint8_t optionsOverrideArgument = 0; + + return cluster.MoveToHue(mOnSuccessCallback_4.Cancel(), mOnFailureCallback_4.Cancel(), hueArgument, directionArgument, + transitionTimeArgument, optionsMaskArgument, optionsOverrideArgument); } - void OnFailureResponse_47(uint8_t status) { ThrowFailureResponse(); } + void OnFailureResponse_4(uint8_t status) { ThrowFailureResponse(); } - void OnSuccessResponse_47(uint64_t int64u) - { - VerifyOrReturn(CheckValue("int64u", int64u, 18446744073709551615ULL)); - NextTest(); - } + void OnSuccessResponse_4() { NextTest(); } - CHIP_ERROR TestWriteAttributeInt64uMinValue_48() + CHIP_ERROR TestMoveToHueDownCommand_5() { - chip::Controller::TestClusterClusterTest cluster; + chip::Controller::ColorControlClusterTest cluster; cluster.Associate(mDevice, 1); - uint64_t int64uArgument = 0ULL; + uint8_t hueArgument = 225; + uint8_t directionArgument = 3; + uint16_t transitionTimeArgument = 100U; + uint8_t optionsMaskArgument = 0; + uint8_t optionsOverrideArgument = 0; - return cluster.WriteAttributeInt64u(mOnSuccessCallback_48.Cancel(), mOnFailureCallback_48.Cancel(), int64uArgument); + return cluster.MoveToHue(mOnSuccessCallback_5.Cancel(), mOnFailureCallback_5.Cancel(), hueArgument, directionArgument, + transitionTimeArgument, optionsMaskArgument, optionsOverrideArgument); } - void OnFailureResponse_48(uint8_t status) { ThrowFailureResponse(); } + void OnFailureResponse_5(uint8_t status) { ThrowFailureResponse(); } - void OnSuccessResponse_48(uint64_t int64u) { NextTest(); } + void OnSuccessResponse_5() { NextTest(); } - CHIP_ERROR TestReadAttributeInt64uMinValue_49() + CHIP_ERROR TestTurnOffLightThatWeTurnedOn_6() { - chip::Controller::TestClusterClusterTest cluster; + chip::Controller::OnOffClusterTest cluster; cluster.Associate(mDevice, 1); - return cluster.ReadAttributeInt64u(mOnSuccessCallback_49.Cancel(), mOnFailureCallback_49.Cancel()); + return cluster.Off(mOnSuccessCallback_6.Cancel(), mOnFailureCallback_6.Cancel()); } - void OnFailureResponse_49(uint8_t status) { ThrowFailureResponse(); } + void OnFailureResponse_6(uint8_t status) { ThrowFailureResponse(); } - void OnSuccessResponse_49(uint64_t int64u) - { - VerifyOrReturn(CheckValue("int64u", int64u, 0ULL)); - NextTest(); - } + void OnSuccessResponse_6() { NextTest(); } - CHIP_ERROR TestReadAttributeInt8sDefaultValue_50() + CHIP_ERROR TestCheckOnOffAttributeValueIsFalseAfterOffCommand_7() { - chip::Controller::TestClusterClusterTest cluster; + chip::Controller::OnOffClusterTest cluster; cluster.Associate(mDevice, 1); - return cluster.ReadAttributeInt8s(mOnSuccessCallback_50.Cancel(), mOnFailureCallback_50.Cancel()); + return cluster.ReadAttributeOnOff(mOnSuccessCallback_7.Cancel(), mOnFailureCallback_7.Cancel()); } - void OnFailureResponse_50(uint8_t status) { ThrowFailureResponse(); } + void OnFailureResponse_7(uint8_t status) { ThrowFailureResponse(); } - void OnSuccessResponse_50(int8_t int8s) + void OnSuccessResponse_7(bool onOff) { - VerifyOrReturn(CheckValue("int8s", int8s, 0)); + VerifyOrReturn(CheckValue("onOff", onOff, 0)); NextTest(); } +}; - CHIP_ERROR TestWriteAttributeInt8sMaxValue_51() +class Test_TC_CC_3_2 : public TestCommand +{ +public: + Test_TC_CC_3_2() : TestCommand("Test_TC_CC_3_2"), mTestIndex(0) {} + + /////////// TestCommand Interface ///////// + void NextTest() override { - chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevice, 1); + CHIP_ERROR err = CHIP_NO_ERROR; - int8_t int8sArgument = 127; + if (0 == mTestIndex) + { + ChipLogProgress(chipTool, " **** Test Start: Test_TC_CC_3_2\n"); + } + + if (mTestCount == mTestIndex) + { + ChipLogProgress(chipTool, " **** Test Complete: Test_TC_CC_3_2\n"); + SetCommandExitStatus(CHIP_NO_ERROR); + return; + } + + // Ensure we increment mTestIndex before we start running the relevant + // command. That way if we lose the timeslice after we send the message + // but before our function call returns, we won't end up with an + // incorrect mTestIndex value observed when we get the response. + switch (mTestIndex++) + { + case 0: + ChipLogProgress(chipTool, " ***** Test Step 0 : Turn on light for color control tests\n"); + err = TestTurnOnLightForColorControlTests_0(); + break; + case 1: + ChipLogProgress(chipTool, " ***** Test Step 1 : Check on/off attribute value is true after on command\n"); + err = TestCheckOnOffAttributeValueIsTrueAfterOnCommand_1(); + break; + case 2: + ChipLogProgress(chipTool, " ***** Test Step 2 : Move hue up command\n"); + err = TestMoveHueUpCommand_2(); + break; + case 3: + ChipLogProgress(chipTool, " ***** Test Step 3 : Move hue stop command\n"); + err = TestMoveHueStopCommand_3(); + break; + case 4: + ChipLogProgress(chipTool, " ***** Test Step 4 : Move hue down command\n"); + err = TestMoveHueDownCommand_4(); + break; + case 5: + ChipLogProgress(chipTool, " ***** Test Step 5 : Move hue stop command\n"); + err = TestMoveHueStopCommand_5(); + break; + case 6: + ChipLogProgress(chipTool, " ***** Test Step 6 : Turn off light that we turned on\n"); + err = TestTurnOffLightThatWeTurnedOn_6(); + break; + case 7: + ChipLogProgress(chipTool, " ***** Test Step 7 : Check on/off attribute value is false after off command\n"); + err = TestCheckOnOffAttributeValueIsFalseAfterOffCommand_7(); + break; + } + + if (CHIP_NO_ERROR != err) + { + ChipLogError(chipTool, " ***** Test Failure: %s\n", chip::ErrorStr(err)); + SetCommandExitStatus(err); + } + } + +private: + std::atomic_uint16_t mTestIndex; + const uint16_t mTestCount = 8; + + chip::Callback::Callback mOnFailureCallback_0{ OnFailureCallback_0, this }; + chip::Callback::Callback mOnSuccessCallback_0{ OnSuccessCallback_0, this }; + chip::Callback::Callback mOnFailureCallback_1{ OnFailureCallback_1, this }; + chip::Callback::Callback mOnSuccessCallback_1{ OnSuccessCallback_1, this }; + chip::Callback::Callback mOnFailureCallback_2{ OnFailureCallback_2, this }; + chip::Callback::Callback mOnSuccessCallback_2{ OnSuccessCallback_2, this }; + chip::Callback::Callback mOnFailureCallback_3{ OnFailureCallback_3, this }; + chip::Callback::Callback mOnSuccessCallback_3{ OnSuccessCallback_3, this }; + chip::Callback::Callback mOnFailureCallback_4{ OnFailureCallback_4, this }; + chip::Callback::Callback mOnSuccessCallback_4{ OnSuccessCallback_4, this }; + chip::Callback::Callback mOnFailureCallback_5{ OnFailureCallback_5, this }; + chip::Callback::Callback mOnSuccessCallback_5{ OnSuccessCallback_5, this }; + chip::Callback::Callback mOnFailureCallback_6{ OnFailureCallback_6, this }; + chip::Callback::Callback mOnSuccessCallback_6{ OnSuccessCallback_6, this }; + chip::Callback::Callback mOnFailureCallback_7{ OnFailureCallback_7, this }; + chip::Callback::Callback mOnSuccessCallback_7{ OnSuccessCallback_7, this }; - return cluster.WriteAttributeInt8s(mOnSuccessCallback_51.Cancel(), mOnFailureCallback_51.Cancel(), int8sArgument); + static void OnFailureCallback_0(void * context, uint8_t status) + { + (static_cast(context))->OnFailureResponse_0(status); } - void OnFailureResponse_51(uint8_t status) { ThrowFailureResponse(); } - - void OnSuccessResponse_51(int8_t int8s) { NextTest(); } + static void OnSuccessCallback_0(void * context) { (static_cast(context))->OnSuccessResponse_0(); } - CHIP_ERROR TestReadAttributeInt8sMaxValue_52() + static void OnFailureCallback_1(void * context, uint8_t status) { - chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevice, 1); - - return cluster.ReadAttributeInt8s(mOnSuccessCallback_52.Cancel(), mOnFailureCallback_52.Cancel()); + (static_cast(context))->OnFailureResponse_1(status); } - void OnFailureResponse_52(uint8_t status) { ThrowFailureResponse(); } - - void OnSuccessResponse_52(int8_t int8s) + static void OnSuccessCallback_1(void * context, bool onOff) { - VerifyOrReturn(CheckValue("int8s", int8s, 127)); - NextTest(); + (static_cast(context))->OnSuccessResponse_1(onOff); } - CHIP_ERROR TestWriteAttributeInt8sMinValue_53() + static void OnFailureCallback_2(void * context, uint8_t status) { - chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevice, 1); + (static_cast(context))->OnFailureResponse_2(status); + } - int8_t int8sArgument = -128; + static void OnSuccessCallback_2(void * context) { (static_cast(context))->OnSuccessResponse_2(); } - return cluster.WriteAttributeInt8s(mOnSuccessCallback_53.Cancel(), mOnFailureCallback_53.Cancel(), int8sArgument); + static void OnFailureCallback_3(void * context, uint8_t status) + { + (static_cast(context))->OnFailureResponse_3(status); } - void OnFailureResponse_53(uint8_t status) { ThrowFailureResponse(); } - - void OnSuccessResponse_53(int8_t int8s) { NextTest(); } + static void OnSuccessCallback_3(void * context) { (static_cast(context))->OnSuccessResponse_3(); } - CHIP_ERROR TestReadAttributeInt8sMinValue_54() + static void OnFailureCallback_4(void * context, uint8_t status) { - chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevice, 1); - - return cluster.ReadAttributeInt8s(mOnSuccessCallback_54.Cancel(), mOnFailureCallback_54.Cancel()); + (static_cast(context))->OnFailureResponse_4(status); } - void OnFailureResponse_54(uint8_t status) { ThrowFailureResponse(); } + static void OnSuccessCallback_4(void * context) { (static_cast(context))->OnSuccessResponse_4(); } - void OnSuccessResponse_54(int8_t int8s) + static void OnFailureCallback_5(void * context, uint8_t status) { - VerifyOrReturn(CheckValue("int8s", int8s, -128)); - NextTest(); + (static_cast(context))->OnFailureResponse_5(status); } - CHIP_ERROR TestWriteAttributeInt8sDefaultValue_55() + static void OnSuccessCallback_5(void * context) { (static_cast(context))->OnSuccessResponse_5(); } + + static void OnFailureCallback_6(void * context, uint8_t status) { - chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevice, 1); + (static_cast(context))->OnFailureResponse_6(status); + } - int8_t int8sArgument = 0; + static void OnSuccessCallback_6(void * context) { (static_cast(context))->OnSuccessResponse_6(); } - return cluster.WriteAttributeInt8s(mOnSuccessCallback_55.Cancel(), mOnFailureCallback_55.Cancel(), int8sArgument); + static void OnFailureCallback_7(void * context, uint8_t status) + { + (static_cast(context))->OnFailureResponse_7(status); } - void OnFailureResponse_55(uint8_t status) { ThrowFailureResponse(); } + static void OnSuccessCallback_7(void * context, bool onOff) + { + (static_cast(context))->OnSuccessResponse_7(onOff); + } - void OnSuccessResponse_55(int8_t int8s) { NextTest(); } + // + // Tests methods + // - CHIP_ERROR TestReadAttributeInt8sDefaultValue_56() + CHIP_ERROR TestTurnOnLightForColorControlTests_0() { - chip::Controller::TestClusterClusterTest cluster; + chip::Controller::OnOffClusterTest cluster; cluster.Associate(mDevice, 1); - return cluster.ReadAttributeInt8s(mOnSuccessCallback_56.Cancel(), mOnFailureCallback_56.Cancel()); + return cluster.On(mOnSuccessCallback_0.Cancel(), mOnFailureCallback_0.Cancel()); } - void OnFailureResponse_56(uint8_t status) { ThrowFailureResponse(); } + void OnFailureResponse_0(uint8_t status) { ThrowFailureResponse(); } - void OnSuccessResponse_56(int8_t int8s) - { - VerifyOrReturn(CheckValue("int8s", int8s, 0)); - NextTest(); - } + void OnSuccessResponse_0() { NextTest(); } - CHIP_ERROR TestReadAttributeInt16sDefaultValue_57() + CHIP_ERROR TestCheckOnOffAttributeValueIsTrueAfterOnCommand_1() { - chip::Controller::TestClusterClusterTest cluster; + chip::Controller::OnOffClusterTest cluster; cluster.Associate(mDevice, 1); - return cluster.ReadAttributeInt16s(mOnSuccessCallback_57.Cancel(), mOnFailureCallback_57.Cancel()); + return cluster.ReadAttributeOnOff(mOnSuccessCallback_1.Cancel(), mOnFailureCallback_1.Cancel()); } - void OnFailureResponse_57(uint8_t status) { ThrowFailureResponse(); } + void OnFailureResponse_1(uint8_t status) { ThrowFailureResponse(); } - void OnSuccessResponse_57(int16_t int16s) + void OnSuccessResponse_1(bool onOff) { - VerifyOrReturn(CheckValue("int16s", int16s, 0)); + VerifyOrReturn(CheckValue("onOff", onOff, 1)); NextTest(); } - CHIP_ERROR TestWriteAttributeInt16sMaxValue_58() + CHIP_ERROR TestMoveHueUpCommand_2() { - chip::Controller::TestClusterClusterTest cluster; + chip::Controller::ColorControlClusterTest cluster; cluster.Associate(mDevice, 1); - int16_t int16sArgument = 32767; + uint8_t moveModeArgument = 1; + uint8_t rateArgument = 50; + uint8_t optionsMaskArgument = 0; + uint8_t optionsOverrideArgument = 0; - return cluster.WriteAttributeInt16s(mOnSuccessCallback_58.Cancel(), mOnFailureCallback_58.Cancel(), int16sArgument); + return cluster.MoveHue(mOnSuccessCallback_2.Cancel(), mOnFailureCallback_2.Cancel(), moveModeArgument, rateArgument, + optionsMaskArgument, optionsOverrideArgument); } - void OnFailureResponse_58(uint8_t status) { ThrowFailureResponse(); } + void OnFailureResponse_2(uint8_t status) { ThrowFailureResponse(); } - void OnSuccessResponse_58(int16_t int16s) { NextTest(); } + void OnSuccessResponse_2() { NextTest(); } - CHIP_ERROR TestReadAttributeInt16sMaxValue_59() + CHIP_ERROR TestMoveHueStopCommand_3() { - chip::Controller::TestClusterClusterTest cluster; + chip::Controller::ColorControlClusterTest cluster; cluster.Associate(mDevice, 1); - return cluster.ReadAttributeInt16s(mOnSuccessCallback_59.Cancel(), mOnFailureCallback_59.Cancel()); + uint8_t moveModeArgument = 0; + uint8_t rateArgument = 50; + uint8_t optionsMaskArgument = 0; + uint8_t optionsOverrideArgument = 0; + + return cluster.MoveHue(mOnSuccessCallback_3.Cancel(), mOnFailureCallback_3.Cancel(), moveModeArgument, rateArgument, + optionsMaskArgument, optionsOverrideArgument); } - void OnFailureResponse_59(uint8_t status) { ThrowFailureResponse(); } + void OnFailureResponse_3(uint8_t status) { ThrowFailureResponse(); } - void OnSuccessResponse_59(int16_t int16s) - { - VerifyOrReturn(CheckValue("int16s", int16s, 32767)); - NextTest(); - } + void OnSuccessResponse_3() { NextTest(); } - CHIP_ERROR TestWriteAttributeInt16sMinValue_60() + CHIP_ERROR TestMoveHueDownCommand_4() { - chip::Controller::TestClusterClusterTest cluster; + chip::Controller::ColorControlClusterTest cluster; cluster.Associate(mDevice, 1); - int16_t int16sArgument = -32768; + uint8_t moveModeArgument = 3; + uint8_t rateArgument = 50; + uint8_t optionsMaskArgument = 0; + uint8_t optionsOverrideArgument = 0; - return cluster.WriteAttributeInt16s(mOnSuccessCallback_60.Cancel(), mOnFailureCallback_60.Cancel(), int16sArgument); + return cluster.MoveHue(mOnSuccessCallback_4.Cancel(), mOnFailureCallback_4.Cancel(), moveModeArgument, rateArgument, + optionsMaskArgument, optionsOverrideArgument); } - void OnFailureResponse_60(uint8_t status) { ThrowFailureResponse(); } + void OnFailureResponse_4(uint8_t status) { ThrowFailureResponse(); } - void OnSuccessResponse_60(int16_t int16s) { NextTest(); } + void OnSuccessResponse_4() { NextTest(); } - CHIP_ERROR TestReadAttributeInt16sMinValue_61() + CHIP_ERROR TestMoveHueStopCommand_5() { - chip::Controller::TestClusterClusterTest cluster; + chip::Controller::ColorControlClusterTest cluster; cluster.Associate(mDevice, 1); - return cluster.ReadAttributeInt16s(mOnSuccessCallback_61.Cancel(), mOnFailureCallback_61.Cancel()); + uint8_t moveModeArgument = 0; + uint8_t rateArgument = 50; + uint8_t optionsMaskArgument = 0; + uint8_t optionsOverrideArgument = 0; + + return cluster.MoveHue(mOnSuccessCallback_5.Cancel(), mOnFailureCallback_5.Cancel(), moveModeArgument, rateArgument, + optionsMaskArgument, optionsOverrideArgument); } - void OnFailureResponse_61(uint8_t status) { ThrowFailureResponse(); } + void OnFailureResponse_5(uint8_t status) { ThrowFailureResponse(); } - void OnSuccessResponse_61(int16_t int16s) - { - VerifyOrReturn(CheckValue("int16s", int16s, -32768)); - NextTest(); - } + void OnSuccessResponse_5() { NextTest(); } - CHIP_ERROR TestWriteAttributeInt16sDefaultValue_62() + CHIP_ERROR TestTurnOffLightThatWeTurnedOn_6() { - chip::Controller::TestClusterClusterTest cluster; + chip::Controller::OnOffClusterTest cluster; cluster.Associate(mDevice, 1); - int16_t int16sArgument = 0; - - return cluster.WriteAttributeInt16s(mOnSuccessCallback_62.Cancel(), mOnFailureCallback_62.Cancel(), int16sArgument); + return cluster.Off(mOnSuccessCallback_6.Cancel(), mOnFailureCallback_6.Cancel()); } - void OnFailureResponse_62(uint8_t status) { ThrowFailureResponse(); } + void OnFailureResponse_6(uint8_t status) { ThrowFailureResponse(); } - void OnSuccessResponse_62(int16_t int16s) { NextTest(); } + void OnSuccessResponse_6() { NextTest(); } - CHIP_ERROR TestReadAttributeInt16sDefaultValue_63() + CHIP_ERROR TestCheckOnOffAttributeValueIsFalseAfterOffCommand_7() { - chip::Controller::TestClusterClusterTest cluster; + chip::Controller::OnOffClusterTest cluster; cluster.Associate(mDevice, 1); - return cluster.ReadAttributeInt16s(mOnSuccessCallback_63.Cancel(), mOnFailureCallback_63.Cancel()); + return cluster.ReadAttributeOnOff(mOnSuccessCallback_7.Cancel(), mOnFailureCallback_7.Cancel()); } - void OnFailureResponse_63(uint8_t status) { ThrowFailureResponse(); } + void OnFailureResponse_7(uint8_t status) { ThrowFailureResponse(); } - void OnSuccessResponse_63(int16_t int16s) + void OnSuccessResponse_7(bool onOff) { - VerifyOrReturn(CheckValue("int16s", int16s, 0)); + VerifyOrReturn(CheckValue("onOff", onOff, 0)); NextTest(); } +}; - CHIP_ERROR TestReadAttributeInt32sDefaultValue_64() +class Test_TC_CC_3_3 : public TestCommand +{ +public: + Test_TC_CC_3_3() : TestCommand("Test_TC_CC_3_3"), mTestIndex(0) {} + + /////////// TestCommand Interface ///////// + void NextTest() override { - chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevice, 1); + CHIP_ERROR err = CHIP_NO_ERROR; - return cluster.ReadAttributeInt32s(mOnSuccessCallback_64.Cancel(), mOnFailureCallback_64.Cancel()); - } + if (0 == mTestIndex) + { + ChipLogProgress(chipTool, " **** Test Start: Test_TC_CC_3_3\n"); + } - void OnFailureResponse_64(uint8_t status) { ThrowFailureResponse(); } + if (mTestCount == mTestIndex) + { + ChipLogProgress(chipTool, " **** Test Complete: Test_TC_CC_3_3\n"); + SetCommandExitStatus(CHIP_NO_ERROR); + return; + } + + // Ensure we increment mTestIndex before we start running the relevant + // command. That way if we lose the timeslice after we send the message + // but before our function call returns, we won't end up with an + // incorrect mTestIndex value observed when we get the response. + switch (mTestIndex++) + { + case 0: + ChipLogProgress(chipTool, " ***** Test Step 0 : Turn on light for color control tests\n"); + err = TestTurnOnLightForColorControlTests_0(); + break; + case 1: + ChipLogProgress(chipTool, " ***** Test Step 1 : Check on/off attribute value is true after on command\n"); + err = TestCheckOnOffAttributeValueIsTrueAfterOnCommand_1(); + break; + case 2: + ChipLogProgress(chipTool, " ***** Test Step 2 : Step hue up command\n"); + err = TestStepHueUpCommand_2(); + break; + case 3: + ChipLogProgress(chipTool, " ***** Test Step 3 : Step hue down command\n"); + err = TestStepHueDownCommand_3(); + break; + case 4: + ChipLogProgress(chipTool, " ***** Test Step 4 : Turn off light that we turned on\n"); + err = TestTurnOffLightThatWeTurnedOn_4(); + break; + case 5: + ChipLogProgress(chipTool, " ***** Test Step 5 : Check on/off attribute value is false after off command\n"); + err = TestCheckOnOffAttributeValueIsFalseAfterOffCommand_5(); + break; + } - void OnSuccessResponse_64(int32_t int32s) - { - VerifyOrReturn(CheckValue("int32s", int32s, 0L)); - NextTest(); + if (CHIP_NO_ERROR != err) + { + ChipLogError(chipTool, " ***** Test Failure: %s\n", chip::ErrorStr(err)); + SetCommandExitStatus(err); + } } - CHIP_ERROR TestWriteAttributeInt32sMaxValue_65() - { - chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevice, 1); +private: + std::atomic_uint16_t mTestIndex; + const uint16_t mTestCount = 6; - int32_t int32sArgument = 2147483647L; + chip::Callback::Callback mOnFailureCallback_0{ OnFailureCallback_0, this }; + chip::Callback::Callback mOnSuccessCallback_0{ OnSuccessCallback_0, this }; + chip::Callback::Callback mOnFailureCallback_1{ OnFailureCallback_1, this }; + chip::Callback::Callback mOnSuccessCallback_1{ OnSuccessCallback_1, this }; + chip::Callback::Callback mOnFailureCallback_2{ OnFailureCallback_2, this }; + chip::Callback::Callback mOnSuccessCallback_2{ OnSuccessCallback_2, this }; + chip::Callback::Callback mOnFailureCallback_3{ OnFailureCallback_3, this }; + chip::Callback::Callback mOnSuccessCallback_3{ OnSuccessCallback_3, this }; + chip::Callback::Callback mOnFailureCallback_4{ OnFailureCallback_4, this }; + chip::Callback::Callback mOnSuccessCallback_4{ OnSuccessCallback_4, this }; + chip::Callback::Callback mOnFailureCallback_5{ OnFailureCallback_5, this }; + chip::Callback::Callback mOnSuccessCallback_5{ OnSuccessCallback_5, this }; - return cluster.WriteAttributeInt32s(mOnSuccessCallback_65.Cancel(), mOnFailureCallback_65.Cancel(), int32sArgument); + static void OnFailureCallback_0(void * context, uint8_t status) + { + (static_cast(context))->OnFailureResponse_0(status); } - void OnFailureResponse_65(uint8_t status) { ThrowFailureResponse(); } - - void OnSuccessResponse_65(int32_t int32s) { NextTest(); } + static void OnSuccessCallback_0(void * context) { (static_cast(context))->OnSuccessResponse_0(); } - CHIP_ERROR TestReadAttributeInt32sMaxValue_66() + static void OnFailureCallback_1(void * context, uint8_t status) { - chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevice, 1); - - return cluster.ReadAttributeInt32s(mOnSuccessCallback_66.Cancel(), mOnFailureCallback_66.Cancel()); + (static_cast(context))->OnFailureResponse_1(status); } - void OnFailureResponse_66(uint8_t status) { ThrowFailureResponse(); } - - void OnSuccessResponse_66(int32_t int32s) + static void OnSuccessCallback_1(void * context, bool onOff) { - VerifyOrReturn(CheckValue("int32s", int32s, 2147483647L)); - NextTest(); + (static_cast(context))->OnSuccessResponse_1(onOff); } - CHIP_ERROR TestWriteAttributeInt32sMinValue_67() + static void OnFailureCallback_2(void * context, uint8_t status) { - chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevice, 1); + (static_cast(context))->OnFailureResponse_2(status); + } - int32_t int32sArgument = -2147483648L; + static void OnSuccessCallback_2(void * context) { (static_cast(context))->OnSuccessResponse_2(); } - return cluster.WriteAttributeInt32s(mOnSuccessCallback_67.Cancel(), mOnFailureCallback_67.Cancel(), int32sArgument); + static void OnFailureCallback_3(void * context, uint8_t status) + { + (static_cast(context))->OnFailureResponse_3(status); } - void OnFailureResponse_67(uint8_t status) { ThrowFailureResponse(); } - - void OnSuccessResponse_67(int32_t int32s) { NextTest(); } + static void OnSuccessCallback_3(void * context) { (static_cast(context))->OnSuccessResponse_3(); } - CHIP_ERROR TestReadAttributeInt32sMinValue_68() + static void OnFailureCallback_4(void * context, uint8_t status) { - chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevice, 1); - - return cluster.ReadAttributeInt32s(mOnSuccessCallback_68.Cancel(), mOnFailureCallback_68.Cancel()); + (static_cast(context))->OnFailureResponse_4(status); } - void OnFailureResponse_68(uint8_t status) { ThrowFailureResponse(); } + static void OnSuccessCallback_4(void * context) { (static_cast(context))->OnSuccessResponse_4(); } - void OnSuccessResponse_68(int32_t int32s) + static void OnFailureCallback_5(void * context, uint8_t status) { - VerifyOrReturn(CheckValue("int32s", int32s, -2147483648L)); - NextTest(); + (static_cast(context))->OnFailureResponse_5(status); } - CHIP_ERROR TestWriteAttributeInt32sDefaultValue_69() + static void OnSuccessCallback_5(void * context, bool onOff) { - chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevice, 1); - - int32_t int32sArgument = 0L; - - return cluster.WriteAttributeInt32s(mOnSuccessCallback_69.Cancel(), mOnFailureCallback_69.Cancel(), int32sArgument); + (static_cast(context))->OnSuccessResponse_5(onOff); } - void OnFailureResponse_69(uint8_t status) { ThrowFailureResponse(); } - - void OnSuccessResponse_69(int32_t int32s) { NextTest(); } + // + // Tests methods + // - CHIP_ERROR TestReadAttributeInt32sDefaultValue_70() + CHIP_ERROR TestTurnOnLightForColorControlTests_0() { - chip::Controller::TestClusterClusterTest cluster; + chip::Controller::OnOffClusterTest cluster; cluster.Associate(mDevice, 1); - return cluster.ReadAttributeInt32s(mOnSuccessCallback_70.Cancel(), mOnFailureCallback_70.Cancel()); + return cluster.On(mOnSuccessCallback_0.Cancel(), mOnFailureCallback_0.Cancel()); } - void OnFailureResponse_70(uint8_t status) { ThrowFailureResponse(); } + void OnFailureResponse_0(uint8_t status) { ThrowFailureResponse(); } - void OnSuccessResponse_70(int32_t int32s) - { - VerifyOrReturn(CheckValue("int32s", int32s, 0L)); - NextTest(); - } + void OnSuccessResponse_0() { NextTest(); } - CHIP_ERROR TestReadAttributeInt64sDefaultValue_71() + CHIP_ERROR TestCheckOnOffAttributeValueIsTrueAfterOnCommand_1() { - chip::Controller::TestClusterClusterTest cluster; + chip::Controller::OnOffClusterTest cluster; cluster.Associate(mDevice, 1); - return cluster.ReadAttributeInt64s(mOnSuccessCallback_71.Cancel(), mOnFailureCallback_71.Cancel()); + return cluster.ReadAttributeOnOff(mOnSuccessCallback_1.Cancel(), mOnFailureCallback_1.Cancel()); } - void OnFailureResponse_71(uint8_t status) { ThrowFailureResponse(); } + void OnFailureResponse_1(uint8_t status) { ThrowFailureResponse(); } - void OnSuccessResponse_71(int64_t int64s) + void OnSuccessResponse_1(bool onOff) { - VerifyOrReturn(CheckValue("int64s", int64s, 0LL)); + VerifyOrReturn(CheckValue("onOff", onOff, 1)); NextTest(); } - CHIP_ERROR TestWriteAttributeInt64sMaxValue_72() + CHIP_ERROR TestStepHueUpCommand_2() { - chip::Controller::TestClusterClusterTest cluster; + chip::Controller::ColorControlClusterTest cluster; cluster.Associate(mDevice, 1); - int64_t int64sArgument = 9223372036854775807LL; + uint8_t stepModeArgument = 1; + uint8_t stepSizeArgument = 5; + uint8_t transitionTimeArgument = 25; + uint8_t optionsMaskArgument = 0; + uint8_t optionsOverrideArgument = 0; - return cluster.WriteAttributeInt64s(mOnSuccessCallback_72.Cancel(), mOnFailureCallback_72.Cancel(), int64sArgument); + return cluster.StepHue(mOnSuccessCallback_2.Cancel(), mOnFailureCallback_2.Cancel(), stepModeArgument, stepSizeArgument, + transitionTimeArgument, optionsMaskArgument, optionsOverrideArgument); } - void OnFailureResponse_72(uint8_t status) { ThrowFailureResponse(); } + void OnFailureResponse_2(uint8_t status) { ThrowFailureResponse(); } - void OnSuccessResponse_72(int64_t int64s) { NextTest(); } + void OnSuccessResponse_2() { NextTest(); } - CHIP_ERROR TestReadAttributeInt64sMaxValue_73() + CHIP_ERROR TestStepHueDownCommand_3() { - chip::Controller::TestClusterClusterTest cluster; + chip::Controller::ColorControlClusterTest cluster; cluster.Associate(mDevice, 1); - return cluster.ReadAttributeInt64s(mOnSuccessCallback_73.Cancel(), mOnFailureCallback_73.Cancel()); + uint8_t stepModeArgument = 3; + uint8_t stepSizeArgument = 5; + uint8_t transitionTimeArgument = 25; + uint8_t optionsMaskArgument = 0; + uint8_t optionsOverrideArgument = 0; + + return cluster.StepHue(mOnSuccessCallback_3.Cancel(), mOnFailureCallback_3.Cancel(), stepModeArgument, stepSizeArgument, + transitionTimeArgument, optionsMaskArgument, optionsOverrideArgument); } - void OnFailureResponse_73(uint8_t status) { ThrowFailureResponse(); } + void OnFailureResponse_3(uint8_t status) { ThrowFailureResponse(); } - void OnSuccessResponse_73(int64_t int64s) - { - VerifyOrReturn(CheckValue("int64s", int64s, 9223372036854775807LL)); - NextTest(); - } + void OnSuccessResponse_3() { NextTest(); } - CHIP_ERROR TestWriteAttributeInt64sMinValue_74() + CHIP_ERROR TestTurnOffLightThatWeTurnedOn_4() { - chip::Controller::TestClusterClusterTest cluster; + chip::Controller::OnOffClusterTest cluster; cluster.Associate(mDevice, 1); - int64_t int64sArgument = -9223372036854775807LL; - - return cluster.WriteAttributeInt64s(mOnSuccessCallback_74.Cancel(), mOnFailureCallback_74.Cancel(), int64sArgument); + return cluster.Off(mOnSuccessCallback_4.Cancel(), mOnFailureCallback_4.Cancel()); } - void OnFailureResponse_74(uint8_t status) { ThrowFailureResponse(); } + void OnFailureResponse_4(uint8_t status) { ThrowFailureResponse(); } - void OnSuccessResponse_74(int64_t int64s) { NextTest(); } + void OnSuccessResponse_4() { NextTest(); } - CHIP_ERROR TestReadAttributeInt64sMinValue_75() + CHIP_ERROR TestCheckOnOffAttributeValueIsFalseAfterOffCommand_5() { - chip::Controller::TestClusterClusterTest cluster; + chip::Controller::OnOffClusterTest cluster; cluster.Associate(mDevice, 1); - return cluster.ReadAttributeInt64s(mOnSuccessCallback_75.Cancel(), mOnFailureCallback_75.Cancel()); + return cluster.ReadAttributeOnOff(mOnSuccessCallback_5.Cancel(), mOnFailureCallback_5.Cancel()); } - void OnFailureResponse_75(uint8_t status) { ThrowFailureResponse(); } + void OnFailureResponse_5(uint8_t status) { ThrowFailureResponse(); } - void OnSuccessResponse_75(int64_t int64s) + void OnSuccessResponse_5(bool onOff) { - VerifyOrReturn(CheckValue("int64s", int64s, -9223372036854775807LL)); + VerifyOrReturn(CheckValue("onOff", onOff, 0)); NextTest(); } +}; - CHIP_ERROR TestWriteAttributeInt64sDefaultValue_76() - { - chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevice, 1); - - int64_t int64sArgument = 0LL; - - return cluster.WriteAttributeInt64s(mOnSuccessCallback_76.Cancel(), mOnFailureCallback_76.Cancel(), int64sArgument); - } - - void OnFailureResponse_76(uint8_t status) { ThrowFailureResponse(); } - - void OnSuccessResponse_76(int64_t int64s) { NextTest(); } +class Test_TC_CC_4_1 : public TestCommand +{ +public: + Test_TC_CC_4_1() : TestCommand("Test_TC_CC_4_1"), mTestIndex(0) {} - CHIP_ERROR TestReadAttributeInt64sDefaultValue_77() + /////////// TestCommand Interface ///////// + void NextTest() override { - chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevice, 1); - - return cluster.ReadAttributeInt64s(mOnSuccessCallback_77.Cancel(), mOnFailureCallback_77.Cancel()); - } + CHIP_ERROR err = CHIP_NO_ERROR; - void OnFailureResponse_77(uint8_t status) { ThrowFailureResponse(); } + if (0 == mTestIndex) + { + ChipLogProgress(chipTool, " **** Test Start: Test_TC_CC_4_1\n"); + } - void OnSuccessResponse_77(int64_t int64s) - { - VerifyOrReturn(CheckValue("int64s", int64s, 0LL)); - NextTest(); - } + if (mTestCount == mTestIndex) + { + ChipLogProgress(chipTool, " **** Test Complete: Test_TC_CC_4_1\n"); + SetCommandExitStatus(CHIP_NO_ERROR); + return; + } - CHIP_ERROR TestReadAttributeEnum8DefaultValue_78() - { - chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevice, 1); + // Ensure we increment mTestIndex before we start running the relevant + // command. That way if we lose the timeslice after we send the message + // but before our function call returns, we won't end up with an + // incorrect mTestIndex value observed when we get the response. + switch (mTestIndex++) + { + case 0: + ChipLogProgress(chipTool, " ***** Test Step 0 : Turn on light for color control tests\n"); + err = TestTurnOnLightForColorControlTests_0(); + break; + case 1: + ChipLogProgress(chipTool, " ***** Test Step 1 : Check on/off attribute value is true after on command\n"); + err = TestCheckOnOffAttributeValueIsTrueAfterOnCommand_1(); + break; + case 2: + ChipLogProgress(chipTool, " ***** Test Step 2 : Move to saturation command\n"); + err = TestMoveToSaturationCommand_2(); + break; + case 3: + ChipLogProgress(chipTool, " ***** Test Step 3 : Turn off light that we turned on\n"); + err = TestTurnOffLightThatWeTurnedOn_3(); + break; + case 4: + ChipLogProgress(chipTool, " ***** Test Step 4 : Check on/off attribute value is false after off command\n"); + err = TestCheckOnOffAttributeValueIsFalseAfterOffCommand_4(); + break; + } - return cluster.ReadAttributeEnum8(mOnSuccessCallback_78.Cancel(), mOnFailureCallback_78.Cancel()); + if (CHIP_NO_ERROR != err) + { + ChipLogError(chipTool, " ***** Test Failure: %s\n", chip::ErrorStr(err)); + SetCommandExitStatus(err); + } } - void OnFailureResponse_78(uint8_t status) { ThrowFailureResponse(); } +private: + std::atomic_uint16_t mTestIndex; + const uint16_t mTestCount = 5; - void OnSuccessResponse_78(uint8_t enum8) - { - VerifyOrReturn(CheckValue("enum8", enum8, 0)); - NextTest(); - } + chip::Callback::Callback mOnFailureCallback_0{ OnFailureCallback_0, this }; + chip::Callback::Callback mOnSuccessCallback_0{ OnSuccessCallback_0, this }; + chip::Callback::Callback mOnFailureCallback_1{ OnFailureCallback_1, this }; + chip::Callback::Callback mOnSuccessCallback_1{ OnSuccessCallback_1, this }; + chip::Callback::Callback mOnFailureCallback_2{ OnFailureCallback_2, this }; + chip::Callback::Callback mOnSuccessCallback_2{ OnSuccessCallback_2, this }; + chip::Callback::Callback mOnFailureCallback_3{ OnFailureCallback_3, this }; + chip::Callback::Callback mOnSuccessCallback_3{ OnSuccessCallback_3, this }; + chip::Callback::Callback mOnFailureCallback_4{ OnFailureCallback_4, this }; + chip::Callback::Callback mOnSuccessCallback_4{ OnSuccessCallback_4, this }; - CHIP_ERROR TestWriteAttributeEnum8MaxValue_79() + static void OnFailureCallback_0(void * context, uint8_t status) { - chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevice, 1); - - uint8_t enum8Argument = 255; - - return cluster.WriteAttributeEnum8(mOnSuccessCallback_79.Cancel(), mOnFailureCallback_79.Cancel(), enum8Argument); + (static_cast(context))->OnFailureResponse_0(status); } - void OnFailureResponse_79(uint8_t status) { ThrowFailureResponse(); } - - void OnSuccessResponse_79(uint8_t enum8) { NextTest(); } + static void OnSuccessCallback_0(void * context) { (static_cast(context))->OnSuccessResponse_0(); } - CHIP_ERROR TestReadAttributeEnum8MaxValue_80() + static void OnFailureCallback_1(void * context, uint8_t status) { - chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevice, 1); - - return cluster.ReadAttributeEnum8(mOnSuccessCallback_80.Cancel(), mOnFailureCallback_80.Cancel()); + (static_cast(context))->OnFailureResponse_1(status); } - void OnFailureResponse_80(uint8_t status) { ThrowFailureResponse(); } - - void OnSuccessResponse_80(uint8_t enum8) + static void OnSuccessCallback_1(void * context, bool onOff) { - VerifyOrReturn(CheckValue("enum8", enum8, 255)); - NextTest(); + (static_cast(context))->OnSuccessResponse_1(onOff); } - CHIP_ERROR TestWriteAttributeEnum8MinValue_81() + static void OnFailureCallback_2(void * context, uint8_t status) { - chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevice, 1); - - uint8_t enum8Argument = 0; - - return cluster.WriteAttributeEnum8(mOnSuccessCallback_81.Cancel(), mOnFailureCallback_81.Cancel(), enum8Argument); + (static_cast(context))->OnFailureResponse_2(status); } - void OnFailureResponse_81(uint8_t status) { ThrowFailureResponse(); } - - void OnSuccessResponse_81(uint8_t enum8) { NextTest(); } + static void OnSuccessCallback_2(void * context) { (static_cast(context))->OnSuccessResponse_2(); } - CHIP_ERROR TestReadAttributeEnum8MinValue_82() + static void OnFailureCallback_3(void * context, uint8_t status) { - chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevice, 1); - - return cluster.ReadAttributeEnum8(mOnSuccessCallback_82.Cancel(), mOnFailureCallback_82.Cancel()); + (static_cast(context))->OnFailureResponse_3(status); } - void OnFailureResponse_82(uint8_t status) { ThrowFailureResponse(); } + static void OnSuccessCallback_3(void * context) { (static_cast(context))->OnSuccessResponse_3(); } - void OnSuccessResponse_82(uint8_t enum8) + static void OnFailureCallback_4(void * context, uint8_t status) { - VerifyOrReturn(CheckValue("enum8", enum8, 0)); - NextTest(); + (static_cast(context))->OnFailureResponse_4(status); } - CHIP_ERROR TestReadAttributeEnum16DefaultValue_83() + static void OnSuccessCallback_4(void * context, bool onOff) { - chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevice, 1); - - return cluster.ReadAttributeEnum16(mOnSuccessCallback_83.Cancel(), mOnFailureCallback_83.Cancel()); + (static_cast(context))->OnSuccessResponse_4(onOff); } - void OnFailureResponse_83(uint8_t status) { ThrowFailureResponse(); } - - void OnSuccessResponse_83(uint16_t enum16) - { - VerifyOrReturn(CheckValue("enum16", enum16, 0U)); - NextTest(); - } + // + // Tests methods + // - CHIP_ERROR TestWriteAttributeEnum16MaxValue_84() + CHIP_ERROR TestTurnOnLightForColorControlTests_0() { - chip::Controller::TestClusterClusterTest cluster; + chip::Controller::OnOffClusterTest cluster; cluster.Associate(mDevice, 1); - uint16_t enum16Argument = 65535U; - - return cluster.WriteAttributeEnum16(mOnSuccessCallback_84.Cancel(), mOnFailureCallback_84.Cancel(), enum16Argument); + return cluster.On(mOnSuccessCallback_0.Cancel(), mOnFailureCallback_0.Cancel()); } - void OnFailureResponse_84(uint8_t status) { ThrowFailureResponse(); } + void OnFailureResponse_0(uint8_t status) { ThrowFailureResponse(); } - void OnSuccessResponse_84(uint16_t enum16) { NextTest(); } + void OnSuccessResponse_0() { NextTest(); } - CHIP_ERROR TestReadAttributeEnum16MaxValue_85() + CHIP_ERROR TestCheckOnOffAttributeValueIsTrueAfterOnCommand_1() { - chip::Controller::TestClusterClusterTest cluster; + chip::Controller::OnOffClusterTest cluster; cluster.Associate(mDevice, 1); - return cluster.ReadAttributeEnum16(mOnSuccessCallback_85.Cancel(), mOnFailureCallback_85.Cancel()); + return cluster.ReadAttributeOnOff(mOnSuccessCallback_1.Cancel(), mOnFailureCallback_1.Cancel()); } - void OnFailureResponse_85(uint8_t status) { ThrowFailureResponse(); } + void OnFailureResponse_1(uint8_t status) { ThrowFailureResponse(); } - void OnSuccessResponse_85(uint16_t enum16) + void OnSuccessResponse_1(bool onOff) { - VerifyOrReturn(CheckValue("enum16", enum16, 65535U)); + VerifyOrReturn(CheckValue("onOff", onOff, 1)); NextTest(); } - CHIP_ERROR TestWriteAttributeEnum16MinValue_86() + CHIP_ERROR TestMoveToSaturationCommand_2() { - chip::Controller::TestClusterClusterTest cluster; + chip::Controller::ColorControlClusterTest cluster; cluster.Associate(mDevice, 1); - uint16_t enum16Argument = 0U; + uint8_t saturationArgument = 90; + uint16_t transitionTimeArgument = 10U; + uint8_t optionsMaskArgument = 0; + uint8_t optionsOverrideArgument = 0; - return cluster.WriteAttributeEnum16(mOnSuccessCallback_86.Cancel(), mOnFailureCallback_86.Cancel(), enum16Argument); + return cluster.MoveToSaturation(mOnSuccessCallback_2.Cancel(), mOnFailureCallback_2.Cancel(), saturationArgument, + transitionTimeArgument, optionsMaskArgument, optionsOverrideArgument); } - void OnFailureResponse_86(uint8_t status) { ThrowFailureResponse(); } + void OnFailureResponse_2(uint8_t status) { ThrowFailureResponse(); } - void OnSuccessResponse_86(uint16_t enum16) { NextTest(); } + void OnSuccessResponse_2() { NextTest(); } - CHIP_ERROR TestReadAttributeEnum16MinValue_87() + CHIP_ERROR TestTurnOffLightThatWeTurnedOn_3() { - chip::Controller::TestClusterClusterTest cluster; + chip::Controller::OnOffClusterTest cluster; cluster.Associate(mDevice, 1); - return cluster.ReadAttributeEnum16(mOnSuccessCallback_87.Cancel(), mOnFailureCallback_87.Cancel()); + return cluster.Off(mOnSuccessCallback_3.Cancel(), mOnFailureCallback_3.Cancel()); } - void OnFailureResponse_87(uint8_t status) { ThrowFailureResponse(); } + void OnFailureResponse_3(uint8_t status) { ThrowFailureResponse(); } - void OnSuccessResponse_87(uint16_t enum16) - { - VerifyOrReturn(CheckValue("enum16", enum16, 0U)); - NextTest(); - } + void OnSuccessResponse_3() { NextTest(); } - CHIP_ERROR TestReadAttributeOctetStringDefaultValue_88() + CHIP_ERROR TestCheckOnOffAttributeValueIsFalseAfterOffCommand_4() { - chip::Controller::TestClusterClusterTest cluster; + chip::Controller::OnOffClusterTest cluster; cluster.Associate(mDevice, 1); - return cluster.ReadAttributeOctetString(mOnSuccessCallback_88.Cancel(), mOnFailureCallback_88.Cancel()); + return cluster.ReadAttributeOnOff(mOnSuccessCallback_4.Cancel(), mOnFailureCallback_4.Cancel()); } - void OnFailureResponse_88(uint8_t status) { ThrowFailureResponse(); } + void OnFailureResponse_4(uint8_t status) { ThrowFailureResponse(); } - void OnSuccessResponse_88(chip::ByteSpan octetString) + void OnSuccessResponse_4(bool onOff) { - VerifyOrReturn(CheckValueAsString("octetString", octetString, "")); + VerifyOrReturn(CheckValue("onOff", onOff, 0)); NextTest(); } +}; - CHIP_ERROR TestWriteAttributeOctetString_89() +class Test_TC_CC_4_2 : public TestCommand +{ +public: + Test_TC_CC_4_2() : TestCommand("Test_TC_CC_4_2"), mTestIndex(0) {} + + /////////// TestCommand Interface ///////// + void NextTest() override { - chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevice, 1); + CHIP_ERROR err = CHIP_NO_ERROR; - chip::ByteSpan octetStringArgument = chip::ByteSpan(chip::Uint8::from_const_char("TestValue"), strlen("TestValue")); + if (0 == mTestIndex) + { + ChipLogProgress(chipTool, " **** Test Start: Test_TC_CC_4_2\n"); + } - return cluster.WriteAttributeOctetString(mOnSuccessCallback_89.Cancel(), mOnFailureCallback_89.Cancel(), - octetStringArgument); + if (mTestCount == mTestIndex) + { + ChipLogProgress(chipTool, " **** Test Complete: Test_TC_CC_4_2\n"); + SetCommandExitStatus(CHIP_NO_ERROR); + return; + } + + // Ensure we increment mTestIndex before we start running the relevant + // command. That way if we lose the timeslice after we send the message + // but before our function call returns, we won't end up with an + // incorrect mTestIndex value observed when we get the response. + switch (mTestIndex++) + { + case 0: + ChipLogProgress(chipTool, " ***** Test Step 0 : Turn on light for color control tests\n"); + err = TestTurnOnLightForColorControlTests_0(); + break; + case 1: + ChipLogProgress(chipTool, " ***** Test Step 1 : Check on/off attribute value is true after on command\n"); + err = TestCheckOnOffAttributeValueIsTrueAfterOnCommand_1(); + break; + case 2: + ChipLogProgress(chipTool, " ***** Test Step 2 : Move saturation up command\n"); + err = TestMoveSaturationUpCommand_2(); + break; + case 3: + ChipLogProgress(chipTool, " ***** Test Step 3 : Move saturation down command\n"); + err = TestMoveSaturationDownCommand_3(); + break; + case 4: + ChipLogProgress(chipTool, " ***** Test Step 4 : Turn off light that we turned on\n"); + err = TestTurnOffLightThatWeTurnedOn_4(); + break; + case 5: + ChipLogProgress(chipTool, " ***** Test Step 5 : Check on/off attribute value is false after off command\n"); + err = TestCheckOnOffAttributeValueIsFalseAfterOffCommand_5(); + break; + } + + if (CHIP_NO_ERROR != err) + { + ChipLogError(chipTool, " ***** Test Failure: %s\n", chip::ErrorStr(err)); + SetCommandExitStatus(err); + } } - void OnFailureResponse_89(uint8_t status) { ThrowFailureResponse(); } +private: + std::atomic_uint16_t mTestIndex; + const uint16_t mTestCount = 6; - void OnSuccessResponse_89(chip::ByteSpan octetString) { NextTest(); } + chip::Callback::Callback mOnFailureCallback_0{ OnFailureCallback_0, this }; + chip::Callback::Callback mOnSuccessCallback_0{ OnSuccessCallback_0, this }; + chip::Callback::Callback mOnFailureCallback_1{ OnFailureCallback_1, this }; + chip::Callback::Callback mOnSuccessCallback_1{ OnSuccessCallback_1, this }; + chip::Callback::Callback mOnFailureCallback_2{ OnFailureCallback_2, this }; + chip::Callback::Callback mOnSuccessCallback_2{ OnSuccessCallback_2, this }; + chip::Callback::Callback mOnFailureCallback_3{ OnFailureCallback_3, this }; + chip::Callback::Callback mOnSuccessCallback_3{ OnSuccessCallback_3, this }; + chip::Callback::Callback mOnFailureCallback_4{ OnFailureCallback_4, this }; + chip::Callback::Callback mOnSuccessCallback_4{ OnSuccessCallback_4, this }; + chip::Callback::Callback mOnFailureCallback_5{ OnFailureCallback_5, this }; + chip::Callback::Callback mOnSuccessCallback_5{ OnSuccessCallback_5, this }; - CHIP_ERROR TestReadAttributeOctetString_90() + static void OnFailureCallback_0(void * context, uint8_t status) { - chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevice, 1); + (static_cast(context))->OnFailureResponse_0(status); + } - return cluster.ReadAttributeOctetString(mOnSuccessCallback_90.Cancel(), mOnFailureCallback_90.Cancel()); + static void OnSuccessCallback_0(void * context) { (static_cast(context))->OnSuccessResponse_0(); } + + static void OnFailureCallback_1(void * context, uint8_t status) + { + (static_cast(context))->OnFailureResponse_1(status); } - void OnFailureResponse_90(uint8_t status) { ThrowFailureResponse(); } - - void OnSuccessResponse_90(chip::ByteSpan octetString) + static void OnSuccessCallback_1(void * context, bool onOff) { - VerifyOrReturn(CheckValueAsString("octetString", octetString, "TestValue")); - NextTest(); + (static_cast(context))->OnSuccessResponse_1(onOff); } - CHIP_ERROR TestWriteAttributeOctetString_91() + static void OnFailureCallback_2(void * context, uint8_t status) { - chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevice, 1); + (static_cast(context))->OnFailureResponse_2(status); + } - chip::ByteSpan octetStringArgument = - chip::ByteSpan(chip::Uint8::from_const_char("TestValueLongerThan10"), strlen("TestValueLongerThan10")); + static void OnSuccessCallback_2(void * context) { (static_cast(context))->OnSuccessResponse_2(); } - return cluster.WriteAttributeOctetString(mOnSuccessCallback_91.Cancel(), mOnFailureCallback_91.Cancel(), - octetStringArgument); + static void OnFailureCallback_3(void * context, uint8_t status) + { + (static_cast(context))->OnFailureResponse_3(status); } - void OnFailureResponse_91(uint8_t status) { NextTest(); } - - void OnSuccessResponse_91(chip::ByteSpan octetString) { ThrowSuccessResponse(); } + static void OnSuccessCallback_3(void * context) { (static_cast(context))->OnSuccessResponse_3(); } - CHIP_ERROR TestReadAttributeOctetString_92() + static void OnFailureCallback_4(void * context, uint8_t status) { - chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevice, 1); - - return cluster.ReadAttributeOctetString(mOnSuccessCallback_92.Cancel(), mOnFailureCallback_92.Cancel()); + (static_cast(context))->OnFailureResponse_4(status); } - void OnFailureResponse_92(uint8_t status) { ThrowFailureResponse(); } + static void OnSuccessCallback_4(void * context) { (static_cast(context))->OnSuccessResponse_4(); } - void OnSuccessResponse_92(chip::ByteSpan octetString) + static void OnFailureCallback_5(void * context, uint8_t status) { - VerifyOrReturn(CheckValueAsString("octetString", octetString, "TestValue")); - NextTest(); + (static_cast(context))->OnFailureResponse_5(status); } - CHIP_ERROR TestWriteAttributeOctetString_93() + static void OnSuccessCallback_5(void * context, bool onOff) { - chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevice, 1); + (static_cast(context))->OnSuccessResponse_5(onOff); + } - chip::ByteSpan octetStringArgument = chip::ByteSpan(chip::Uint8::from_const_char(""), strlen("")); + // + // Tests methods + // - return cluster.WriteAttributeOctetString(mOnSuccessCallback_93.Cancel(), mOnFailureCallback_93.Cancel(), - octetStringArgument); + CHIP_ERROR TestTurnOnLightForColorControlTests_0() + { + chip::Controller::OnOffClusterTest cluster; + cluster.Associate(mDevice, 1); + + return cluster.On(mOnSuccessCallback_0.Cancel(), mOnFailureCallback_0.Cancel()); } - void OnFailureResponse_93(uint8_t status) { ThrowFailureResponse(); } + void OnFailureResponse_0(uint8_t status) { ThrowFailureResponse(); } - void OnSuccessResponse_93(chip::ByteSpan octetString) { NextTest(); } + void OnSuccessResponse_0() { NextTest(); } - CHIP_ERROR TestReadAttributeLongOctetStringDefaultValue_94() + CHIP_ERROR TestCheckOnOffAttributeValueIsTrueAfterOnCommand_1() { - chip::Controller::TestClusterClusterTest cluster; + chip::Controller::OnOffClusterTest cluster; cluster.Associate(mDevice, 1); - return cluster.ReadAttributeLongOctetString(mOnSuccessCallback_94.Cancel(), mOnFailureCallback_94.Cancel()); + return cluster.ReadAttributeOnOff(mOnSuccessCallback_1.Cancel(), mOnFailureCallback_1.Cancel()); } - void OnFailureResponse_94(uint8_t status) { ThrowFailureResponse(); } + void OnFailureResponse_1(uint8_t status) { ThrowFailureResponse(); } - void OnSuccessResponse_94(chip::ByteSpan longOctetString) + void OnSuccessResponse_1(bool onOff) { - VerifyOrReturn(CheckValueAsString("longOctetString", longOctetString, "")); + VerifyOrReturn(CheckValue("onOff", onOff, 1)); NextTest(); } - CHIP_ERROR TestWriteAttributeLongOctetString_95() + CHIP_ERROR TestMoveSaturationUpCommand_2() { - chip::Controller::TestClusterClusterTest cluster; + chip::Controller::ColorControlClusterTest cluster; cluster.Associate(mDevice, 1); - chip::ByteSpan longOctetStringArgument = chip::ByteSpan( - chip::Uint8::from_const_char( - "111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111" - "111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111" - "111111111111111111111111111111111111111111111111111111111111111111111111"), - strlen("111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111" - "111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111" - "111111111111111111111111111111111111111111111111111111111111111111111111111111")); + uint8_t moveModeArgument = 1; + uint8_t rateArgument = 5; + uint8_t optionsMaskArgument = 0; + uint8_t optionsOverrideArgument = 0; - return cluster.WriteAttributeLongOctetString(mOnSuccessCallback_95.Cancel(), mOnFailureCallback_95.Cancel(), - longOctetStringArgument); + return cluster.MoveSaturation(mOnSuccessCallback_2.Cancel(), mOnFailureCallback_2.Cancel(), moveModeArgument, rateArgument, + optionsMaskArgument, optionsOverrideArgument); } - void OnFailureResponse_95(uint8_t status) { ThrowFailureResponse(); } + void OnFailureResponse_2(uint8_t status) { ThrowFailureResponse(); } - void OnSuccessResponse_95(chip::ByteSpan longOctetString) { NextTest(); } + void OnSuccessResponse_2() { NextTest(); } - CHIP_ERROR TestReadAttributeLongOctetString_96() + CHIP_ERROR TestMoveSaturationDownCommand_3() { - chip::Controller::TestClusterClusterTest cluster; + chip::Controller::ColorControlClusterTest cluster; cluster.Associate(mDevice, 1); - return cluster.ReadAttributeLongOctetString(mOnSuccessCallback_96.Cancel(), mOnFailureCallback_96.Cancel()); + uint8_t moveModeArgument = 3; + uint8_t rateArgument = 5; + uint8_t optionsMaskArgument = 0; + uint8_t optionsOverrideArgument = 0; + + return cluster.MoveSaturation(mOnSuccessCallback_3.Cancel(), mOnFailureCallback_3.Cancel(), moveModeArgument, rateArgument, + optionsMaskArgument, optionsOverrideArgument); } - void OnFailureResponse_96(uint8_t status) { ThrowFailureResponse(); } + void OnFailureResponse_3(uint8_t status) { ThrowFailureResponse(); } - void OnSuccessResponse_96(chip::ByteSpan longOctetString) - { - VerifyOrReturn(CheckValueAsString( - "longOctetString", longOctetString, - "1111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111" - "1111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111" - "1111111111111111111111111111111111111111111111111111111111111111")); - NextTest(); - } + void OnSuccessResponse_3() { NextTest(); } - CHIP_ERROR TestWriteAttributeLongOctetString_97() + CHIP_ERROR TestTurnOffLightThatWeTurnedOn_4() { - chip::Controller::TestClusterClusterTest cluster; + chip::Controller::OnOffClusterTest cluster; cluster.Associate(mDevice, 1); - chip::ByteSpan longOctetStringArgument = chip::ByteSpan(chip::Uint8::from_const_char(""), strlen("")); - - return cluster.WriteAttributeLongOctetString(mOnSuccessCallback_97.Cancel(), mOnFailureCallback_97.Cancel(), - longOctetStringArgument); + return cluster.Off(mOnSuccessCallback_4.Cancel(), mOnFailureCallback_4.Cancel()); } - void OnFailureResponse_97(uint8_t status) { ThrowFailureResponse(); } + void OnFailureResponse_4(uint8_t status) { ThrowFailureResponse(); } - void OnSuccessResponse_97(chip::ByteSpan longOctetString) { NextTest(); } + void OnSuccessResponse_4() { NextTest(); } - CHIP_ERROR TestReadAttributeCharStringDefaultValue_98() + CHIP_ERROR TestCheckOnOffAttributeValueIsFalseAfterOffCommand_5() { - chip::Controller::TestClusterClusterTest cluster; + chip::Controller::OnOffClusterTest cluster; cluster.Associate(mDevice, 1); - return cluster.ReadAttributeCharString(mOnSuccessCallback_98.Cancel(), mOnFailureCallback_98.Cancel()); + return cluster.ReadAttributeOnOff(mOnSuccessCallback_5.Cancel(), mOnFailureCallback_5.Cancel()); } - void OnFailureResponse_98(uint8_t status) { ThrowFailureResponse(); } + void OnFailureResponse_5(uint8_t status) { ThrowFailureResponse(); } - void OnSuccessResponse_98(chip::ByteSpan charString) + void OnSuccessResponse_5(bool onOff) { - VerifyOrReturn(CheckValueAsString("charString", charString, "")); + VerifyOrReturn(CheckValue("onOff", onOff, 0)); NextTest(); } +}; - CHIP_ERROR TestWriteAttributeCharString_99() - { - chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevice, 1); - - chip::ByteSpan charStringArgument = chip::ByteSpan(chip::Uint8::from_const_char("☉T☉"), strlen("☉T☉")); - - return cluster.WriteAttributeCharString(mOnSuccessCallback_99.Cancel(), mOnFailureCallback_99.Cancel(), charStringArgument); - } - - void OnFailureResponse_99(uint8_t status) { ThrowFailureResponse(); } - - void OnSuccessResponse_99(chip::ByteSpan charString) { NextTest(); } +class Test_TC_CC_4_3 : public TestCommand +{ +public: + Test_TC_CC_4_3() : TestCommand("Test_TC_CC_4_3"), mTestIndex(0) {} - CHIP_ERROR TestWriteAttributeCharStringValueTooLong_100() + /////////// TestCommand Interface ///////// + void NextTest() override { - chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevice, 1); - - chip::ByteSpan charStringArgument = - chip::ByteSpan(chip::Uint8::from_const_char("☉TestValueLongerThan10☉"), strlen("☉TestValueLongerThan10☉")); - - return cluster.WriteAttributeCharString(mOnSuccessCallback_100.Cancel(), mOnFailureCallback_100.Cancel(), - charStringArgument); - } - - void OnFailureResponse_100(uint8_t status) { NextTest(); } + CHIP_ERROR err = CHIP_NO_ERROR; - void OnSuccessResponse_100(chip::ByteSpan charString) { ThrowSuccessResponse(); } + if (0 == mTestIndex) + { + ChipLogProgress(chipTool, " **** Test Start: Test_TC_CC_4_3\n"); + } - CHIP_ERROR TestWriteAttributeCharStringEmpty_101() - { - chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevice, 1); + if (mTestCount == mTestIndex) + { + ChipLogProgress(chipTool, " **** Test Complete: Test_TC_CC_4_3\n"); + SetCommandExitStatus(CHIP_NO_ERROR); + return; + } - chip::ByteSpan charStringArgument = chip::ByteSpan(chip::Uint8::from_const_char(""), strlen("")); + // Ensure we increment mTestIndex before we start running the relevant + // command. That way if we lose the timeslice after we send the message + // but before our function call returns, we won't end up with an + // incorrect mTestIndex value observed when we get the response. + switch (mTestIndex++) + { + case 0: + ChipLogProgress(chipTool, " ***** Test Step 0 : Turn on light for color control tests\n"); + err = TestTurnOnLightForColorControlTests_0(); + break; + case 1: + ChipLogProgress(chipTool, " ***** Test Step 1 : Check on/off attribute value is true after on command\n"); + err = TestCheckOnOffAttributeValueIsTrueAfterOnCommand_1(); + break; + case 2: + ChipLogProgress(chipTool, " ***** Test Step 2 : Step saturation up command\n"); + err = TestStepSaturationUpCommand_2(); + break; + case 3: + ChipLogProgress(chipTool, " ***** Test Step 3 : Step saturation down command\n"); + err = TestStepSaturationDownCommand_3(); + break; + case 4: + ChipLogProgress(chipTool, " ***** Test Step 4 : Turn off light that we turned on\n"); + err = TestTurnOffLightThatWeTurnedOn_4(); + break; + case 5: + ChipLogProgress(chipTool, " ***** Test Step 5 : Check on/off attribute value is false after off command\n"); + err = TestCheckOnOffAttributeValueIsFalseAfterOffCommand_5(); + break; + } - return cluster.WriteAttributeCharString(mOnSuccessCallback_101.Cancel(), mOnFailureCallback_101.Cancel(), - charStringArgument); + if (CHIP_NO_ERROR != err) + { + ChipLogError(chipTool, " ***** Test Failure: %s\n", chip::ErrorStr(err)); + SetCommandExitStatus(err); + } } - void OnFailureResponse_101(uint8_t status) { ThrowFailureResponse(); } +private: + std::atomic_uint16_t mTestIndex; + const uint16_t mTestCount = 6; - void OnSuccessResponse_101(chip::ByteSpan charString) { NextTest(); } + chip::Callback::Callback mOnFailureCallback_0{ OnFailureCallback_0, this }; + chip::Callback::Callback mOnSuccessCallback_0{ OnSuccessCallback_0, this }; + chip::Callback::Callback mOnFailureCallback_1{ OnFailureCallback_1, this }; + chip::Callback::Callback mOnSuccessCallback_1{ OnSuccessCallback_1, this }; + chip::Callback::Callback mOnFailureCallback_2{ OnFailureCallback_2, this }; + chip::Callback::Callback mOnSuccessCallback_2{ OnSuccessCallback_2, this }; + chip::Callback::Callback mOnFailureCallback_3{ OnFailureCallback_3, this }; + chip::Callback::Callback mOnSuccessCallback_3{ OnSuccessCallback_3, this }; + chip::Callback::Callback mOnFailureCallback_4{ OnFailureCallback_4, this }; + chip::Callback::Callback mOnSuccessCallback_4{ OnSuccessCallback_4, this }; + chip::Callback::Callback mOnFailureCallback_5{ OnFailureCallback_5, this }; + chip::Callback::Callback mOnSuccessCallback_5{ OnSuccessCallback_5, this }; - CHIP_ERROR TestReadAttributeLongCharStringDefaultValue_102() + static void OnFailureCallback_0(void * context, uint8_t status) { - chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevice, 1); - - return cluster.ReadAttributeLongCharString(mOnSuccessCallback_102.Cancel(), mOnFailureCallback_102.Cancel()); + (static_cast(context))->OnFailureResponse_0(status); } - void OnFailureResponse_102(uint8_t status) { ThrowFailureResponse(); } + static void OnSuccessCallback_0(void * context) { (static_cast(context))->OnSuccessResponse_0(); } - void OnSuccessResponse_102(chip::ByteSpan longCharString) + static void OnFailureCallback_1(void * context, uint8_t status) { - VerifyOrReturn(CheckValueAsString("longCharString", longCharString, "")); - NextTest(); + (static_cast(context))->OnFailureResponse_1(status); } - CHIP_ERROR TestWriteAttributeLongCharString_103() + static void OnSuccessCallback_1(void * context, bool onOff) { - chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevice, 1); - - chip::ByteSpan longCharStringArgument = chip::ByteSpan( - chip::Uint8::from_const_char( - "☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉" - "☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉" - "☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉"), - strlen("☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉" - "☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉" - "☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉")); - - return cluster.WriteAttributeLongCharString(mOnSuccessCallback_103.Cancel(), mOnFailureCallback_103.Cancel(), - longCharStringArgument); + (static_cast(context))->OnSuccessResponse_1(onOff); } - void OnFailureResponse_103(uint8_t status) { ThrowFailureResponse(); } - - void OnSuccessResponse_103(chip::ByteSpan longCharString) { NextTest(); } - - CHIP_ERROR TestReadAttributeLongCharString_104() + static void OnFailureCallback_2(void * context, uint8_t status) { - chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevice, 1); - - return cluster.ReadAttributeLongCharString(mOnSuccessCallback_104.Cancel(), mOnFailureCallback_104.Cancel()); + (static_cast(context))->OnFailureResponse_2(status); } - void OnFailureResponse_104(uint8_t status) { ThrowFailureResponse(); } + static void OnSuccessCallback_2(void * context) { (static_cast(context))->OnSuccessResponse_2(); } - void OnSuccessResponse_104(chip::ByteSpan longCharString) + static void OnFailureCallback_3(void * context, uint8_t status) { - VerifyOrReturn(CheckValueAsString( - "longCharString", longCharString, - "☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉" - "☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉" - "☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉")); - NextTest(); + (static_cast(context))->OnFailureResponse_3(status); } - CHIP_ERROR TestWriteAttributeLongCharString_105() + static void OnSuccessCallback_3(void * context) { (static_cast(context))->OnSuccessResponse_3(); } + + static void OnFailureCallback_4(void * context, uint8_t status) { - chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevice, 1); + (static_cast(context))->OnFailureResponse_4(status); + } - chip::ByteSpan longCharStringArgument = chip::ByteSpan(chip::Uint8::from_const_char(""), strlen("")); + static void OnSuccessCallback_4(void * context) { (static_cast(context))->OnSuccessResponse_4(); } - return cluster.WriteAttributeLongCharString(mOnSuccessCallback_105.Cancel(), mOnFailureCallback_105.Cancel(), - longCharStringArgument); + static void OnFailureCallback_5(void * context, uint8_t status) + { + (static_cast(context))->OnFailureResponse_5(status); } - void OnFailureResponse_105(uint8_t status) { ThrowFailureResponse(); } + static void OnSuccessCallback_5(void * context, bool onOff) + { + (static_cast(context))->OnSuccessResponse_5(onOff); + } - void OnSuccessResponse_105(chip::ByteSpan longCharString) { NextTest(); } + // + // Tests methods + // - CHIP_ERROR TestReadAttributeList_106() + CHIP_ERROR TestTurnOnLightForColorControlTests_0() { - chip::Controller::TestClusterClusterTest cluster; + chip::Controller::OnOffClusterTest cluster; cluster.Associate(mDevice, 1); - return cluster.ReadAttributeListInt8u(mOnSuccessCallback_106.Cancel(), mOnFailureCallback_106.Cancel()); + return cluster.On(mOnSuccessCallback_0.Cancel(), mOnFailureCallback_0.Cancel()); } - void OnFailureResponse_106(uint8_t status) { ThrowFailureResponse(); } + void OnFailureResponse_0(uint8_t status) { ThrowFailureResponse(); } - void OnSuccessResponse_106(uint16_t count, uint8_t * listInt8u) - { - VerifyOrReturn(CheckValueAsList("listInt8u", count, 4)); - NextTest(); - } + void OnSuccessResponse_0() { NextTest(); } - CHIP_ERROR TestReadAttributeListOctetString_107() + CHIP_ERROR TestCheckOnOffAttributeValueIsTrueAfterOnCommand_1() { - chip::Controller::TestClusterClusterTest cluster; + chip::Controller::OnOffClusterTest cluster; cluster.Associate(mDevice, 1); - return cluster.ReadAttributeListOctetString(mOnSuccessCallback_107.Cancel(), mOnFailureCallback_107.Cancel()); + return cluster.ReadAttributeOnOff(mOnSuccessCallback_1.Cancel(), mOnFailureCallback_1.Cancel()); } - void OnFailureResponse_107(uint8_t status) { ThrowFailureResponse(); } + void OnFailureResponse_1(uint8_t status) { ThrowFailureResponse(); } - void OnSuccessResponse_107(uint16_t count, chip::ByteSpan * listOctetString) + void OnSuccessResponse_1(bool onOff) { - VerifyOrReturn(CheckValueAsList("listOctetString", count, 4)); + VerifyOrReturn(CheckValue("onOff", onOff, 1)); NextTest(); } - CHIP_ERROR TestReadAttributeListStructOctetString_108() + CHIP_ERROR TestStepSaturationUpCommand_2() { - chip::Controller::TestClusterClusterTest cluster; + chip::Controller::ColorControlClusterTest cluster; cluster.Associate(mDevice, 1); - return cluster.ReadAttributeListStructOctetString(mOnSuccessCallback_108.Cancel(), mOnFailureCallback_108.Cancel()); + uint8_t stepModeArgument = 1; + uint8_t stepSizeArgument = 15; + uint8_t transitionTimeArgument = 10; + uint8_t optionsMaskArgument = 0; + uint8_t optionsOverrideArgument = 0; + + return cluster.StepSaturation(mOnSuccessCallback_2.Cancel(), mOnFailureCallback_2.Cancel(), stepModeArgument, + stepSizeArgument, transitionTimeArgument, optionsMaskArgument, optionsOverrideArgument); } - void OnFailureResponse_108(uint8_t status) { ThrowFailureResponse(); } + void OnFailureResponse_2(uint8_t status) { ThrowFailureResponse(); } - void OnSuccessResponse_108(uint16_t count, _TestListStructOctet * listStructOctetString) - { - VerifyOrReturn(CheckValueAsList("listStructOctetString", count, 4)); - NextTest(); - } + void OnSuccessResponse_2() { NextTest(); } - CHIP_ERROR TestReadAttributeEpochUsDefaultValue_109() + CHIP_ERROR TestStepSaturationDownCommand_3() { - chip::Controller::TestClusterClusterTest cluster; + chip::Controller::ColorControlClusterTest cluster; cluster.Associate(mDevice, 1); - return cluster.ReadAttributeEpochUs(mOnSuccessCallback_109.Cancel(), mOnFailureCallback_109.Cancel()); + uint8_t stepModeArgument = 3; + uint8_t stepSizeArgument = 20; + uint8_t transitionTimeArgument = 10; + uint8_t optionsMaskArgument = 0; + uint8_t optionsOverrideArgument = 0; + + return cluster.StepSaturation(mOnSuccessCallback_3.Cancel(), mOnFailureCallback_3.Cancel(), stepModeArgument, + stepSizeArgument, transitionTimeArgument, optionsMaskArgument, optionsOverrideArgument); } - void OnFailureResponse_109(uint8_t status) { ThrowFailureResponse(); } + void OnFailureResponse_3(uint8_t status) { ThrowFailureResponse(); } - void OnSuccessResponse_109(uint64_t epochUs) - { - VerifyOrReturn(CheckValue("epochUs", epochUs, 0ULL)); - NextTest(); - } + void OnSuccessResponse_3() { NextTest(); } - CHIP_ERROR TestWriteAttributeEpochUsMaxValue_110() + CHIP_ERROR TestTurnOffLightThatWeTurnedOn_4() { - chip::Controller::TestClusterClusterTest cluster; + chip::Controller::OnOffClusterTest cluster; cluster.Associate(mDevice, 1); - uint64_t epochUsArgument = 18446744073709551615ULL; - - return cluster.WriteAttributeEpochUs(mOnSuccessCallback_110.Cancel(), mOnFailureCallback_110.Cancel(), epochUsArgument); + return cluster.Off(mOnSuccessCallback_4.Cancel(), mOnFailureCallback_4.Cancel()); } - void OnFailureResponse_110(uint8_t status) { ThrowFailureResponse(); } + void OnFailureResponse_4(uint8_t status) { ThrowFailureResponse(); } - void OnSuccessResponse_110(uint64_t epochUs) { NextTest(); } + void OnSuccessResponse_4() { NextTest(); } - CHIP_ERROR TestReadAttributeEpochUsMaxValue_111() + CHIP_ERROR TestCheckOnOffAttributeValueIsFalseAfterOffCommand_5() { - chip::Controller::TestClusterClusterTest cluster; + chip::Controller::OnOffClusterTest cluster; cluster.Associate(mDevice, 1); - return cluster.ReadAttributeEpochUs(mOnSuccessCallback_111.Cancel(), mOnFailureCallback_111.Cancel()); + return cluster.ReadAttributeOnOff(mOnSuccessCallback_5.Cancel(), mOnFailureCallback_5.Cancel()); } - void OnFailureResponse_111(uint8_t status) { ThrowFailureResponse(); } + void OnFailureResponse_5(uint8_t status) { ThrowFailureResponse(); } - void OnSuccessResponse_111(uint64_t epochUs) + void OnSuccessResponse_5(bool onOff) { - VerifyOrReturn(CheckValue("epochUs", epochUs, 18446744073709551615ULL)); + VerifyOrReturn(CheckValue("onOff", onOff, 0)); NextTest(); } +}; - CHIP_ERROR TestWriteAttributeEpochUsMinValue_112() - { - chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevice, 1); - - uint64_t epochUsArgument = 0ULL; +class Test_TC_CC_4_4 : public TestCommand +{ +public: + Test_TC_CC_4_4() : TestCommand("Test_TC_CC_4_4"), mTestIndex(0) {} - return cluster.WriteAttributeEpochUs(mOnSuccessCallback_112.Cancel(), mOnFailureCallback_112.Cancel(), epochUsArgument); - } + /////////// TestCommand Interface ///////// + void NextTest() override + { + CHIP_ERROR err = CHIP_NO_ERROR; - void OnFailureResponse_112(uint8_t status) { ThrowFailureResponse(); } + if (0 == mTestIndex) + { + ChipLogProgress(chipTool, " **** Test Start: Test_TC_CC_4_4\n"); + } - void OnSuccessResponse_112(uint64_t epochUs) { NextTest(); } + if (mTestCount == mTestIndex) + { + ChipLogProgress(chipTool, " **** Test Complete: Test_TC_CC_4_4\n"); + SetCommandExitStatus(CHIP_NO_ERROR); + return; + } - CHIP_ERROR TestReadAttributeEpochUsMinValue_113() - { - chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevice, 1); + // Ensure we increment mTestIndex before we start running the relevant + // command. That way if we lose the timeslice after we send the message + // but before our function call returns, we won't end up with an + // incorrect mTestIndex value observed when we get the response. + switch (mTestIndex++) + { + case 0: + ChipLogProgress(chipTool, " ***** Test Step 0 : Turn on light for color control tests\n"); + err = TestTurnOnLightForColorControlTests_0(); + break; + case 1: + ChipLogProgress(chipTool, " ***** Test Step 1 : Check on/off attribute value is true after on command\n"); + err = TestCheckOnOffAttributeValueIsTrueAfterOnCommand_1(); + break; + case 2: + ChipLogProgress(chipTool, " ***** Test Step 2 : Move To current hue and saturation command\n"); + err = TestMoveToCurrentHueAndSaturationCommand_2(); + break; + case 3: + ChipLogProgress(chipTool, " ***** Test Step 3 : Turn off light that we turned on\n"); + err = TestTurnOffLightThatWeTurnedOn_3(); + break; + case 4: + ChipLogProgress(chipTool, " ***** Test Step 4 : Check on/off attribute value is false after off command\n"); + err = TestCheckOnOffAttributeValueIsFalseAfterOffCommand_4(); + break; + } - return cluster.ReadAttributeEpochUs(mOnSuccessCallback_113.Cancel(), mOnFailureCallback_113.Cancel()); + if (CHIP_NO_ERROR != err) + { + ChipLogError(chipTool, " ***** Test Failure: %s\n", chip::ErrorStr(err)); + SetCommandExitStatus(err); + } } - void OnFailureResponse_113(uint8_t status) { ThrowFailureResponse(); } +private: + std::atomic_uint16_t mTestIndex; + const uint16_t mTestCount = 5; - void OnSuccessResponse_113(uint64_t epochUs) + chip::Callback::Callback mOnFailureCallback_0{ OnFailureCallback_0, this }; + chip::Callback::Callback mOnSuccessCallback_0{ OnSuccessCallback_0, this }; + chip::Callback::Callback mOnFailureCallback_1{ OnFailureCallback_1, this }; + chip::Callback::Callback mOnSuccessCallback_1{ OnSuccessCallback_1, this }; + chip::Callback::Callback mOnFailureCallback_2{ OnFailureCallback_2, this }; + chip::Callback::Callback mOnSuccessCallback_2{ OnSuccessCallback_2, this }; + chip::Callback::Callback mOnFailureCallback_3{ OnFailureCallback_3, this }; + chip::Callback::Callback mOnSuccessCallback_3{ OnSuccessCallback_3, this }; + chip::Callback::Callback mOnFailureCallback_4{ OnFailureCallback_4, this }; + chip::Callback::Callback mOnSuccessCallback_4{ OnSuccessCallback_4, this }; + + static void OnFailureCallback_0(void * context, uint8_t status) { - VerifyOrReturn(CheckValue("epochUs", epochUs, 0ULL)); - NextTest(); + (static_cast(context))->OnFailureResponse_0(status); } - CHIP_ERROR TestReadAttributeEpochSDefaultValue_114() - { - chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevice, 1); + static void OnSuccessCallback_0(void * context) { (static_cast(context))->OnSuccessResponse_0(); } - return cluster.ReadAttributeEpochS(mOnSuccessCallback_114.Cancel(), mOnFailureCallback_114.Cancel()); + static void OnFailureCallback_1(void * context, uint8_t status) + { + (static_cast(context))->OnFailureResponse_1(status); } - void OnFailureResponse_114(uint8_t status) { ThrowFailureResponse(); } - - void OnSuccessResponse_114(uint32_t epochS) + static void OnSuccessCallback_1(void * context, bool onOff) { - VerifyOrReturn(CheckValue("epochS", epochS, 0UL)); - NextTest(); + (static_cast(context))->OnSuccessResponse_1(onOff); } - CHIP_ERROR TestWriteAttributeEpochSMaxValue_115() + static void OnFailureCallback_2(void * context, uint8_t status) { - chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevice, 1); + (static_cast(context))->OnFailureResponse_2(status); + } - uint32_t epochSArgument = 4294967295UL; + static void OnSuccessCallback_2(void * context) { (static_cast(context))->OnSuccessResponse_2(); } - return cluster.WriteAttributeEpochS(mOnSuccessCallback_115.Cancel(), mOnFailureCallback_115.Cancel(), epochSArgument); + static void OnFailureCallback_3(void * context, uint8_t status) + { + (static_cast(context))->OnFailureResponse_3(status); } - void OnFailureResponse_115(uint8_t status) { ThrowFailureResponse(); } - - void OnSuccessResponse_115(uint32_t epochS) { NextTest(); } + static void OnSuccessCallback_3(void * context) { (static_cast(context))->OnSuccessResponse_3(); } - CHIP_ERROR TestReadAttributeEpochSMaxValue_116() + static void OnFailureCallback_4(void * context, uint8_t status) { - chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevice, 1); - - return cluster.ReadAttributeEpochS(mOnSuccessCallback_116.Cancel(), mOnFailureCallback_116.Cancel()); + (static_cast(context))->OnFailureResponse_4(status); } - void OnFailureResponse_116(uint8_t status) { ThrowFailureResponse(); } - - void OnSuccessResponse_116(uint32_t epochS) + static void OnSuccessCallback_4(void * context, bool onOff) { - VerifyOrReturn(CheckValue("epochS", epochS, 4294967295UL)); - NextTest(); + (static_cast(context))->OnSuccessResponse_4(onOff); } - CHIP_ERROR TestWriteAttributeEpochSMinValue_117() + // + // Tests methods + // + + CHIP_ERROR TestTurnOnLightForColorControlTests_0() { - chip::Controller::TestClusterClusterTest cluster; + chip::Controller::OnOffClusterTest cluster; cluster.Associate(mDevice, 1); - uint32_t epochSArgument = 0UL; - - return cluster.WriteAttributeEpochS(mOnSuccessCallback_117.Cancel(), mOnFailureCallback_117.Cancel(), epochSArgument); + return cluster.On(mOnSuccessCallback_0.Cancel(), mOnFailureCallback_0.Cancel()); } - void OnFailureResponse_117(uint8_t status) { ThrowFailureResponse(); } + void OnFailureResponse_0(uint8_t status) { ThrowFailureResponse(); } - void OnSuccessResponse_117(uint32_t epochS) { NextTest(); } + void OnSuccessResponse_0() { NextTest(); } - CHIP_ERROR TestReadAttributeEpochSMinValue_118() + CHIP_ERROR TestCheckOnOffAttributeValueIsTrueAfterOnCommand_1() { - chip::Controller::TestClusterClusterTest cluster; + chip::Controller::OnOffClusterTest cluster; cluster.Associate(mDevice, 1); - return cluster.ReadAttributeEpochS(mOnSuccessCallback_118.Cancel(), mOnFailureCallback_118.Cancel()); + return cluster.ReadAttributeOnOff(mOnSuccessCallback_1.Cancel(), mOnFailureCallback_1.Cancel()); } - void OnFailureResponse_118(uint8_t status) { ThrowFailureResponse(); } + void OnFailureResponse_1(uint8_t status) { ThrowFailureResponse(); } - void OnSuccessResponse_118(uint32_t epochS) + void OnSuccessResponse_1(bool onOff) { - VerifyOrReturn(CheckValue("epochS", epochS, 0UL)); + VerifyOrReturn(CheckValue("onOff", onOff, 1)); NextTest(); } - CHIP_ERROR TestReadAttributeUnsupported_119() + CHIP_ERROR TestMoveToCurrentHueAndSaturationCommand_2() { - chip::Controller::TestClusterClusterTest cluster; + chip::Controller::ColorControlClusterTest cluster; cluster.Associate(mDevice, 1); - return cluster.ReadAttributeUnsupported(mOnSuccessCallback_119.Cancel(), mOnFailureCallback_119.Cancel()); - } + uint8_t hueArgument = 40; + uint8_t saturationArgument = 160; + uint16_t transitionTimeArgument = 10U; + uint8_t optionsMaskArgument = 0; + uint8_t optionsOverrideArgument = 0; - void OnFailureResponse_119(uint8_t status) - { - (status == EMBER_ZCL_STATUS_UNSUPPORTED_ATTRIBUTE) ? NextTest() : ThrowFailureResponse(); + return cluster.MoveToHueAndSaturation(mOnSuccessCallback_2.Cancel(), mOnFailureCallback_2.Cancel(), hueArgument, + saturationArgument, transitionTimeArgument, optionsMaskArgument, + optionsOverrideArgument); } - void OnSuccessResponse_119(bool unsupported) - { - VerifyOrReturn(CheckValue("unsupported", unsupported, 0)); - NextTest(); - } + void OnFailureResponse_2(uint8_t status) { ThrowFailureResponse(); } - CHIP_ERROR TestWriteattributeUnsupported_120() + void OnSuccessResponse_2() { NextTest(); } + + CHIP_ERROR TestTurnOffLightThatWeTurnedOn_3() { - chip::Controller::TestClusterClusterTest cluster; + chip::Controller::OnOffClusterTest cluster; cluster.Associate(mDevice, 1); - bool unsupportedArgument = 0; - - return cluster.WriteAttributeUnsupported(mOnSuccessCallback_120.Cancel(), mOnFailureCallback_120.Cancel(), - unsupportedArgument); + return cluster.Off(mOnSuccessCallback_3.Cancel(), mOnFailureCallback_3.Cancel()); } - void OnFailureResponse_120(uint8_t status) - { - (status == EMBER_ZCL_STATUS_UNSUPPORTED_ATTRIBUTE) ? NextTest() : ThrowFailureResponse(); - } + void OnFailureResponse_3(uint8_t status) { ThrowFailureResponse(); } - void OnSuccessResponse_120(bool unsupported) { NextTest(); } + void OnSuccessResponse_3() { NextTest(); } - CHIP_ERROR TestSendTestCommandToUnsupportedEndpoint_121() + CHIP_ERROR TestCheckOnOffAttributeValueIsFalseAfterOffCommand_4() { - chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevice, 200); + chip::Controller::OnOffClusterTest cluster; + cluster.Associate(mDevice, 1); - return cluster.Test(mOnSuccessCallback_121.Cancel(), mOnFailureCallback_121.Cancel()); + return cluster.ReadAttributeOnOff(mOnSuccessCallback_4.Cancel(), mOnFailureCallback_4.Cancel()); } - void OnFailureResponse_121(uint8_t status) { NextTest(); } + void OnFailureResponse_4(uint8_t status) { ThrowFailureResponse(); } - void OnSuccessResponse_121() { ThrowSuccessResponse(); } + void OnSuccessResponse_4(bool onOff) + { + VerifyOrReturn(CheckValue("onOff", onOff, 0)); + NextTest(); + } }; -class TestConstraints : public TestCommand +class Test_TC_CC_5_1 : public TestCommand { public: - TestConstraints() : TestCommand("TestConstraints"), mTestIndex(0) {} + Test_TC_CC_5_1() : TestCommand("Test_TC_CC_5_1"), mTestIndex(0) {} /////////// TestCommand Interface ///////// void NextTest() override @@ -5638,12 +6520,12 @@ class TestConstraints : public TestCommand if (0 == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Start: TestConstraints\n"); + ChipLogProgress(chipTool, " **** Test Start: Test_TC_CC_5_1\n"); } if (mTestCount == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Complete: TestConstraints\n"); + ChipLogProgress(chipTool, " **** Test Complete: Test_TC_CC_5_1\n"); SetCommandExitStatus(CHIP_NO_ERROR); return; } @@ -5655,20 +6537,24 @@ class TestConstraints : public TestCommand switch (mTestIndex++) { case 0: - ChipLogProgress(chipTool, " ***** Test Step 0 : Write attribute INT32U Value\n"); - err = TestWriteAttributeInt32uValue_0(); + ChipLogProgress(chipTool, " ***** Test Step 0 : Turn on light for color control tests\n"); + err = TestTurnOnLightForColorControlTests_0(); break; case 1: - ChipLogProgress(chipTool, " ***** Test Step 1 : Read attribute INT32U Value MinValue Constraints\n"); - err = TestReadAttributeInt32uValueMinValueConstraints_1(); + ChipLogProgress(chipTool, " ***** Test Step 1 : Check on/off attribute value is true after on command\n"); + err = TestCheckOnOffAttributeValueIsTrueAfterOnCommand_1(); break; case 2: - ChipLogProgress(chipTool, " ***** Test Step 2 : Read attribute INT32U Value MaxValue Constraints\n"); - err = TestReadAttributeInt32uValueMaxValueConstraints_2(); + ChipLogProgress(chipTool, " ***** Test Step 2 : Move to Color command\n"); + err = TestMoveToColorCommand_2(); break; case 3: - ChipLogProgress(chipTool, " ***** Test Step 3 : Read attribute INT32U Value NotValue Constraints\n"); - err = TestReadAttributeInt32uValueNotValueConstraints_3(); + ChipLogProgress(chipTool, " ***** Test Step 3 : Turn off light that we turned on\n"); + err = TestTurnOffLightThatWeTurnedOn_3(); + break; + case 4: + ChipLogProgress(chipTool, " ***** Test Step 4 : Check on/off attribute value is false after off command\n"); + err = TestCheckOnOffAttributeValueIsFalseAfterOffCommand_4(); break; } @@ -5681,180 +6567,144 @@ class TestConstraints : public TestCommand private: std::atomic_uint16_t mTestIndex; - const uint16_t mTestCount = 4; + const uint16_t mTestCount = 5; chip::Callback::Callback mOnFailureCallback_0{ OnFailureCallback_0, this }; - chip::Callback::Callback mOnSuccessCallback_0{ OnSuccessCallback_0, this }; + chip::Callback::Callback mOnSuccessCallback_0{ OnSuccessCallback_0, this }; chip::Callback::Callback mOnFailureCallback_1{ OnFailureCallback_1, this }; - chip::Callback::Callback mOnSuccessCallback_1{ OnSuccessCallback_1, this }; + chip::Callback::Callback mOnSuccessCallback_1{ OnSuccessCallback_1, this }; chip::Callback::Callback mOnFailureCallback_2{ OnFailureCallback_2, this }; - chip::Callback::Callback mOnSuccessCallback_2{ OnSuccessCallback_2, this }; + chip::Callback::Callback mOnSuccessCallback_2{ OnSuccessCallback_2, this }; chip::Callback::Callback mOnFailureCallback_3{ OnFailureCallback_3, this }; - chip::Callback::Callback mOnSuccessCallback_3{ OnSuccessCallback_3, this }; + chip::Callback::Callback mOnSuccessCallback_3{ OnSuccessCallback_3, this }; + chip::Callback::Callback mOnFailureCallback_4{ OnFailureCallback_4, this }; + chip::Callback::Callback mOnSuccessCallback_4{ OnSuccessCallback_4, this }; static void OnFailureCallback_0(void * context, uint8_t status) { - (static_cast(context))->OnFailureResponse_0(status); + (static_cast(context))->OnFailureResponse_0(status); } - static void OnSuccessCallback_0(void * context, uint32_t int32u) - { - (static_cast(context))->OnSuccessResponse_0(int32u); - } + static void OnSuccessCallback_0(void * context) { (static_cast(context))->OnSuccessResponse_0(); } static void OnFailureCallback_1(void * context, uint8_t status) { - (static_cast(context))->OnFailureResponse_1(status); + (static_cast(context))->OnFailureResponse_1(status); } - static void OnSuccessCallback_1(void * context, uint32_t int32u) + static void OnSuccessCallback_1(void * context, bool onOff) { - (static_cast(context))->OnSuccessResponse_1(int32u); + (static_cast(context))->OnSuccessResponse_1(onOff); } static void OnFailureCallback_2(void * context, uint8_t status) { - (static_cast(context))->OnFailureResponse_2(status); + (static_cast(context))->OnFailureResponse_2(status); } - static void OnSuccessCallback_2(void * context, uint32_t int32u) + static void OnSuccessCallback_2(void * context) { (static_cast(context))->OnSuccessResponse_2(); } + + static void OnFailureCallback_3(void * context, uint8_t status) { - (static_cast(context))->OnSuccessResponse_2(int32u); + (static_cast(context))->OnFailureResponse_3(status); } - static void OnFailureCallback_3(void * context, uint8_t status) + static void OnSuccessCallback_3(void * context) { (static_cast(context))->OnSuccessResponse_3(); } + + static void OnFailureCallback_4(void * context, uint8_t status) { - (static_cast(context))->OnFailureResponse_3(status); + (static_cast(context))->OnFailureResponse_4(status); } - static void OnSuccessCallback_3(void * context, uint32_t int32u) + static void OnSuccessCallback_4(void * context, bool onOff) { - (static_cast(context))->OnSuccessResponse_3(int32u); + (static_cast(context))->OnSuccessResponse_4(onOff); } // // Tests methods // - CHIP_ERROR TestWriteAttributeInt32uValue_0() + CHIP_ERROR TestTurnOnLightForColorControlTests_0() { - chip::Controller::TestClusterClusterTest cluster; + chip::Controller::OnOffClusterTest cluster; cluster.Associate(mDevice, 1); - uint32_t int32uArgument = 5UL; - - return cluster.WriteAttributeInt32u(mOnSuccessCallback_0.Cancel(), mOnFailureCallback_0.Cancel(), int32uArgument); + return cluster.On(mOnSuccessCallback_0.Cancel(), mOnFailureCallback_0.Cancel()); } void OnFailureResponse_0(uint8_t status) { ThrowFailureResponse(); } - void OnSuccessResponse_0(uint32_t int32u) { NextTest(); } + void OnSuccessResponse_0() { NextTest(); } - CHIP_ERROR TestReadAttributeInt32uValueMinValueConstraints_1() + CHIP_ERROR TestCheckOnOffAttributeValueIsTrueAfterOnCommand_1() { - chip::Controller::TestClusterClusterTest cluster; + chip::Controller::OnOffClusterTest cluster; cluster.Associate(mDevice, 1); - return cluster.ReadAttributeInt32u(mOnSuccessCallback_1.Cancel(), mOnFailureCallback_1.Cancel()); + return cluster.ReadAttributeOnOff(mOnSuccessCallback_1.Cancel(), mOnFailureCallback_1.Cancel()); } void OnFailureResponse_1(uint8_t status) { ThrowFailureResponse(); } - void OnSuccessResponse_1(uint32_t int32u) - { - VerifyOrReturn(CheckConstraintMinValue("int32u", int32u, 5)); - NextTest(); - } - - CHIP_ERROR TestReadAttributeInt32uValueMaxValueConstraints_2() - { - chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevice, 1); - - return cluster.ReadAttributeInt32u(mOnSuccessCallback_2.Cancel(), mOnFailureCallback_2.Cancel()); - } - - void OnFailureResponse_2(uint8_t status) { ThrowFailureResponse(); } - - void OnSuccessResponse_2(uint32_t int32u) + void OnSuccessResponse_1(bool onOff) { - VerifyOrReturn(CheckConstraintMaxValue("int32u", int32u, 5)); + VerifyOrReturn(CheckValue("onOff", onOff, 1)); NextTest(); } - CHIP_ERROR TestReadAttributeInt32uValueNotValueConstraints_3() + CHIP_ERROR TestMoveToColorCommand_2() { - chip::Controller::TestClusterClusterTest cluster; + chip::Controller::ColorControlClusterTest cluster; cluster.Associate(mDevice, 1); - return cluster.ReadAttributeInt32u(mOnSuccessCallback_3.Cancel(), mOnFailureCallback_3.Cancel()); - } - - void OnFailureResponse_3(uint8_t status) { ThrowFailureResponse(); } + uint16_t colorXArgument = 200U; + uint16_t colorYArgument = 300U; + uint16_t transitionTimeArgument = 20U; + uint8_t optionsMaskArgument = 0; + uint8_t optionsOverrideArgument = 0; - void OnSuccessResponse_3(uint32_t int32u) - { - VerifyOrReturn(CheckConstraintNotValue("int32u", int32u, 6)); - NextTest(); + return cluster.MoveToColor(mOnSuccessCallback_2.Cancel(), mOnFailureCallback_2.Cancel(), colorXArgument, colorYArgument, + transitionTimeArgument, optionsMaskArgument, optionsOverrideArgument); } -}; - -class TestDelayCommands : public TestCommand -{ -public: - TestDelayCommands() : TestCommand("TestDelayCommands"), mTestIndex(0) {} - /////////// TestCommand Interface ///////// - void NextTest() override + void OnFailureResponse_2(uint8_t status) { ThrowFailureResponse(); } + + void OnSuccessResponse_2() { NextTest(); } + + CHIP_ERROR TestTurnOffLightThatWeTurnedOn_3() { - CHIP_ERROR err = CHIP_NO_ERROR; + chip::Controller::OnOffClusterTest cluster; + cluster.Associate(mDevice, 1); - if (0 == mTestIndex) - { - ChipLogProgress(chipTool, " **** Test Start: TestDelayCommands\n"); - } + return cluster.Off(mOnSuccessCallback_3.Cancel(), mOnFailureCallback_3.Cancel()); + } - if (mTestCount == mTestIndex) - { - ChipLogProgress(chipTool, " **** Test Complete: TestDelayCommands\n"); - SetCommandExitStatus(CHIP_NO_ERROR); - return; - } + void OnFailureResponse_3(uint8_t status) { ThrowFailureResponse(); } - // Ensure we increment mTestIndex before we start running the relevant - // command. That way if we lose the timeslice after we send the message - // but before our function call returns, we won't end up with an - // incorrect mTestIndex value observed when we get the response. - switch (mTestIndex++) - { - case 0: - ChipLogProgress(chipTool, " ***** Test Step 0 : Wait 100ms\n"); - err = TestWait100ms_0(); - break; - } + void OnSuccessResponse_3() { NextTest(); } - if (CHIP_NO_ERROR != err) - { - ChipLogError(chipTool, " ***** Test Failure: %s\n", chip::ErrorStr(err)); - SetCommandExitStatus(err); - } - } + CHIP_ERROR TestCheckOnOffAttributeValueIsFalseAfterOffCommand_4() + { + chip::Controller::OnOffClusterTest cluster; + cluster.Associate(mDevice, 1); -private: - std::atomic_uint16_t mTestIndex; - const uint16_t mTestCount = 1; + return cluster.ReadAttributeOnOff(mOnSuccessCallback_4.Cancel(), mOnFailureCallback_4.Cancel()); + } - // - // Tests methods - // + void OnFailureResponse_4(uint8_t status) { ThrowFailureResponse(); } - CHIP_ERROR TestWait100ms_0() { return WaitForMs(100); } + void OnSuccessResponse_4(bool onOff) + { + VerifyOrReturn(CheckValue("onOff", onOff, 0)); + NextTest(); + } }; -class TestDescriptorCluster : public TestCommand +class Test_TC_CC_5_2 : public TestCommand { public: - TestDescriptorCluster() : TestCommand("TestDescriptorCluster"), mTestIndex(0) {} + Test_TC_CC_5_2() : TestCommand("Test_TC_CC_5_2"), mTestIndex(0) {} /////////// TestCommand Interface ///////// void NextTest() override @@ -5863,12 +6713,12 @@ class TestDescriptorCluster : public TestCommand if (0 == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Start: TestDescriptorCluster\n"); + ChipLogProgress(chipTool, " **** Test Start: Test_TC_CC_5_2\n"); } if (mTestCount == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Complete: TestDescriptorCluster\n"); + ChipLogProgress(chipTool, " **** Test Complete: Test_TC_CC_5_2\n"); SetCommandExitStatus(CHIP_NO_ERROR); return; } @@ -5880,20 +6730,28 @@ class TestDescriptorCluster : public TestCommand switch (mTestIndex++) { case 0: - ChipLogProgress(chipTool, " ***** Test Step 0 : Read attribute Device list\n"); - err = TestReadAttributeDeviceList_0(); + ChipLogProgress(chipTool, " ***** Test Step 0 : Turn on light for color control tests\n"); + err = TestTurnOnLightForColorControlTests_0(); break; case 1: - ChipLogProgress(chipTool, " ***** Test Step 1 : Read attribute Server list\n"); - err = TestReadAttributeServerList_1(); + ChipLogProgress(chipTool, " ***** Test Step 1 : Check on/off attribute value is true after on command\n"); + err = TestCheckOnOffAttributeValueIsTrueAfterOnCommand_1(); break; case 2: - ChipLogProgress(chipTool, " ***** Test Step 2 : Read attribute Client list\n"); - err = TestReadAttributeClientList_2(); + ChipLogProgress(chipTool, " ***** Test Step 2 : Move Color command\n"); + err = TestMoveColorCommand_2(); break; case 3: - ChipLogProgress(chipTool, " ***** Test Step 3 : Read attribute Parts list\n"); - err = TestReadAttributePartsList_3(); + ChipLogProgress(chipTool, " ***** Test Step 3 : Stop Move Step command\n"); + err = TestStopMoveStepCommand_3(); + break; + case 4: + ChipLogProgress(chipTool, " ***** Test Step 4 : Turn off light that we turned on\n"); + err = TestTurnOffLightThatWeTurnedOn_4(); + break; + case 5: + ChipLogProgress(chipTool, " ***** Test Step 5 : Check on/off attribute value is false after off command\n"); + err = TestCheckOnOffAttributeValueIsFalseAfterOffCommand_5(); break; } @@ -5906,138 +6764,168 @@ class TestDescriptorCluster : public TestCommand private: std::atomic_uint16_t mTestIndex; - const uint16_t mTestCount = 4; + const uint16_t mTestCount = 6; chip::Callback::Callback mOnFailureCallback_0{ OnFailureCallback_0, this }; - chip::Callback::Callback mOnSuccessCallback_0{ - OnSuccessCallback_0, this - }; + chip::Callback::Callback mOnSuccessCallback_0{ OnSuccessCallback_0, this }; chip::Callback::Callback mOnFailureCallback_1{ OnFailureCallback_1, this }; - chip::Callback::Callback mOnSuccessCallback_1{ - OnSuccessCallback_1, this - }; + chip::Callback::Callback mOnSuccessCallback_1{ OnSuccessCallback_1, this }; chip::Callback::Callback mOnFailureCallback_2{ OnFailureCallback_2, this }; - chip::Callback::Callback mOnSuccessCallback_2{ - OnSuccessCallback_2, this - }; + chip::Callback::Callback mOnSuccessCallback_2{ OnSuccessCallback_2, this }; chip::Callback::Callback mOnFailureCallback_3{ OnFailureCallback_3, this }; - chip::Callback::Callback mOnSuccessCallback_3{ - OnSuccessCallback_3, this - }; + chip::Callback::Callback mOnSuccessCallback_3{ OnSuccessCallback_3, this }; + chip::Callback::Callback mOnFailureCallback_4{ OnFailureCallback_4, this }; + chip::Callback::Callback mOnSuccessCallback_4{ OnSuccessCallback_4, this }; + chip::Callback::Callback mOnFailureCallback_5{ OnFailureCallback_5, this }; + chip::Callback::Callback mOnSuccessCallback_5{ OnSuccessCallback_5, this }; static void OnFailureCallback_0(void * context, uint8_t status) { - (static_cast(context))->OnFailureResponse_0(status); + (static_cast(context))->OnFailureResponse_0(status); } - static void OnSuccessCallback_0(void * context, uint16_t count, _DeviceType * deviceList) - { - (static_cast(context))->OnSuccessResponse_0(count, deviceList); - } + static void OnSuccessCallback_0(void * context) { (static_cast(context))->OnSuccessResponse_0(); } static void OnFailureCallback_1(void * context, uint8_t status) { - (static_cast(context))->OnFailureResponse_1(status); + (static_cast(context))->OnFailureResponse_1(status); } - static void OnSuccessCallback_1(void * context, uint16_t count, chip::ClusterId * serverList) + static void OnSuccessCallback_1(void * context, bool onOff) { - (static_cast(context))->OnSuccessResponse_1(count, serverList); + (static_cast(context))->OnSuccessResponse_1(onOff); } static void OnFailureCallback_2(void * context, uint8_t status) { - (static_cast(context))->OnFailureResponse_2(status); + (static_cast(context))->OnFailureResponse_2(status); } - static void OnSuccessCallback_2(void * context, uint16_t count, chip::ClusterId * clientList) + static void OnSuccessCallback_2(void * context) { (static_cast(context))->OnSuccessResponse_2(); } + + static void OnFailureCallback_3(void * context, uint8_t status) { - (static_cast(context))->OnSuccessResponse_2(count, clientList); + (static_cast(context))->OnFailureResponse_3(status); } - static void OnFailureCallback_3(void * context, uint8_t status) + static void OnSuccessCallback_3(void * context) { (static_cast(context))->OnSuccessResponse_3(); } + + static void OnFailureCallback_4(void * context, uint8_t status) { - (static_cast(context))->OnFailureResponse_3(status); + (static_cast(context))->OnFailureResponse_4(status); } - static void OnSuccessCallback_3(void * context, uint16_t count, chip::EndpointId * partsList) + static void OnSuccessCallback_4(void * context) { (static_cast(context))->OnSuccessResponse_4(); } + + static void OnFailureCallback_5(void * context, uint8_t status) { - (static_cast(context))->OnSuccessResponse_3(count, partsList); + (static_cast(context))->OnFailureResponse_5(status); + } + + static void OnSuccessCallback_5(void * context, bool onOff) + { + (static_cast(context))->OnSuccessResponse_5(onOff); } // // Tests methods // - CHIP_ERROR TestReadAttributeDeviceList_0() + CHIP_ERROR TestTurnOnLightForColorControlTests_0() { - chip::Controller::DescriptorClusterTest cluster; - cluster.Associate(mDevice, 0); + chip::Controller::OnOffClusterTest cluster; + cluster.Associate(mDevice, 1); - return cluster.ReadAttributeDeviceList(mOnSuccessCallback_0.Cancel(), mOnFailureCallback_0.Cancel()); + return cluster.On(mOnSuccessCallback_0.Cancel(), mOnFailureCallback_0.Cancel()); } void OnFailureResponse_0(uint8_t status) { ThrowFailureResponse(); } - void OnSuccessResponse_0(uint16_t count, _DeviceType * deviceList) - { - VerifyOrReturn(CheckValueAsList("deviceList", count, 1)); - NextTest(); - } + void OnSuccessResponse_0() { NextTest(); } - CHIP_ERROR TestReadAttributeServerList_1() + CHIP_ERROR TestCheckOnOffAttributeValueIsTrueAfterOnCommand_1() { - chip::Controller::DescriptorClusterTest cluster; - cluster.Associate(mDevice, 0); + chip::Controller::OnOffClusterTest cluster; + cluster.Associate(mDevice, 1); - return cluster.ReadAttributeServerList(mOnSuccessCallback_1.Cancel(), mOnFailureCallback_1.Cancel()); + return cluster.ReadAttributeOnOff(mOnSuccessCallback_1.Cancel(), mOnFailureCallback_1.Cancel()); } void OnFailureResponse_1(uint8_t status) { ThrowFailureResponse(); } - void OnSuccessResponse_1(uint16_t count, chip::ClusterId * serverList) + void OnSuccessResponse_1(bool onOff) { - VerifyOrReturn(CheckValueAsList("serverList", count, 18)); + VerifyOrReturn(CheckValue("onOff", onOff, 1)); NextTest(); } - CHIP_ERROR TestReadAttributeClientList_2() + CHIP_ERROR TestMoveColorCommand_2() { - chip::Controller::DescriptorClusterTest cluster; - cluster.Associate(mDevice, 0); + chip::Controller::ColorControlClusterTest cluster; + cluster.Associate(mDevice, 1); - return cluster.ReadAttributeClientList(mOnSuccessCallback_2.Cancel(), mOnFailureCallback_2.Cancel()); + int16_t rateXArgument = 15; + int16_t rateYArgument = 20; + uint8_t optionsMaskArgument = 0; + uint8_t optionsOverrideArgument = 0; + + return cluster.MoveColor(mOnSuccessCallback_2.Cancel(), mOnFailureCallback_2.Cancel(), rateXArgument, rateYArgument, + optionsMaskArgument, optionsOverrideArgument); } void OnFailureResponse_2(uint8_t status) { ThrowFailureResponse(); } - void OnSuccessResponse_2(uint16_t count, chip::ClusterId * clientList) + void OnSuccessResponse_2() { NextTest(); } + + CHIP_ERROR TestStopMoveStepCommand_3() { - VerifyOrReturn(CheckValueAsList("clientList", count, 0)); - NextTest(); + chip::Controller::ColorControlClusterTest cluster; + cluster.Associate(mDevice, 1); + + uint8_t optionsMaskArgument = 0; + uint8_t optionsOverrideArgument = 0; + + return cluster.StopMoveStep(mOnSuccessCallback_3.Cancel(), mOnFailureCallback_3.Cancel(), optionsMaskArgument, + optionsOverrideArgument); } - CHIP_ERROR TestReadAttributePartsList_3() + void OnFailureResponse_3(uint8_t status) { ThrowFailureResponse(); } + + void OnSuccessResponse_3() { NextTest(); } + + CHIP_ERROR TestTurnOffLightThatWeTurnedOn_4() { - chip::Controller::DescriptorClusterTest cluster; - cluster.Associate(mDevice, 0); + chip::Controller::OnOffClusterTest cluster; + cluster.Associate(mDevice, 1); - return cluster.ReadAttributePartsList(mOnSuccessCallback_3.Cancel(), mOnFailureCallback_3.Cancel()); + return cluster.Off(mOnSuccessCallback_4.Cancel(), mOnFailureCallback_4.Cancel()); } - void OnFailureResponse_3(uint8_t status) { ThrowFailureResponse(); } + void OnFailureResponse_4(uint8_t status) { ThrowFailureResponse(); } - void OnSuccessResponse_3(uint16_t count, chip::EndpointId * partsList) + void OnSuccessResponse_4() { NextTest(); } + + CHIP_ERROR TestCheckOnOffAttributeValueIsFalseAfterOffCommand_5() { - VerifyOrReturn(CheckValueAsList("partsList", count, 2)); + chip::Controller::OnOffClusterTest cluster; + cluster.Associate(mDevice, 1); + + return cluster.ReadAttributeOnOff(mOnSuccessCallback_5.Cancel(), mOnFailureCallback_5.Cancel()); + } + + void OnFailureResponse_5(uint8_t status) { ThrowFailureResponse(); } + + void OnSuccessResponse_5(bool onOff) + { + VerifyOrReturn(CheckValue("onOff", onOff, 0)); NextTest(); } }; -class TestSubscribe_OnOff : public TestCommand +class Test_TC_CC_5_3 : public TestCommand { public: - TestSubscribe_OnOff() : TestCommand("TestSubscribe_OnOff"), mTestIndex(0) {} + Test_TC_CC_5_3() : TestCommand("Test_TC_CC_5_3"), mTestIndex(0) {} /////////// TestCommand Interface ///////// void NextTest() override @@ -6046,12 +6934,12 @@ class TestSubscribe_OnOff : public TestCommand if (0 == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Start: TestSubscribe_OnOff\n"); + ChipLogProgress(chipTool, " **** Test Start: Test_TC_CC_5_3\n"); } if (mTestCount == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Complete: TestSubscribe_OnOff\n"); + ChipLogProgress(chipTool, " **** Test Complete: Test_TC_CC_5_3\n"); SetCommandExitStatus(CHIP_NO_ERROR); return; } @@ -6063,32 +6951,24 @@ class TestSubscribe_OnOff : public TestCommand switch (mTestIndex++) { case 0: - ChipLogProgress(chipTool, " ***** Test Step 0 : Set OnOff Attribute to false\n"); - err = TestSetOnOffAttributeToFalse_0(); + ChipLogProgress(chipTool, " ***** Test Step 0 : Turn on light for color control tests\n"); + err = TestTurnOnLightForColorControlTests_0(); break; case 1: - ChipLogProgress(chipTool, " ***** Test Step 1 : Report: Subscribe OnOff Attribute\n"); - err = TestReportSubscribeOnOffAttribute_1(); + ChipLogProgress(chipTool, " ***** Test Step 1 : Check on/off attribute value is true after on command\n"); + err = TestCheckOnOffAttributeValueIsTrueAfterOnCommand_1(); break; case 2: - ChipLogProgress(chipTool, " ***** Test Step 2 : Subscribe OnOff Attribute\n"); - err = TestSubscribeOnOffAttribute_2(); + ChipLogProgress(chipTool, " ***** Test Step 2 : Step Color command\n"); + err = TestStepColorCommand_2(); break; case 3: - ChipLogProgress(chipTool, " ***** Test Step 3 : Turn On the light to see attribute change\n"); - err = TestTurnOnTheLightToSeeAttributeChange_3(); + ChipLogProgress(chipTool, " ***** Test Step 3 : Turn off light that we turned on\n"); + err = TestTurnOffLightThatWeTurnedOn_3(); break; case 4: - ChipLogProgress(chipTool, " ***** Test Step 4 : Check for attribute report\n"); - err = TestCheckForAttributeReport_4(); - break; - case 5: - ChipLogProgress(chipTool, " ***** Test Step 5 : Turn Off the light to see attribute change\n"); - err = TestTurnOffTheLightToSeeAttributeChange_5(); - break; - case 6: - ChipLogProgress(chipTool, " ***** Test Step 6 : Check for attribute report\n"); - err = TestCheckForAttributeReport_6(); + ChipLogProgress(chipTool, " ***** Test Step 4 : Check on/off attribute value is false after off command\n"); + err = TestCheckOnOffAttributeValueIsFalseAfterOffCommand_4(); break; } @@ -6101,213 +6981,144 @@ class TestSubscribe_OnOff : public TestCommand private: std::atomic_uint16_t mTestIndex; - const uint16_t mTestCount = 7; + const uint16_t mTestCount = 5; chip::Callback::Callback mOnFailureCallback_0{ OnFailureCallback_0, this }; chip::Callback::Callback mOnSuccessCallback_0{ OnSuccessCallback_0, this }; chip::Callback::Callback mOnFailureCallback_1{ OnFailureCallback_1, this }; chip::Callback::Callback mOnSuccessCallback_1{ OnSuccessCallback_1, this }; chip::Callback::Callback mOnFailureCallback_2{ OnFailureCallback_2, this }; - chip::Callback::Callback mOnSuccessCallback_2{ OnSuccessCallback_2, this }; + chip::Callback::Callback mOnSuccessCallback_2{ OnSuccessCallback_2, this }; chip::Callback::Callback mOnFailureCallback_3{ OnFailureCallback_3, this }; chip::Callback::Callback mOnSuccessCallback_3{ OnSuccessCallback_3, this }; chip::Callback::Callback mOnFailureCallback_4{ OnFailureCallback_4, this }; chip::Callback::Callback mOnSuccessCallback_4{ OnSuccessCallback_4, this }; - chip::Callback::Callback mOnFailureCallback_5{ OnFailureCallback_5, this }; - chip::Callback::Callback mOnSuccessCallback_5{ OnSuccessCallback_5, this }; - chip::Callback::Callback mOnFailureCallback_6{ OnFailureCallback_6, this }; - chip::Callback::Callback mOnSuccessCallback_6{ OnSuccessCallback_6, this }; static void OnFailureCallback_0(void * context, uint8_t status) { - (static_cast(context))->OnFailureResponse_0(status); + (static_cast(context))->OnFailureResponse_0(status); } - static void OnSuccessCallback_0(void * context) { (static_cast(context))->OnSuccessResponse_0(); } + static void OnSuccessCallback_0(void * context) { (static_cast(context))->OnSuccessResponse_0(); } static void OnFailureCallback_1(void * context, uint8_t status) { - (static_cast(context))->OnFailureResponse_1(status); + (static_cast(context))->OnFailureResponse_1(status); } static void OnSuccessCallback_1(void * context, bool onOff) { - (static_cast(context))->OnSuccessResponse_1(onOff); + (static_cast(context))->OnSuccessResponse_1(onOff); } - bool mReceivedReport_1 = false; - static void OnFailureCallback_2(void * context, uint8_t status) { - (static_cast(context))->OnFailureResponse_2(status); + (static_cast(context))->OnFailureResponse_2(status); } - static void OnSuccessCallback_2(void * context, bool onOff) - { - (static_cast(context))->OnSuccessResponse_2(onOff); - } + static void OnSuccessCallback_2(void * context) { (static_cast(context))->OnSuccessResponse_2(); } static void OnFailureCallback_3(void * context, uint8_t status) { - (static_cast(context))->OnFailureResponse_3(status); + (static_cast(context))->OnFailureResponse_3(status); } - static void OnSuccessCallback_3(void * context) { (static_cast(context))->OnSuccessResponse_3(); } + static void OnSuccessCallback_3(void * context) { (static_cast(context))->OnSuccessResponse_3(); } static void OnFailureCallback_4(void * context, uint8_t status) { - (static_cast(context))->OnFailureResponse_4(status); + (static_cast(context))->OnFailureResponse_4(status); } static void OnSuccessCallback_4(void * context, bool onOff) { - (static_cast(context))->OnSuccessResponse_4(onOff); - } - - bool mReceivedReport_4 = false; - - static void OnFailureCallback_5(void * context, uint8_t status) - { - (static_cast(context))->OnFailureResponse_5(status); - } - - static void OnSuccessCallback_5(void * context) { (static_cast(context))->OnSuccessResponse_5(); } - - static void OnFailureCallback_6(void * context, uint8_t status) - { - (static_cast(context))->OnFailureResponse_6(status); - } - - static void OnSuccessCallback_6(void * context, bool onOff) - { - (static_cast(context))->OnSuccessResponse_6(onOff); + (static_cast(context))->OnSuccessResponse_4(onOff); } - bool mReceivedReport_6 = false; - // // Tests methods // - CHIP_ERROR TestSetOnOffAttributeToFalse_0() + CHIP_ERROR TestTurnOnLightForColorControlTests_0() { chip::Controller::OnOffClusterTest cluster; cluster.Associate(mDevice, 1); - return cluster.Off(mOnSuccessCallback_0.Cancel(), mOnFailureCallback_0.Cancel()); + return cluster.On(mOnSuccessCallback_0.Cancel(), mOnFailureCallback_0.Cancel()); } void OnFailureResponse_0(uint8_t status) { ThrowFailureResponse(); } void OnSuccessResponse_0() { NextTest(); } - CHIP_ERROR TestReportSubscribeOnOffAttribute_1() + CHIP_ERROR TestCheckOnOffAttributeValueIsTrueAfterOnCommand_1() { chip::Controller::OnOffClusterTest cluster; cluster.Associate(mDevice, 1); - ReturnErrorOnFailure(cluster.ReportAttributeOnOff(mOnSuccessCallback_1.Cancel())); - return WaitForMs(0); + return cluster.ReadAttributeOnOff(mOnSuccessCallback_1.Cancel(), mOnFailureCallback_1.Cancel()); } void OnFailureResponse_1(uint8_t status) { ThrowFailureResponse(); } void OnSuccessResponse_1(bool onOff) { - VerifyOrReturn(mReceivedReport_1 == false, ChipLogError(chipTool, "Not Fatal: on report called more than once.")); - mReceivedReport_1 = true; - - VerifyOrReturn(CheckValue("onOff", onOff, false)); + VerifyOrReturn(CheckValue("onOff", onOff, 1)); + NextTest(); } - CHIP_ERROR TestSubscribeOnOffAttribute_2() + CHIP_ERROR TestStepColorCommand_2() { - chip::Controller::OnOffClusterTest cluster; + chip::Controller::ColorControlClusterTest cluster; cluster.Associate(mDevice, 1); - uint16_t minIntervalArgument = 2U; - uint16_t maxIntervalArgument = 10U; + int16_t stepXArgument = 15; + int16_t stepYArgument = 20; + uint16_t transitionTimeArgument = 50U; + uint8_t optionsMaskArgument = 0; + uint8_t optionsOverrideArgument = 0; - return cluster.SubscribeAttributeOnOff(mOnSuccessCallback_2.Cancel(), mOnFailureCallback_2.Cancel(), minIntervalArgument, - maxIntervalArgument); + return cluster.StepColor(mOnSuccessCallback_2.Cancel(), mOnFailureCallback_2.Cancel(), stepXArgument, stepYArgument, + transitionTimeArgument, optionsMaskArgument, optionsOverrideArgument); } void OnFailureResponse_2(uint8_t status) { ThrowFailureResponse(); } - void OnSuccessResponse_2(bool onOff) - { - VerifyOrReturn(mReceivedReport_1, Exit("Initial report not received!")); - - NextTest(); - } + void OnSuccessResponse_2() { NextTest(); } - CHIP_ERROR TestTurnOnTheLightToSeeAttributeChange_3() + CHIP_ERROR TestTurnOffLightThatWeTurnedOn_3() { chip::Controller::OnOffClusterTest cluster; cluster.Associate(mDevice, 1); - return cluster.On(mOnSuccessCallback_3.Cancel(), mOnFailureCallback_3.Cancel()); + return cluster.Off(mOnSuccessCallback_3.Cancel(), mOnFailureCallback_3.Cancel()); } void OnFailureResponse_3(uint8_t status) { ThrowFailureResponse(); } void OnSuccessResponse_3() { NextTest(); } - CHIP_ERROR TestCheckForAttributeReport_4() + CHIP_ERROR TestCheckOnOffAttributeValueIsFalseAfterOffCommand_4() { chip::Controller::OnOffClusterTest cluster; cluster.Associate(mDevice, 1); - return cluster.ReportAttributeOnOff(mOnSuccessCallback_4.Cancel()); + return cluster.ReadAttributeOnOff(mOnSuccessCallback_4.Cancel(), mOnFailureCallback_4.Cancel()); } void OnFailureResponse_4(uint8_t status) { ThrowFailureResponse(); } void OnSuccessResponse_4(bool onOff) { - VerifyOrReturn(mReceivedReport_4 == false, ChipLogError(chipTool, "Not Fatal: on report called more than once.")); - mReceivedReport_4 = true; - - VerifyOrReturn(CheckValue("onOff", onOff, true)); - NextTest(); - } - - CHIP_ERROR TestTurnOffTheLightToSeeAttributeChange_5() - { - chip::Controller::OnOffClusterTest cluster; - cluster.Associate(mDevice, 1); - - return cluster.Off(mOnSuccessCallback_5.Cancel(), mOnFailureCallback_5.Cancel()); - } - - void OnFailureResponse_5(uint8_t status) { ThrowFailureResponse(); } - - void OnSuccessResponse_5() { NextTest(); } - - CHIP_ERROR TestCheckForAttributeReport_6() - { - chip::Controller::OnOffClusterTest cluster; - cluster.Associate(mDevice, 1); - - return cluster.ReportAttributeOnOff(mOnSuccessCallback_6.Cancel()); - } - - void OnFailureResponse_6(uint8_t status) { ThrowFailureResponse(); } - - void OnSuccessResponse_6(bool onOff) - { - VerifyOrReturn(mReceivedReport_6 == false, ChipLogError(chipTool, "Not Fatal: on report called more than once.")); - mReceivedReport_6 = true; - - VerifyOrReturn(CheckValue("onOff", onOff, false)); + VerifyOrReturn(CheckValue("onOff", onOff, 0)); NextTest(); } }; -class Test_TC_OO_1_1 : public TestCommand +class Test_TC_CC_6_1 : public TestCommand { public: - Test_TC_OO_1_1() : TestCommand("Test_TC_OO_1_1"), mTestIndex(0) {} + Test_TC_CC_6_1() : TestCommand("Test_TC_CC_6_1"), mTestIndex(0) {} /////////// TestCommand Interface ///////// void NextTest() override @@ -6316,12 +7127,12 @@ class Test_TC_OO_1_1 : public TestCommand if (0 == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Start: Test_TC_OO_1_1\n"); + ChipLogProgress(chipTool, " **** Test Start: Test_TC_CC_6_1\n"); } if (mTestCount == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Complete: Test_TC_OO_1_1\n"); + ChipLogProgress(chipTool, " **** Test Complete: Test_TC_CC_6_1\n"); SetCommandExitStatus(CHIP_NO_ERROR); return; } @@ -6333,29 +7144,24 @@ class Test_TC_OO_1_1 : public TestCommand switch (mTestIndex++) { case 0: - ChipLogProgress(chipTool, " ***** Test Step 0 : read the global attribute: ClusterRevision\n"); - err = TestReadTheGlobalAttributeClusterRevision_0(); + ChipLogProgress(chipTool, " ***** Test Step 0 : Turn on light for color control tests\n"); + err = TestTurnOnLightForColorControlTests_0(); break; case 1: - ChipLogProgress(chipTool, - " ***** Test Step 1 : write the default values to mandatory global attribute: ClusterRevision\n"); - err = TestWriteTheDefaultValuesToMandatoryGlobalAttributeClusterRevision_1(); + ChipLogProgress(chipTool, " ***** Test Step 1 : Check on/off attribute value is true after on command\n"); + err = TestCheckOnOffAttributeValueIsTrueAfterOnCommand_1(); break; case 2: - ChipLogProgress(chipTool, " ***** Test Step 2 : reads back global attribute: ClusterRevision\n"); - err = TestReadsBackGlobalAttributeClusterRevision_2(); + ChipLogProgress(chipTool, " ***** Test Step 2 : Move To Color Temperature command\n"); + err = TestMoveToColorTemperatureCommand_2(); break; case 3: - ChipLogProgress(chipTool, " ***** Test Step 3 : read the optional global attribute: FeatureMap\n"); - err = TestReadTheOptionalGlobalAttributeFeatureMap_3(); + ChipLogProgress(chipTool, " ***** Test Step 3 : Turn off light that we turned on\n"); + err = TestTurnOffLightThatWeTurnedOn_3(); break; case 4: - ChipLogProgress(chipTool, " ***** Test Step 4 : write the default values to optional global attribute: FeatureMap\n"); - err = TestWriteTheDefaultValuesToOptionalGlobalAttributeFeatureMap_4(); - break; - case 5: - ChipLogProgress(chipTool, " ***** Test Step 5 : reads back optional global attribute: FeatureMap\n"); - err = TestReadsBackOptionalGlobalAttributeFeatureMap_5(); + ChipLogProgress(chipTool, " ***** Test Step 4 : Check on/off attribute value is false after off command\n"); + err = TestCheckOnOffAttributeValueIsFalseAfterOffCommand_4(); break; } @@ -6368,183 +7174,144 @@ class Test_TC_OO_1_1 : public TestCommand private: std::atomic_uint16_t mTestIndex; - const uint16_t mTestCount = 6; + const uint16_t mTestCount = 5; chip::Callback::Callback mOnFailureCallback_0{ OnFailureCallback_0, this }; - chip::Callback::Callback mOnSuccessCallback_0{ OnSuccessCallback_0, this }; + chip::Callback::Callback mOnSuccessCallback_0{ OnSuccessCallback_0, this }; chip::Callback::Callback mOnFailureCallback_1{ OnFailureCallback_1, this }; - chip::Callback::Callback mOnSuccessCallback_1{ OnSuccessCallback_1, this }; + chip::Callback::Callback mOnSuccessCallback_1{ OnSuccessCallback_1, this }; chip::Callback::Callback mOnFailureCallback_2{ OnFailureCallback_2, this }; - chip::Callback::Callback mOnSuccessCallback_2{ OnSuccessCallback_2, this }; + chip::Callback::Callback mOnSuccessCallback_2{ OnSuccessCallback_2, this }; chip::Callback::Callback mOnFailureCallback_3{ OnFailureCallback_3, this }; - chip::Callback::Callback mOnSuccessCallback_3{ OnSuccessCallback_3, this }; + chip::Callback::Callback mOnSuccessCallback_3{ OnSuccessCallback_3, this }; chip::Callback::Callback mOnFailureCallback_4{ OnFailureCallback_4, this }; - chip::Callback::Callback mOnSuccessCallback_4{ OnSuccessCallback_4, this }; - chip::Callback::Callback mOnFailureCallback_5{ OnFailureCallback_5, this }; - chip::Callback::Callback mOnSuccessCallback_5{ OnSuccessCallback_5, this }; + chip::Callback::Callback mOnSuccessCallback_4{ OnSuccessCallback_4, this }; static void OnFailureCallback_0(void * context, uint8_t status) { - (static_cast(context))->OnFailureResponse_0(status); + (static_cast(context))->OnFailureResponse_0(status); } - static void OnSuccessCallback_0(void * context, uint16_t clusterRevision) - { - (static_cast(context))->OnSuccessResponse_0(clusterRevision); - } + static void OnSuccessCallback_0(void * context) { (static_cast(context))->OnSuccessResponse_0(); } static void OnFailureCallback_1(void * context, uint8_t status) { - (static_cast(context))->OnFailureResponse_1(status); + (static_cast(context))->OnFailureResponse_1(status); } - static void OnSuccessCallback_1(void * context, uint16_t clusterRevision) + static void OnSuccessCallback_1(void * context, bool onOff) { - (static_cast(context))->OnSuccessResponse_1(clusterRevision); + (static_cast(context))->OnSuccessResponse_1(onOff); } static void OnFailureCallback_2(void * context, uint8_t status) { - (static_cast(context))->OnFailureResponse_2(status); + (static_cast(context))->OnFailureResponse_2(status); } - static void OnSuccessCallback_2(void * context, uint16_t clusterRevision) - { - (static_cast(context))->OnSuccessResponse_2(clusterRevision); - } + static void OnSuccessCallback_2(void * context) { (static_cast(context))->OnSuccessResponse_2(); } static void OnFailureCallback_3(void * context, uint8_t status) { - (static_cast(context))->OnFailureResponse_3(status); + (static_cast(context))->OnFailureResponse_3(status); } - static void OnSuccessCallback_3(void * context, uint32_t featureMap) - { - (static_cast(context))->OnSuccessResponse_3(featureMap); - } + static void OnSuccessCallback_3(void * context) { (static_cast(context))->OnSuccessResponse_3(); } static void OnFailureCallback_4(void * context, uint8_t status) { - (static_cast(context))->OnFailureResponse_4(status); - } - - static void OnSuccessCallback_4(void * context, uint32_t featureMap) - { - (static_cast(context))->OnSuccessResponse_4(featureMap); - } - - static void OnFailureCallback_5(void * context, uint8_t status) - { - (static_cast(context))->OnFailureResponse_5(status); - } - - static void OnSuccessCallback_5(void * context, uint32_t featureMap) - { - (static_cast(context))->OnSuccessResponse_5(featureMap); - } - - // - // Tests methods - // - - CHIP_ERROR TestReadTheGlobalAttributeClusterRevision_0() - { - chip::Controller::OnOffClusterTest cluster; - cluster.Associate(mDevice, 1); - - return cluster.ReadAttributeClusterRevision(mOnSuccessCallback_0.Cancel(), mOnFailureCallback_0.Cancel()); + (static_cast(context))->OnFailureResponse_4(status); } - void OnFailureResponse_0(uint8_t status) { ThrowFailureResponse(); } - - void OnSuccessResponse_0(uint16_t clusterRevision) + static void OnSuccessCallback_4(void * context, bool onOff) { - VerifyOrReturn(CheckValue("clusterRevision", clusterRevision, 3U)); - NextTest(); + (static_cast(context))->OnSuccessResponse_4(onOff); } - CHIP_ERROR TestWriteTheDefaultValuesToMandatoryGlobalAttributeClusterRevision_1() + // + // Tests methods + // + + CHIP_ERROR TestTurnOnLightForColorControlTests_0() { chip::Controller::OnOffClusterTest cluster; cluster.Associate(mDevice, 1); - uint16_t clusterRevisionArgument = 3U; - - return cluster.WriteAttributeClusterRevision(mOnSuccessCallback_1.Cancel(), mOnFailureCallback_1.Cancel(), - clusterRevisionArgument); + return cluster.On(mOnSuccessCallback_0.Cancel(), mOnFailureCallback_0.Cancel()); } - void OnFailureResponse_1(uint8_t status) { NextTest(); } + void OnFailureResponse_0(uint8_t status) { ThrowFailureResponse(); } - void OnSuccessResponse_1(uint16_t clusterRevision) { ThrowSuccessResponse(); } + void OnSuccessResponse_0() { NextTest(); } - CHIP_ERROR TestReadsBackGlobalAttributeClusterRevision_2() + CHIP_ERROR TestCheckOnOffAttributeValueIsTrueAfterOnCommand_1() { chip::Controller::OnOffClusterTest cluster; cluster.Associate(mDevice, 1); - return cluster.ReadAttributeClusterRevision(mOnSuccessCallback_2.Cancel(), mOnFailureCallback_2.Cancel()); + return cluster.ReadAttributeOnOff(mOnSuccessCallback_1.Cancel(), mOnFailureCallback_1.Cancel()); } - void OnFailureResponse_2(uint8_t status) { ThrowFailureResponse(); } + void OnFailureResponse_1(uint8_t status) { ThrowFailureResponse(); } - void OnSuccessResponse_2(uint16_t clusterRevision) + void OnSuccessResponse_1(bool onOff) { - VerifyOrReturn(CheckValue("clusterRevision", clusterRevision, 3U)); + VerifyOrReturn(CheckValue("onOff", onOff, 1)); NextTest(); } - CHIP_ERROR TestReadTheOptionalGlobalAttributeFeatureMap_3() + CHIP_ERROR TestMoveToColorTemperatureCommand_2() { - chip::Controller::OnOffClusterTest cluster; + chip::Controller::ColorControlClusterTest cluster; cluster.Associate(mDevice, 1); - return cluster.ReadAttributeFeatureMap(mOnSuccessCallback_3.Cancel(), mOnFailureCallback_3.Cancel()); + uint16_t colorTemperatureArgument = 100U; + uint16_t transitionTimeArgument = 10U; + uint8_t optionsMaskArgument = 0; + uint8_t optionsOverrideArgument = 0; + + return cluster.MoveToColorTemperature(mOnSuccessCallback_2.Cancel(), mOnFailureCallback_2.Cancel(), + colorTemperatureArgument, transitionTimeArgument, optionsMaskArgument, + optionsOverrideArgument); } - void OnFailureResponse_3(uint8_t status) { ThrowFailureResponse(); } + void OnFailureResponse_2(uint8_t status) { ThrowFailureResponse(); } - void OnSuccessResponse_3(uint32_t featureMap) - { - VerifyOrReturn(CheckValue("featureMap", featureMap, 0UL)); - NextTest(); - } + void OnSuccessResponse_2() { NextTest(); } - CHIP_ERROR TestWriteTheDefaultValuesToOptionalGlobalAttributeFeatureMap_4() + CHIP_ERROR TestTurnOffLightThatWeTurnedOn_3() { chip::Controller::OnOffClusterTest cluster; cluster.Associate(mDevice, 1); - uint32_t featureMapArgument = 0UL; - - return cluster.WriteAttributeFeatureMap(mOnSuccessCallback_4.Cancel(), mOnFailureCallback_4.Cancel(), featureMapArgument); + return cluster.Off(mOnSuccessCallback_3.Cancel(), mOnFailureCallback_3.Cancel()); } - void OnFailureResponse_4(uint8_t status) { NextTest(); } + void OnFailureResponse_3(uint8_t status) { ThrowFailureResponse(); } - void OnSuccessResponse_4(uint32_t featureMap) { ThrowSuccessResponse(); } + void OnSuccessResponse_3() { NextTest(); } - CHIP_ERROR TestReadsBackOptionalGlobalAttributeFeatureMap_5() + CHIP_ERROR TestCheckOnOffAttributeValueIsFalseAfterOffCommand_4() { chip::Controller::OnOffClusterTest cluster; cluster.Associate(mDevice, 1); - return cluster.ReadAttributeFeatureMap(mOnSuccessCallback_5.Cancel(), mOnFailureCallback_5.Cancel()); + return cluster.ReadAttributeOnOff(mOnSuccessCallback_4.Cancel(), mOnFailureCallback_4.Cancel()); } - void OnFailureResponse_5(uint8_t status) { ThrowFailureResponse(); } + void OnFailureResponse_4(uint8_t status) { ThrowFailureResponse(); } - void OnSuccessResponse_5(uint32_t featureMap) + void OnSuccessResponse_4(bool onOff) { - VerifyOrReturn(CheckValue("featureMap", featureMap, 0UL)); + VerifyOrReturn(CheckValue("onOff", onOff, 0)); NextTest(); } }; -class Test_TC_OO_2_1 : public TestCommand +class Test_TC_CC_6_2 : public TestCommand { public: - Test_TC_OO_2_1() : TestCommand("Test_TC_OO_2_1"), mTestIndex(0) {} + Test_TC_CC_6_2() : TestCommand("Test_TC_CC_6_2"), mTestIndex(0) {} /////////// TestCommand Interface ///////// void NextTest() override @@ -6553,12 +7320,12 @@ class Test_TC_OO_2_1 : public TestCommand if (0 == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Start: Test_TC_OO_2_1\n"); + ChipLogProgress(chipTool, " **** Test Start: Test_TC_CC_6_2\n"); } if (mTestCount == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Complete: Test_TC_OO_2_1\n"); + ChipLogProgress(chipTool, " **** Test Complete: Test_TC_CC_6_2\n"); SetCommandExitStatus(CHIP_NO_ERROR); return; } @@ -6570,52 +7337,32 @@ class Test_TC_OO_2_1 : public TestCommand switch (mTestIndex++) { case 0: - ChipLogProgress(chipTool, " ***** Test Step 0 : read the mandatory attribute: OnOff\n"); - err = TestReadTheMandatoryAttributeOnOff_0(); + ChipLogProgress(chipTool, " ***** Test Step 0 : Turn on light for color control tests\n"); + err = TestTurnOnLightForColorControlTests_0(); break; case 1: - ChipLogProgress(chipTool, " ***** Test Step 1 : reads back mandatory attribute: OnOff\n"); - err = TestReadsBackMandatoryAttributeOnOff_1(); + ChipLogProgress(chipTool, " ***** Test Step 1 : Check on/off attribute value is true after on command\n"); + err = TestCheckOnOffAttributeValueIsTrueAfterOnCommand_1(); break; case 2: - ChipLogProgress(chipTool, " ***** Test Step 2 : read LT attribute: GlobalSceneControl\n"); - err = TestReadLtAttributeGlobalSceneControl_2(); + ChipLogProgress(chipTool, " ***** Test Step 2 : Move up color temperature command\n"); + err = TestMoveUpColorTemperatureCommand_2(); break; case 3: - ChipLogProgress(chipTool, " ***** Test Step 3 : read LT attribute: OnTime\n"); - err = TestReadLtAttributeOnTime_3(); + ChipLogProgress(chipTool, " ***** Test Step 3 : Stop Color Temperature command\n"); + err = TestStopColorTemperatureCommand_3(); break; case 4: - ChipLogProgress(chipTool, " ***** Test Step 4 : read LT attribute: OffWaitTime\n"); - err = TestReadLtAttributeOffWaitTime_4(); + ChipLogProgress(chipTool, " ***** Test Step 4 : Move down color temperature command\n"); + err = TestMoveDownColorTemperatureCommand_4(); break; case 5: - ChipLogProgress(chipTool, " ***** Test Step 5 : read LT attribute: StartUpOnOff\n"); - err = TestReadLtAttributeStartUpOnOff_5(); + ChipLogProgress(chipTool, " ***** Test Step 5 : Turn off light that we turned on\n"); + err = TestTurnOffLightThatWeTurnedOn_5(); break; case 6: - ChipLogProgress(chipTool, " ***** Test Step 6 : write the default value to LT attribute: OnTime\n"); - err = TestWriteTheDefaultValueToLtAttributeOnTime_6(); - break; - case 7: - ChipLogProgress(chipTool, " ***** Test Step 7 : write the default value to LT attribute: OffWaitTime\n"); - err = TestWriteTheDefaultValueToLtAttributeOffWaitTime_7(); - break; - case 8: - ChipLogProgress(chipTool, " ***** Test Step 8 : write the default value to LT attribute: StartUpOnOff\n"); - err = TestWriteTheDefaultValueToLtAttributeStartUpOnOff_8(); - break; - case 9: - ChipLogProgress(chipTool, " ***** Test Step 9 : reads back LT attribute: OnTime\n"); - err = TestReadsBackLtAttributeOnTime_9(); - break; - case 10: - ChipLogProgress(chipTool, " ***** Test Step 10 : reads back LT attribute: OffWaitTime\n"); - err = TestReadsBackLtAttributeOffWaitTime_10(); - break; - case 11: - ChipLogProgress(chipTool, " ***** Test Step 11 : reads back LT attribute: StartUpOnOff\n"); - err = TestReadsBackLtAttributeStartUpOnOff_11(); + ChipLogProgress(chipTool, " ***** Test Step 6 : Check on/off attribute value is false after off command\n"); + err = TestCheckOnOffAttributeValueIsFalseAfterOffCommand_6(); break; } @@ -6628,349 +7375,206 @@ class Test_TC_OO_2_1 : public TestCommand private: std::atomic_uint16_t mTestIndex; - const uint16_t mTestCount = 12; + const uint16_t mTestCount = 7; chip::Callback::Callback mOnFailureCallback_0{ OnFailureCallback_0, this }; - chip::Callback::Callback mOnSuccessCallback_0{ OnSuccessCallback_0, this }; + chip::Callback::Callback mOnSuccessCallback_0{ OnSuccessCallback_0, this }; chip::Callback::Callback mOnFailureCallback_1{ OnFailureCallback_1, this }; chip::Callback::Callback mOnSuccessCallback_1{ OnSuccessCallback_1, this }; chip::Callback::Callback mOnFailureCallback_2{ OnFailureCallback_2, this }; - chip::Callback::Callback mOnSuccessCallback_2{ OnSuccessCallback_2, this }; + chip::Callback::Callback mOnSuccessCallback_2{ OnSuccessCallback_2, this }; chip::Callback::Callback mOnFailureCallback_3{ OnFailureCallback_3, this }; - chip::Callback::Callback mOnSuccessCallback_3{ OnSuccessCallback_3, this }; + chip::Callback::Callback mOnSuccessCallback_3{ OnSuccessCallback_3, this }; chip::Callback::Callback mOnFailureCallback_4{ OnFailureCallback_4, this }; - chip::Callback::Callback mOnSuccessCallback_4{ OnSuccessCallback_4, this }; + chip::Callback::Callback mOnSuccessCallback_4{ OnSuccessCallback_4, this }; chip::Callback::Callback mOnFailureCallback_5{ OnFailureCallback_5, this }; - chip::Callback::Callback mOnSuccessCallback_5{ OnSuccessCallback_5, this }; + chip::Callback::Callback mOnSuccessCallback_5{ OnSuccessCallback_5, this }; chip::Callback::Callback mOnFailureCallback_6{ OnFailureCallback_6, this }; - chip::Callback::Callback mOnSuccessCallback_6{ OnSuccessCallback_6, this }; - chip::Callback::Callback mOnFailureCallback_7{ OnFailureCallback_7, this }; - chip::Callback::Callback mOnSuccessCallback_7{ OnSuccessCallback_7, this }; - chip::Callback::Callback mOnFailureCallback_8{ OnFailureCallback_8, this }; - chip::Callback::Callback mOnSuccessCallback_8{ OnSuccessCallback_8, this }; - chip::Callback::Callback mOnFailureCallback_9{ OnFailureCallback_9, this }; - chip::Callback::Callback mOnSuccessCallback_9{ OnSuccessCallback_9, this }; - chip::Callback::Callback mOnFailureCallback_10{ OnFailureCallback_10, this }; - chip::Callback::Callback mOnSuccessCallback_10{ OnSuccessCallback_10, this }; - chip::Callback::Callback mOnFailureCallback_11{ OnFailureCallback_11, this }; - chip::Callback::Callback mOnSuccessCallback_11{ OnSuccessCallback_11, this }; - - static void OnFailureCallback_0(void * context, uint8_t status) - { - (static_cast(context))->OnFailureResponse_0(status); - } - - static void OnSuccessCallback_0(void * context, bool onOff) - { - (static_cast(context))->OnSuccessResponse_0(onOff); - } - - static void OnFailureCallback_1(void * context, uint8_t status) - { - (static_cast(context))->OnFailureResponse_1(status); - } - - static void OnSuccessCallback_1(void * context, bool onOff) - { - (static_cast(context))->OnSuccessResponse_1(onOff); - } - - static void OnFailureCallback_2(void * context, uint8_t status) - { - (static_cast(context))->OnFailureResponse_2(status); - } - - static void OnSuccessCallback_2(void * context, bool globalSceneControl) - { - (static_cast(context))->OnSuccessResponse_2(globalSceneControl); - } - - static void OnFailureCallback_3(void * context, uint8_t status) - { - (static_cast(context))->OnFailureResponse_3(status); - } - - static void OnSuccessCallback_3(void * context, uint16_t onTime) - { - (static_cast(context))->OnSuccessResponse_3(onTime); - } - - static void OnFailureCallback_4(void * context, uint8_t status) - { - (static_cast(context))->OnFailureResponse_4(status); - } - - static void OnSuccessCallback_4(void * context, uint16_t offWaitTime) - { - (static_cast(context))->OnSuccessResponse_4(offWaitTime); - } - - static void OnFailureCallback_5(void * context, uint8_t status) - { - (static_cast(context))->OnFailureResponse_5(status); - } - - static void OnSuccessCallback_5(void * context, uint8_t startUpOnOff) - { - (static_cast(context))->OnSuccessResponse_5(startUpOnOff); - } - - static void OnFailureCallback_6(void * context, uint8_t status) - { - (static_cast(context))->OnFailureResponse_6(status); - } - - static void OnSuccessCallback_6(void * context, uint16_t onTime) - { - (static_cast(context))->OnSuccessResponse_6(onTime); - } - - static void OnFailureCallback_7(void * context, uint8_t status) - { - (static_cast(context))->OnFailureResponse_7(status); - } - - static void OnSuccessCallback_7(void * context, uint16_t offWaitTime) - { - (static_cast(context))->OnSuccessResponse_7(offWaitTime); - } - - static void OnFailureCallback_8(void * context, uint8_t status) - { - (static_cast(context))->OnFailureResponse_8(status); - } - - static void OnSuccessCallback_8(void * context, uint8_t startUpOnOff) - { - (static_cast(context))->OnSuccessResponse_8(startUpOnOff); - } - - static void OnFailureCallback_9(void * context, uint8_t status) - { - (static_cast(context))->OnFailureResponse_9(status); - } - - static void OnSuccessCallback_9(void * context, uint16_t onTime) - { - (static_cast(context))->OnSuccessResponse_9(onTime); - } - - static void OnFailureCallback_10(void * context, uint8_t status) - { - (static_cast(context))->OnFailureResponse_10(status); - } + chip::Callback::Callback mOnSuccessCallback_6{ OnSuccessCallback_6, this }; - static void OnSuccessCallback_10(void * context, uint16_t offWaitTime) + static void OnFailureCallback_0(void * context, uint8_t status) { - (static_cast(context))->OnSuccessResponse_10(offWaitTime); + (static_cast(context))->OnFailureResponse_0(status); } - static void OnFailureCallback_11(void * context, uint8_t status) - { - (static_cast(context))->OnFailureResponse_11(status); - } + static void OnSuccessCallback_0(void * context) { (static_cast(context))->OnSuccessResponse_0(); } - static void OnSuccessCallback_11(void * context, uint8_t startUpOnOff) + static void OnFailureCallback_1(void * context, uint8_t status) { - (static_cast(context))->OnSuccessResponse_11(startUpOnOff); + (static_cast(context))->OnFailureResponse_1(status); } - // - // Tests methods - // - - CHIP_ERROR TestReadTheMandatoryAttributeOnOff_0() + static void OnSuccessCallback_1(void * context, bool onOff) { - chip::Controller::OnOffClusterTest cluster; - cluster.Associate(mDevice, 1); - - return cluster.ReadAttributeOnOff(mOnSuccessCallback_0.Cancel(), mOnFailureCallback_0.Cancel()); + (static_cast(context))->OnSuccessResponse_1(onOff); } - void OnFailureResponse_0(uint8_t status) { ThrowFailureResponse(); } - - void OnSuccessResponse_0(bool onOff) + static void OnFailureCallback_2(void * context, uint8_t status) { - VerifyOrReturn(CheckValue("onOff", onOff, 0)); - NextTest(); + (static_cast(context))->OnFailureResponse_2(status); } - CHIP_ERROR TestReadsBackMandatoryAttributeOnOff_1() - { - chip::Controller::OnOffClusterTest cluster; - cluster.Associate(mDevice, 1); + static void OnSuccessCallback_2(void * context) { (static_cast(context))->OnSuccessResponse_2(); } - return cluster.ReadAttributeOnOff(mOnSuccessCallback_1.Cancel(), mOnFailureCallback_1.Cancel()); + static void OnFailureCallback_3(void * context, uint8_t status) + { + (static_cast(context))->OnFailureResponse_3(status); } - void OnFailureResponse_1(uint8_t status) { ThrowFailureResponse(); } + static void OnSuccessCallback_3(void * context) { (static_cast(context))->OnSuccessResponse_3(); } - void OnSuccessResponse_1(bool onOff) + static void OnFailureCallback_4(void * context, uint8_t status) { - VerifyOrReturn(CheckValue("onOff", onOff, 0)); - NextTest(); + (static_cast(context))->OnFailureResponse_4(status); } - CHIP_ERROR TestReadLtAttributeGlobalSceneControl_2() - { - chip::Controller::OnOffClusterTest cluster; - cluster.Associate(mDevice, 1); + static void OnSuccessCallback_4(void * context) { (static_cast(context))->OnSuccessResponse_4(); } - return cluster.ReadAttributeGlobalSceneControl(mOnSuccessCallback_2.Cancel(), mOnFailureCallback_2.Cancel()); + static void OnFailureCallback_5(void * context, uint8_t status) + { + (static_cast(context))->OnFailureResponse_5(status); } - void OnFailureResponse_2(uint8_t status) { ThrowFailureResponse(); } + static void OnSuccessCallback_5(void * context) { (static_cast(context))->OnSuccessResponse_5(); } - void OnSuccessResponse_2(bool globalSceneControl) + static void OnFailureCallback_6(void * context, uint8_t status) { - VerifyOrReturn(CheckValue("globalSceneControl", globalSceneControl, 1)); - NextTest(); + (static_cast(context))->OnFailureResponse_6(status); } - CHIP_ERROR TestReadLtAttributeOnTime_3() + static void OnSuccessCallback_6(void * context, bool onOff) { - chip::Controller::OnOffClusterTest cluster; - cluster.Associate(mDevice, 1); - - return cluster.ReadAttributeOnTime(mOnSuccessCallback_3.Cancel(), mOnFailureCallback_3.Cancel()); + (static_cast(context))->OnSuccessResponse_6(onOff); } - void OnFailureResponse_3(uint8_t status) { ThrowFailureResponse(); } - - void OnSuccessResponse_3(uint16_t onTime) - { - VerifyOrReturn(CheckValue("onTime", onTime, 0U)); - NextTest(); - } + // + // Tests methods + // - CHIP_ERROR TestReadLtAttributeOffWaitTime_4() + CHIP_ERROR TestTurnOnLightForColorControlTests_0() { chip::Controller::OnOffClusterTest cluster; cluster.Associate(mDevice, 1); - return cluster.ReadAttributeOffWaitTime(mOnSuccessCallback_4.Cancel(), mOnFailureCallback_4.Cancel()); + return cluster.On(mOnSuccessCallback_0.Cancel(), mOnFailureCallback_0.Cancel()); } - void OnFailureResponse_4(uint8_t status) { ThrowFailureResponse(); } + void OnFailureResponse_0(uint8_t status) { ThrowFailureResponse(); } - void OnSuccessResponse_4(uint16_t offWaitTime) - { - VerifyOrReturn(CheckValue("offWaitTime", offWaitTime, 0U)); - NextTest(); - } + void OnSuccessResponse_0() { NextTest(); } - CHIP_ERROR TestReadLtAttributeStartUpOnOff_5() + CHIP_ERROR TestCheckOnOffAttributeValueIsTrueAfterOnCommand_1() { chip::Controller::OnOffClusterTest cluster; cluster.Associate(mDevice, 1); - return cluster.ReadAttributeStartUpOnOff(mOnSuccessCallback_5.Cancel(), mOnFailureCallback_5.Cancel()); + return cluster.ReadAttributeOnOff(mOnSuccessCallback_1.Cancel(), mOnFailureCallback_1.Cancel()); } - void OnFailureResponse_5(uint8_t status) { ThrowFailureResponse(); } + void OnFailureResponse_1(uint8_t status) { ThrowFailureResponse(); } - void OnSuccessResponse_5(uint8_t startUpOnOff) + void OnSuccessResponse_1(bool onOff) { - VerifyOrReturn(CheckValue("startUpOnOff", startUpOnOff, 0)); + VerifyOrReturn(CheckValue("onOff", onOff, 1)); NextTest(); } - CHIP_ERROR TestWriteTheDefaultValueToLtAttributeOnTime_6() + CHIP_ERROR TestMoveUpColorTemperatureCommand_2() { - chip::Controller::OnOffClusterTest cluster; + chip::Controller::ColorControlClusterTest cluster; cluster.Associate(mDevice, 1); - uint16_t onTimeArgument = 0U; + uint8_t moveModeArgument = 1; + uint16_t rateArgument = 10U; + uint16_t colorTemperatureMinimumArgument = 1U; + uint16_t colorTemperatureMaximumArgument = 255U; + uint8_t optionsMaskArgument = 0; + uint8_t optionsOverrideArgument = 0; - return cluster.WriteAttributeOnTime(mOnSuccessCallback_6.Cancel(), mOnFailureCallback_6.Cancel(), onTimeArgument); + return cluster.MoveColorTemperature(mOnSuccessCallback_2.Cancel(), mOnFailureCallback_2.Cancel(), moveModeArgument, + rateArgument, colorTemperatureMinimumArgument, colorTemperatureMaximumArgument, + optionsMaskArgument, optionsOverrideArgument); } - void OnFailureResponse_6(uint8_t status) { ThrowFailureResponse(); } + void OnFailureResponse_2(uint8_t status) { ThrowFailureResponse(); } - void OnSuccessResponse_6(uint16_t onTime) { NextTest(); } + void OnSuccessResponse_2() { NextTest(); } - CHIP_ERROR TestWriteTheDefaultValueToLtAttributeOffWaitTime_7() + CHIP_ERROR TestStopColorTemperatureCommand_3() { - chip::Controller::OnOffClusterTest cluster; + chip::Controller::ColorControlClusterTest cluster; cluster.Associate(mDevice, 1); - uint16_t offWaitTimeArgument = 0U; + uint8_t moveModeArgument = 0; + uint16_t rateArgument = 10U; + uint16_t colorTemperatureMinimumArgument = 1U; + uint16_t colorTemperatureMaximumArgument = 255U; + uint8_t optionsMaskArgument = 0; + uint8_t optionsOverrideArgument = 0; - return cluster.WriteAttributeOffWaitTime(mOnSuccessCallback_7.Cancel(), mOnFailureCallback_7.Cancel(), offWaitTimeArgument); + return cluster.MoveColorTemperature(mOnSuccessCallback_3.Cancel(), mOnFailureCallback_3.Cancel(), moveModeArgument, + rateArgument, colorTemperatureMinimumArgument, colorTemperatureMaximumArgument, + optionsMaskArgument, optionsOverrideArgument); } - void OnFailureResponse_7(uint8_t status) { ThrowFailureResponse(); } + void OnFailureResponse_3(uint8_t status) { ThrowFailureResponse(); } - void OnSuccessResponse_7(uint16_t offWaitTime) { NextTest(); } + void OnSuccessResponse_3() { NextTest(); } - CHIP_ERROR TestWriteTheDefaultValueToLtAttributeStartUpOnOff_8() + CHIP_ERROR TestMoveDownColorTemperatureCommand_4() { - chip::Controller::OnOffClusterTest cluster; + chip::Controller::ColorControlClusterTest cluster; cluster.Associate(mDevice, 1); - uint8_t startUpOnOffArgument = 0; - - return cluster.WriteAttributeStartUpOnOff(mOnSuccessCallback_8.Cancel(), mOnFailureCallback_8.Cancel(), - startUpOnOffArgument); - } - - void OnFailureResponse_8(uint8_t status) { ThrowFailureResponse(); } - - void OnSuccessResponse_8(uint8_t startUpOnOff) { NextTest(); } - - CHIP_ERROR TestReadsBackLtAttributeOnTime_9() - { - chip::Controller::OnOffClusterTest cluster; - cluster.Associate(mDevice, 1); + uint8_t moveModeArgument = 3; + uint16_t rateArgument = 20U; + uint16_t colorTemperatureMinimumArgument = 1U; + uint16_t colorTemperatureMaximumArgument = 255U; + uint8_t optionsMaskArgument = 0; + uint8_t optionsOverrideArgument = 0; - return cluster.ReadAttributeOnTime(mOnSuccessCallback_9.Cancel(), mOnFailureCallback_9.Cancel()); + return cluster.MoveColorTemperature(mOnSuccessCallback_4.Cancel(), mOnFailureCallback_4.Cancel(), moveModeArgument, + rateArgument, colorTemperatureMinimumArgument, colorTemperatureMaximumArgument, + optionsMaskArgument, optionsOverrideArgument); } - void OnFailureResponse_9(uint8_t status) { ThrowFailureResponse(); } + void OnFailureResponse_4(uint8_t status) { ThrowFailureResponse(); } - void OnSuccessResponse_9(uint16_t onTime) - { - VerifyOrReturn(CheckValue("onTime", onTime, 0U)); - NextTest(); - } + void OnSuccessResponse_4() { NextTest(); } - CHIP_ERROR TestReadsBackLtAttributeOffWaitTime_10() + CHIP_ERROR TestTurnOffLightThatWeTurnedOn_5() { chip::Controller::OnOffClusterTest cluster; cluster.Associate(mDevice, 1); - return cluster.ReadAttributeOffWaitTime(mOnSuccessCallback_10.Cancel(), mOnFailureCallback_10.Cancel()); + return cluster.Off(mOnSuccessCallback_5.Cancel(), mOnFailureCallback_5.Cancel()); } - void OnFailureResponse_10(uint8_t status) { ThrowFailureResponse(); } + void OnFailureResponse_5(uint8_t status) { ThrowFailureResponse(); } - void OnSuccessResponse_10(uint16_t offWaitTime) - { - VerifyOrReturn(CheckValue("offWaitTime", offWaitTime, 0U)); - NextTest(); - } + void OnSuccessResponse_5() { NextTest(); } - CHIP_ERROR TestReadsBackLtAttributeStartUpOnOff_11() + CHIP_ERROR TestCheckOnOffAttributeValueIsFalseAfterOffCommand_6() { chip::Controller::OnOffClusterTest cluster; cluster.Associate(mDevice, 1); - return cluster.ReadAttributeStartUpOnOff(mOnSuccessCallback_11.Cancel(), mOnFailureCallback_11.Cancel()); + return cluster.ReadAttributeOnOff(mOnSuccessCallback_6.Cancel(), mOnFailureCallback_6.Cancel()); } - void OnFailureResponse_11(uint8_t status) { ThrowFailureResponse(); } + void OnFailureResponse_6(uint8_t status) { ThrowFailureResponse(); } - void OnSuccessResponse_11(uint8_t startUpOnOff) + void OnSuccessResponse_6(bool onOff) { - VerifyOrReturn(CheckValue("startUpOnOff", startUpOnOff, 0)); + VerifyOrReturn(CheckValue("onOff", onOff, 0)); NextTest(); } }; -class Test_TC_OO_2_2 : public TestCommand +class Test_TC_CC_6_3 : public TestCommand { public: - Test_TC_OO_2_2() : TestCommand("Test_TC_OO_2_2"), mTestIndex(0) {} + Test_TC_CC_6_3() : TestCommand("Test_TC_CC_6_3"), mTestIndex(0) {} /////////// TestCommand Interface ///////// void NextTest() override @@ -6979,12 +7583,12 @@ class Test_TC_OO_2_2 : public TestCommand if (0 == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Start: Test_TC_OO_2_2\n"); + ChipLogProgress(chipTool, " **** Test Start: Test_TC_CC_6_3\n"); } if (mTestCount == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Complete: Test_TC_OO_2_2\n"); + ChipLogProgress(chipTool, " **** Test Complete: Test_TC_CC_6_3\n"); SetCommandExitStatus(CHIP_NO_ERROR); return; } @@ -6996,60 +7600,28 @@ class Test_TC_OO_2_2 : public TestCommand switch (mTestIndex++) { case 0: - ChipLogProgress(chipTool, " ***** Test Step 0 : Send Off Command\n"); - err = TestSendOffCommand_0(); + ChipLogProgress(chipTool, " ***** Test Step 0 : Turn on light for color control tests\n"); + err = TestTurnOnLightForColorControlTests_0(); break; case 1: - ChipLogProgress(chipTool, " ***** Test Step 1 : Check on/off attribute value is false after off command\n"); - err = TestCheckOnOffAttributeValueIsFalseAfterOffCommand_1(); + ChipLogProgress(chipTool, " ***** Test Step 1 : Check on/off attribute value is true after on command\n"); + err = TestCheckOnOffAttributeValueIsTrueAfterOnCommand_1(); break; case 2: - ChipLogProgress(chipTool, " ***** Test Step 2 : Send On Command\n"); - err = TestSendOnCommand_2(); + ChipLogProgress(chipTool, " ***** Test Step 2 : Step up color temperature command\n"); + err = TestStepUpColorTemperatureCommand_2(); break; case 3: - ChipLogProgress(chipTool, " ***** Test Step 3 : Check on/off attribute value is true after on command\n"); - err = TestCheckOnOffAttributeValueIsTrueAfterOnCommand_3(); + ChipLogProgress(chipTool, " ***** Test Step 3 : Step down color temperature command\n"); + err = TestStepDownColorTemperatureCommand_3(); break; case 4: - ChipLogProgress(chipTool, " ***** Test Step 4 : Send Off Command\n"); - err = TestSendOffCommand_4(); - break; - case 5: - ChipLogProgress(chipTool, " ***** Test Step 5 : Check on/off attribute value is false after off command\n"); - err = TestCheckOnOffAttributeValueIsFalseAfterOffCommand_5(); - break; - case 6: - ChipLogProgress(chipTool, " ***** Test Step 6 : Send Toggle Command\n"); - err = TestSendToggleCommand_6(); - break; - case 7: - ChipLogProgress(chipTool, " ***** Test Step 7 : Check on/off attribute value is true after toggle command\n"); - err = TestCheckOnOffAttributeValueIsTrueAfterToggleCommand_7(); - break; - case 8: - ChipLogProgress(chipTool, " ***** Test Step 8 : Send Toggle Command\n"); - err = TestSendToggleCommand_8(); - break; - case 9: - ChipLogProgress(chipTool, " ***** Test Step 9 : Check on/off attribute value is false after toggle command\n"); - err = TestCheckOnOffAttributeValueIsFalseAfterToggleCommand_9(); - break; - case 10: - ChipLogProgress(chipTool, " ***** Test Step 10 : Send On Command\n"); - err = TestSendOnCommand_10(); - break; - case 11: - ChipLogProgress(chipTool, " ***** Test Step 11 : Check on/off attribute value is true after on command\n"); - err = TestCheckOnOffAttributeValueIsTrueAfterOnCommand_11(); - break; - case 12: - ChipLogProgress(chipTool, " ***** Test Step 12 : Send Off Command\n"); - err = TestSendOffCommand_12(); + ChipLogProgress(chipTool, " ***** Test Step 4 : Turn off light that we turned on\n"); + err = TestTurnOffLightThatWeTurnedOn_4(); break; - case 13: - ChipLogProgress(chipTool, " ***** Test Step 13 : Check on/off attribute value is false after off command\n"); - err = TestCheckOnOffAttributeValueIsFalseAfterOffCommand_13(); + case 5: + ChipLogProgress(chipTool, " ***** Test Step 5 : Check on/off attribute value is false after off command\n"); + err = TestCheckOnOffAttributeValueIsFalseAfterOffCommand_5(); break; } @@ -7062,7 +7634,7 @@ class Test_TC_OO_2_2 : public TestCommand private: std::atomic_uint16_t mTestIndex; - const uint16_t mTestCount = 14; + const uint16_t mTestCount = 6; chip::Callback::Callback mOnFailureCallback_0{ OnFailureCallback_0, this }; chip::Callback::Callback mOnSuccessCallback_0{ OnSuccessCallback_0, this }; @@ -7071,352 +7643,395 @@ class Test_TC_OO_2_2 : public TestCommand chip::Callback::Callback mOnFailureCallback_2{ OnFailureCallback_2, this }; chip::Callback::Callback mOnSuccessCallback_2{ OnSuccessCallback_2, this }; chip::Callback::Callback mOnFailureCallback_3{ OnFailureCallback_3, this }; - chip::Callback::Callback mOnSuccessCallback_3{ OnSuccessCallback_3, this }; + chip::Callback::Callback mOnSuccessCallback_3{ OnSuccessCallback_3, this }; chip::Callback::Callback mOnFailureCallback_4{ OnFailureCallback_4, this }; chip::Callback::Callback mOnSuccessCallback_4{ OnSuccessCallback_4, this }; chip::Callback::Callback mOnFailureCallback_5{ OnFailureCallback_5, this }; chip::Callback::Callback mOnSuccessCallback_5{ OnSuccessCallback_5, this }; - chip::Callback::Callback mOnFailureCallback_6{ OnFailureCallback_6, this }; - chip::Callback::Callback mOnSuccessCallback_6{ OnSuccessCallback_6, this }; - chip::Callback::Callback mOnFailureCallback_7{ OnFailureCallback_7, this }; - chip::Callback::Callback mOnSuccessCallback_7{ OnSuccessCallback_7, this }; - chip::Callback::Callback mOnFailureCallback_8{ OnFailureCallback_8, this }; - chip::Callback::Callback mOnSuccessCallback_8{ OnSuccessCallback_8, this }; - chip::Callback::Callback mOnFailureCallback_9{ OnFailureCallback_9, this }; - chip::Callback::Callback mOnSuccessCallback_9{ OnSuccessCallback_9, this }; - chip::Callback::Callback mOnFailureCallback_10{ OnFailureCallback_10, this }; - chip::Callback::Callback mOnSuccessCallback_10{ OnSuccessCallback_10, this }; - chip::Callback::Callback mOnFailureCallback_11{ OnFailureCallback_11, this }; - chip::Callback::Callback mOnSuccessCallback_11{ OnSuccessCallback_11, this }; - chip::Callback::Callback mOnFailureCallback_12{ OnFailureCallback_12, this }; - chip::Callback::Callback mOnSuccessCallback_12{ OnSuccessCallback_12, this }; - chip::Callback::Callback mOnFailureCallback_13{ OnFailureCallback_13, this }; - chip::Callback::Callback mOnSuccessCallback_13{ OnSuccessCallback_13, this }; static void OnFailureCallback_0(void * context, uint8_t status) { - (static_cast(context))->OnFailureResponse_0(status); + (static_cast(context))->OnFailureResponse_0(status); } - static void OnSuccessCallback_0(void * context) { (static_cast(context))->OnSuccessResponse_0(); } + static void OnSuccessCallback_0(void * context) { (static_cast(context))->OnSuccessResponse_0(); } static void OnFailureCallback_1(void * context, uint8_t status) { - (static_cast(context))->OnFailureResponse_1(status); + (static_cast(context))->OnFailureResponse_1(status); } static void OnSuccessCallback_1(void * context, bool onOff) { - (static_cast(context))->OnSuccessResponse_1(onOff); + (static_cast(context))->OnSuccessResponse_1(onOff); } static void OnFailureCallback_2(void * context, uint8_t status) { - (static_cast(context))->OnFailureResponse_2(status); + (static_cast(context))->OnFailureResponse_2(status); } - static void OnSuccessCallback_2(void * context) { (static_cast(context))->OnSuccessResponse_2(); } + static void OnSuccessCallback_2(void * context) { (static_cast(context))->OnSuccessResponse_2(); } static void OnFailureCallback_3(void * context, uint8_t status) { - (static_cast(context))->OnFailureResponse_3(status); + (static_cast(context))->OnFailureResponse_3(status); } - static void OnSuccessCallback_3(void * context, bool onOff) - { - (static_cast(context))->OnSuccessResponse_3(onOff); - } + static void OnSuccessCallback_3(void * context) { (static_cast(context))->OnSuccessResponse_3(); } static void OnFailureCallback_4(void * context, uint8_t status) { - (static_cast(context))->OnFailureResponse_4(status); + (static_cast(context))->OnFailureResponse_4(status); } - static void OnSuccessCallback_4(void * context) { (static_cast(context))->OnSuccessResponse_4(); } + static void OnSuccessCallback_4(void * context) { (static_cast(context))->OnSuccessResponse_4(); } static void OnFailureCallback_5(void * context, uint8_t status) { - (static_cast(context))->OnFailureResponse_5(status); + (static_cast(context))->OnFailureResponse_5(status); } static void OnSuccessCallback_5(void * context, bool onOff) { - (static_cast(context))->OnSuccessResponse_5(onOff); - } - - static void OnFailureCallback_6(void * context, uint8_t status) - { - (static_cast(context))->OnFailureResponse_6(status); + (static_cast(context))->OnSuccessResponse_5(onOff); } - static void OnSuccessCallback_6(void * context) { (static_cast(context))->OnSuccessResponse_6(); } + // + // Tests methods + // - static void OnFailureCallback_7(void * context, uint8_t status) + CHIP_ERROR TestTurnOnLightForColorControlTests_0() { - (static_cast(context))->OnFailureResponse_7(status); - } + chip::Controller::OnOffClusterTest cluster; + cluster.Associate(mDevice, 1); - static void OnSuccessCallback_7(void * context, bool onOff) - { - (static_cast(context))->OnSuccessResponse_7(onOff); + return cluster.On(mOnSuccessCallback_0.Cancel(), mOnFailureCallback_0.Cancel()); } - static void OnFailureCallback_8(void * context, uint8_t status) - { - (static_cast(context))->OnFailureResponse_8(status); - } + void OnFailureResponse_0(uint8_t status) { ThrowFailureResponse(); } - static void OnSuccessCallback_8(void * context) { (static_cast(context))->OnSuccessResponse_8(); } + void OnSuccessResponse_0() { NextTest(); } - static void OnFailureCallback_9(void * context, uint8_t status) + CHIP_ERROR TestCheckOnOffAttributeValueIsTrueAfterOnCommand_1() { - (static_cast(context))->OnFailureResponse_9(status); + chip::Controller::OnOffClusterTest cluster; + cluster.Associate(mDevice, 1); + + return cluster.ReadAttributeOnOff(mOnSuccessCallback_1.Cancel(), mOnFailureCallback_1.Cancel()); } - static void OnSuccessCallback_9(void * context, bool onOff) + void OnFailureResponse_1(uint8_t status) { ThrowFailureResponse(); } + + void OnSuccessResponse_1(bool onOff) { - (static_cast(context))->OnSuccessResponse_9(onOff); + VerifyOrReturn(CheckValue("onOff", onOff, 1)); + NextTest(); } - static void OnFailureCallback_10(void * context, uint8_t status) + CHIP_ERROR TestStepUpColorTemperatureCommand_2() { - (static_cast(context))->OnFailureResponse_10(status); - } + chip::Controller::ColorControlClusterTest cluster; + cluster.Associate(mDevice, 1); - static void OnSuccessCallback_10(void * context) { (static_cast(context))->OnSuccessResponse_10(); } + uint8_t stepModeArgument = 1; + uint16_t stepSizeArgument = 5U; + uint16_t transitionTimeArgument = 50U; + uint16_t colorTemperatureMinimumArgument = 5U; + uint16_t colorTemperatureMaximumArgument = 100U; + uint8_t optionsMaskArgument = 0; + uint8_t optionsOverrideArgument = 0; - static void OnFailureCallback_11(void * context, uint8_t status) - { - (static_cast(context))->OnFailureResponse_11(status); + return cluster.StepColorTemperature(mOnSuccessCallback_2.Cancel(), mOnFailureCallback_2.Cancel(), stepModeArgument, + stepSizeArgument, transitionTimeArgument, colorTemperatureMinimumArgument, + colorTemperatureMaximumArgument, optionsMaskArgument, optionsOverrideArgument); } - static void OnSuccessCallback_11(void * context, bool onOff) - { - (static_cast(context))->OnSuccessResponse_11(onOff); - } + void OnFailureResponse_2(uint8_t status) { ThrowFailureResponse(); } - static void OnFailureCallback_12(void * context, uint8_t status) + void OnSuccessResponse_2() { NextTest(); } + + CHIP_ERROR TestStepDownColorTemperatureCommand_3() { - (static_cast(context))->OnFailureResponse_12(status); - } + chip::Controller::ColorControlClusterTest cluster; + cluster.Associate(mDevice, 1); - static void OnSuccessCallback_12(void * context) { (static_cast(context))->OnSuccessResponse_12(); } + uint8_t stepModeArgument = 3; + uint16_t stepSizeArgument = 5U; + uint16_t transitionTimeArgument = 50U; + uint16_t colorTemperatureMinimumArgument = 5U; + uint16_t colorTemperatureMaximumArgument = 100U; + uint8_t optionsMaskArgument = 0; + uint8_t optionsOverrideArgument = 0; - static void OnFailureCallback_13(void * context, uint8_t status) - { - (static_cast(context))->OnFailureResponse_13(status); + return cluster.StepColorTemperature(mOnSuccessCallback_3.Cancel(), mOnFailureCallback_3.Cancel(), stepModeArgument, + stepSizeArgument, transitionTimeArgument, colorTemperatureMinimumArgument, + colorTemperatureMaximumArgument, optionsMaskArgument, optionsOverrideArgument); } - static void OnSuccessCallback_13(void * context, bool onOff) - { - (static_cast(context))->OnSuccessResponse_13(onOff); - } + void OnFailureResponse_3(uint8_t status) { ThrowFailureResponse(); } - // - // Tests methods - // + void OnSuccessResponse_3() { NextTest(); } - CHIP_ERROR TestSendOffCommand_0() + CHIP_ERROR TestTurnOffLightThatWeTurnedOn_4() { chip::Controller::OnOffClusterTest cluster; cluster.Associate(mDevice, 1); - return cluster.Off(mOnSuccessCallback_0.Cancel(), mOnFailureCallback_0.Cancel()); + return cluster.Off(mOnSuccessCallback_4.Cancel(), mOnFailureCallback_4.Cancel()); } - void OnFailureResponse_0(uint8_t status) { ThrowFailureResponse(); } + void OnFailureResponse_4(uint8_t status) { ThrowFailureResponse(); } - void OnSuccessResponse_0() { NextTest(); } + void OnSuccessResponse_4() { NextTest(); } - CHIP_ERROR TestCheckOnOffAttributeValueIsFalseAfterOffCommand_1() + CHIP_ERROR TestCheckOnOffAttributeValueIsFalseAfterOffCommand_5() { chip::Controller::OnOffClusterTest cluster; cluster.Associate(mDevice, 1); - return cluster.ReadAttributeOnOff(mOnSuccessCallback_1.Cancel(), mOnFailureCallback_1.Cancel()); + return cluster.ReadAttributeOnOff(mOnSuccessCallback_5.Cancel(), mOnFailureCallback_5.Cancel()); } - void OnFailureResponse_1(uint8_t status) { ThrowFailureResponse(); } + void OnFailureResponse_5(uint8_t status) { ThrowFailureResponse(); } - void OnSuccessResponse_1(bool onOff) + void OnSuccessResponse_5(bool onOff) { VerifyOrReturn(CheckValue("onOff", onOff, 0)); NextTest(); } +}; - CHIP_ERROR TestSendOnCommand_2() +class Test_TC_CC_7_1 : public TestCommand +{ +public: + Test_TC_CC_7_1() : TestCommand("Test_TC_CC_7_1"), mTestIndex(0) {} + + /////////// TestCommand Interface ///////// + void NextTest() override { - chip::Controller::OnOffClusterTest cluster; - cluster.Associate(mDevice, 1); + CHIP_ERROR err = CHIP_NO_ERROR; - return cluster.On(mOnSuccessCallback_2.Cancel(), mOnFailureCallback_2.Cancel()); + if (0 == mTestIndex) + { + ChipLogProgress(chipTool, " **** Test Start: Test_TC_CC_7_1\n"); + } + + if (mTestCount == mTestIndex) + { + ChipLogProgress(chipTool, " **** Test Complete: Test_TC_CC_7_1\n"); + SetCommandExitStatus(CHIP_NO_ERROR); + return; + } + + // Ensure we increment mTestIndex before we start running the relevant + // command. That way if we lose the timeslice after we send the message + // but before our function call returns, we won't end up with an + // incorrect mTestIndex value observed when we get the response. + switch (mTestIndex++) + { + case 0: + ChipLogProgress(chipTool, " ***** Test Step 0 : Turn on light for color control tests\n"); + err = TestTurnOnLightForColorControlTests_0(); + break; + case 1: + ChipLogProgress(chipTool, " ***** Test Step 1 : Check on/off attribute value is true after on command\n"); + err = TestCheckOnOffAttributeValueIsTrueAfterOnCommand_1(); + break; + case 2: + ChipLogProgress(chipTool, " ***** Test Step 2 : Enhanced Move To Hue command\n"); + err = TestEnhancedMoveToHueCommand_2(); + break; + case 3: + ChipLogProgress( + chipTool, " ***** Test Step 3 : Check Remaining time attribute value matched the value sent by the last command\n"); + err = TestCheckRemainingTimeAttributeValueMatchedTheValueSentByTheLastCommand_3(); + break; + case 4: + ChipLogProgress(chipTool, " ***** Test Step 4 : Turn off light that we turned on\n"); + err = TestTurnOffLightThatWeTurnedOn_4(); + break; + case 5: + ChipLogProgress(chipTool, " ***** Test Step 5 : Check on/off attribute value is false after off command\n"); + err = TestCheckOnOffAttributeValueIsFalseAfterOffCommand_5(); + break; + } + + if (CHIP_NO_ERROR != err) + { + ChipLogError(chipTool, " ***** Test Failure: %s\n", chip::ErrorStr(err)); + SetCommandExitStatus(err); + } } - void OnFailureResponse_2(uint8_t status) { ThrowFailureResponse(); } +private: + std::atomic_uint16_t mTestIndex; + const uint16_t mTestCount = 6; - void OnSuccessResponse_2() { NextTest(); } + chip::Callback::Callback mOnFailureCallback_0{ OnFailureCallback_0, this }; + chip::Callback::Callback mOnSuccessCallback_0{ OnSuccessCallback_0, this }; + chip::Callback::Callback mOnFailureCallback_1{ OnFailureCallback_1, this }; + chip::Callback::Callback mOnSuccessCallback_1{ OnSuccessCallback_1, this }; + chip::Callback::Callback mOnFailureCallback_2{ OnFailureCallback_2, this }; + chip::Callback::Callback mOnSuccessCallback_2{ OnSuccessCallback_2, this }; + chip::Callback::Callback mOnFailureCallback_3{ OnFailureCallback_3, this }; + chip::Callback::Callback mOnSuccessCallback_3{ OnSuccessCallback_3, this }; + chip::Callback::Callback mOnFailureCallback_4{ OnFailureCallback_4, this }; + chip::Callback::Callback mOnSuccessCallback_4{ OnSuccessCallback_4, this }; + chip::Callback::Callback mOnFailureCallback_5{ OnFailureCallback_5, this }; + chip::Callback::Callback mOnSuccessCallback_5{ OnSuccessCallback_5, this }; - CHIP_ERROR TestCheckOnOffAttributeValueIsTrueAfterOnCommand_3() + static void OnFailureCallback_0(void * context, uint8_t status) { - chip::Controller::OnOffClusterTest cluster; - cluster.Associate(mDevice, 1); - - return cluster.ReadAttributeOnOff(mOnSuccessCallback_3.Cancel(), mOnFailureCallback_3.Cancel()); + (static_cast(context))->OnFailureResponse_0(status); } - void OnFailureResponse_3(uint8_t status) { ThrowFailureResponse(); } + static void OnSuccessCallback_0(void * context) { (static_cast(context))->OnSuccessResponse_0(); } - void OnSuccessResponse_3(bool onOff) + static void OnFailureCallback_1(void * context, uint8_t status) { - VerifyOrReturn(CheckValue("onOff", onOff, 1)); - NextTest(); + (static_cast(context))->OnFailureResponse_1(status); } - CHIP_ERROR TestSendOffCommand_4() + static void OnSuccessCallback_1(void * context, bool onOff) { - chip::Controller::OnOffClusterTest cluster; - cluster.Associate(mDevice, 1); - - return cluster.Off(mOnSuccessCallback_4.Cancel(), mOnFailureCallback_4.Cancel()); + (static_cast(context))->OnSuccessResponse_1(onOff); } - void OnFailureResponse_4(uint8_t status) { ThrowFailureResponse(); } - - void OnSuccessResponse_4() { NextTest(); } - - CHIP_ERROR TestCheckOnOffAttributeValueIsFalseAfterOffCommand_5() + static void OnFailureCallback_2(void * context, uint8_t status) { - chip::Controller::OnOffClusterTest cluster; - cluster.Associate(mDevice, 1); - - return cluster.ReadAttributeOnOff(mOnSuccessCallback_5.Cancel(), mOnFailureCallback_5.Cancel()); + (static_cast(context))->OnFailureResponse_2(status); } - void OnFailureResponse_5(uint8_t status) { ThrowFailureResponse(); } + static void OnSuccessCallback_2(void * context) { (static_cast(context))->OnSuccessResponse_2(); } - void OnSuccessResponse_5(bool onOff) + static void OnFailureCallback_3(void * context, uint8_t status) { - VerifyOrReturn(CheckValue("onOff", onOff, 0)); - NextTest(); + (static_cast(context))->OnFailureResponse_3(status); } - CHIP_ERROR TestSendToggleCommand_6() + static void OnSuccessCallback_3(void * context, uint16_t remainingTime) { - chip::Controller::OnOffClusterTest cluster; - cluster.Associate(mDevice, 1); - - return cluster.Toggle(mOnSuccessCallback_6.Cancel(), mOnFailureCallback_6.Cancel()); + (static_cast(context))->OnSuccessResponse_3(remainingTime); } - void OnFailureResponse_6(uint8_t status) { ThrowFailureResponse(); } + static void OnFailureCallback_4(void * context, uint8_t status) + { + (static_cast(context))->OnFailureResponse_4(status); + } - void OnSuccessResponse_6() { NextTest(); } + static void OnSuccessCallback_4(void * context) { (static_cast(context))->OnSuccessResponse_4(); } - CHIP_ERROR TestCheckOnOffAttributeValueIsTrueAfterToggleCommand_7() + static void OnFailureCallback_5(void * context, uint8_t status) { - chip::Controller::OnOffClusterTest cluster; - cluster.Associate(mDevice, 1); - - return cluster.ReadAttributeOnOff(mOnSuccessCallback_7.Cancel(), mOnFailureCallback_7.Cancel()); + (static_cast(context))->OnFailureResponse_5(status); } - void OnFailureResponse_7(uint8_t status) { ThrowFailureResponse(); } - - void OnSuccessResponse_7(bool onOff) + static void OnSuccessCallback_5(void * context, bool onOff) { - VerifyOrReturn(CheckValue("onOff", onOff, 1)); - NextTest(); + (static_cast(context))->OnSuccessResponse_5(onOff); } - CHIP_ERROR TestSendToggleCommand_8() + // + // Tests methods + // + + CHIP_ERROR TestTurnOnLightForColorControlTests_0() { chip::Controller::OnOffClusterTest cluster; cluster.Associate(mDevice, 1); - return cluster.Toggle(mOnSuccessCallback_8.Cancel(), mOnFailureCallback_8.Cancel()); + return cluster.On(mOnSuccessCallback_0.Cancel(), mOnFailureCallback_0.Cancel()); } - void OnFailureResponse_8(uint8_t status) { ThrowFailureResponse(); } + void OnFailureResponse_0(uint8_t status) { ThrowFailureResponse(); } - void OnSuccessResponse_8() { NextTest(); } + void OnSuccessResponse_0() { NextTest(); } - CHIP_ERROR TestCheckOnOffAttributeValueIsFalseAfterToggleCommand_9() + CHIP_ERROR TestCheckOnOffAttributeValueIsTrueAfterOnCommand_1() { chip::Controller::OnOffClusterTest cluster; cluster.Associate(mDevice, 1); - return cluster.ReadAttributeOnOff(mOnSuccessCallback_9.Cancel(), mOnFailureCallback_9.Cancel()); + return cluster.ReadAttributeOnOff(mOnSuccessCallback_1.Cancel(), mOnFailureCallback_1.Cancel()); } - void OnFailureResponse_9(uint8_t status) { ThrowFailureResponse(); } + void OnFailureResponse_1(uint8_t status) { ThrowFailureResponse(); } - void OnSuccessResponse_9(bool onOff) + void OnSuccessResponse_1(bool onOff) { - VerifyOrReturn(CheckValue("onOff", onOff, 0)); + VerifyOrReturn(CheckValue("onOff", onOff, 1)); NextTest(); } - CHIP_ERROR TestSendOnCommand_10() + CHIP_ERROR TestEnhancedMoveToHueCommand_2() { - chip::Controller::OnOffClusterTest cluster; + chip::Controller::ColorControlClusterTest cluster; cluster.Associate(mDevice, 1); - return cluster.On(mOnSuccessCallback_10.Cancel(), mOnFailureCallback_10.Cancel()); + uint16_t enhancedHueArgument = 1025U; + uint8_t directionArgument = 0; + uint16_t transitionTimeArgument = 1U; + uint8_t optionsMaskArgument = 0; + uint8_t optionsOverrideArgument = 0; + + return cluster.EnhancedMoveToHue(mOnSuccessCallback_2.Cancel(), mOnFailureCallback_2.Cancel(), enhancedHueArgument, + directionArgument, transitionTimeArgument, optionsMaskArgument, optionsOverrideArgument); } - void OnFailureResponse_10(uint8_t status) { ThrowFailureResponse(); } + void OnFailureResponse_2(uint8_t status) { ThrowFailureResponse(); } - void OnSuccessResponse_10() { NextTest(); } + void OnSuccessResponse_2() { NextTest(); } - CHIP_ERROR TestCheckOnOffAttributeValueIsTrueAfterOnCommand_11() + CHIP_ERROR TestCheckRemainingTimeAttributeValueMatchedTheValueSentByTheLastCommand_3() { - chip::Controller::OnOffClusterTest cluster; + chip::Controller::ColorControlClusterTest cluster; cluster.Associate(mDevice, 1); - return cluster.ReadAttributeOnOff(mOnSuccessCallback_11.Cancel(), mOnFailureCallback_11.Cancel()); + return cluster.ReadAttributeRemainingTime(mOnSuccessCallback_3.Cancel(), mOnFailureCallback_3.Cancel()); } - void OnFailureResponse_11(uint8_t status) { ThrowFailureResponse(); } + void OnFailureResponse_3(uint8_t status) { ThrowFailureResponse(); } - void OnSuccessResponse_11(bool onOff) + void OnSuccessResponse_3(uint16_t remainingTime) { - VerifyOrReturn(CheckValue("onOff", onOff, 1)); + VerifyOrReturn(CheckValue("remainingTime", remainingTime, 1U)); NextTest(); } - CHIP_ERROR TestSendOffCommand_12() + CHIP_ERROR TestTurnOffLightThatWeTurnedOn_4() { chip::Controller::OnOffClusterTest cluster; cluster.Associate(mDevice, 1); - return cluster.Off(mOnSuccessCallback_12.Cancel(), mOnFailureCallback_12.Cancel()); + return cluster.Off(mOnSuccessCallback_4.Cancel(), mOnFailureCallback_4.Cancel()); } - void OnFailureResponse_12(uint8_t status) { ThrowFailureResponse(); } + void OnFailureResponse_4(uint8_t status) { ThrowFailureResponse(); } - void OnSuccessResponse_12() { NextTest(); } + void OnSuccessResponse_4() { NextTest(); } - CHIP_ERROR TestCheckOnOffAttributeValueIsFalseAfterOffCommand_13() + CHIP_ERROR TestCheckOnOffAttributeValueIsFalseAfterOffCommand_5() { chip::Controller::OnOffClusterTest cluster; cluster.Associate(mDevice, 1); - return cluster.ReadAttributeOnOff(mOnSuccessCallback_13.Cancel(), mOnFailureCallback_13.Cancel()); + return cluster.ReadAttributeOnOff(mOnSuccessCallback_5.Cancel(), mOnFailureCallback_5.Cancel()); } - void OnFailureResponse_13(uint8_t status) { ThrowFailureResponse(); } + void OnFailureResponse_5(uint8_t status) { ThrowFailureResponse(); } - void OnSuccessResponse_13(bool onOff) + void OnSuccessResponse_5(bool onOff) { VerifyOrReturn(CheckValue("onOff", onOff, 0)); NextTest(); } }; -class Test_TC_DM_1_1 : public TestCommand +class Test_TC_CC_7_2 : public TestCommand { public: - Test_TC_DM_1_1() : TestCommand("Test_TC_DM_1_1"), mTestIndex(0) {} + Test_TC_CC_7_2() : TestCommand("Test_TC_CC_7_2"), mTestIndex(0) {} /////////// TestCommand Interface ///////// void NextTest() override @@ -7425,12 +8040,12 @@ class Test_TC_DM_1_1 : public TestCommand if (0 == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Start: Test_TC_DM_1_1\n"); + ChipLogProgress(chipTool, " **** Test Start: Test_TC_CC_7_2\n"); } if (mTestCount == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Complete: Test_TC_DM_1_1\n"); + ChipLogProgress(chipTool, " **** Test Complete: Test_TC_CC_7_2\n"); SetCommandExitStatus(CHIP_NO_ERROR); return; } @@ -7442,76 +8057,36 @@ class Test_TC_DM_1_1 : public TestCommand switch (mTestIndex++) { case 0: - ChipLogProgress(chipTool, " ***** Test Step 0 : Query Interaction Model Version\n"); - err = TestQueryInteractionModelVersion_0(); + ChipLogProgress(chipTool, " ***** Test Step 0 : Turn on light for color control tests\n"); + err = TestTurnOnLightForColorControlTests_0(); break; case 1: - ChipLogProgress(chipTool, " ***** Test Step 1 : Query Vendor Name\n"); - err = TestQueryVendorName_1(); + ChipLogProgress(chipTool, " ***** Test Step 1 : Check on/off attribute value is true after on command\n"); + err = TestCheckOnOffAttributeValueIsTrueAfterOnCommand_1(); break; case 2: - ChipLogProgress(chipTool, " ***** Test Step 2 : Query VendorID\n"); - err = TestQueryVendorID_2(); + ChipLogProgress(chipTool, " ***** Test Step 2 : Enhanced Move Hue Down command \n"); + err = TestEnhancedMoveHueDownCommand_2(); break; case 3: - ChipLogProgress(chipTool, " ***** Test Step 3 : Query Product Name\n"); - err = TestQueryProductName_3(); + ChipLogProgress(chipTool, " ***** Test Step 3 : Enhanced Move Hue Stop command\n"); + err = TestEnhancedMoveHueStopCommand_3(); break; case 4: - ChipLogProgress(chipTool, " ***** Test Step 4 : Query ProductID\n"); - err = TestQueryProductID_4(); + ChipLogProgress(chipTool, " ***** Test Step 4 : Enhanced Move Hue Up command\n"); + err = TestEnhancedMoveHueUpCommand_4(); break; case 5: - ChipLogProgress(chipTool, " ***** Test Step 5 : Query User Label\n"); - err = TestQueryUserLabel_5(); + ChipLogProgress(chipTool, " ***** Test Step 5 : Enhanced Move Hue Stop command\n"); + err = TestEnhancedMoveHueStopCommand_5(); break; case 6: - ChipLogProgress(chipTool, " ***** Test Step 6 : Query User Location\n"); - err = TestQueryUserLocation_6(); + ChipLogProgress(chipTool, " ***** Test Step 6 : Turn off light that we turned on\n"); + err = TestTurnOffLightThatWeTurnedOn_6(); break; case 7: - ChipLogProgress(chipTool, " ***** Test Step 7 : Query HardwareVersion\n"); - err = TestQueryHardwareVersion_7(); - break; - case 8: - ChipLogProgress(chipTool, " ***** Test Step 8 : Query HardwareVersionString\n"); - err = TestQueryHardwareVersionString_8(); - break; - case 9: - ChipLogProgress(chipTool, " ***** Test Step 9 : Query SoftwareVersion\n"); - err = TestQuerySoftwareVersion_9(); - break; - case 10: - ChipLogProgress(chipTool, " ***** Test Step 10 : Query SoftwareVersionString\n"); - err = TestQuerySoftwareVersionString_10(); - break; - case 11: - ChipLogProgress(chipTool, " ***** Test Step 11 : Query ManufacturingDate\n"); - err = TestQueryManufacturingDate_11(); - break; - case 12: - ChipLogProgress(chipTool, " ***** Test Step 12 : Query PartNumber\n"); - err = TestQueryPartNumber_12(); - break; - case 13: - ChipLogProgress(chipTool, " ***** Test Step 13 : Query ProductURL\n"); - err = TestQueryProductURL_13(); - break; - case 14: - ChipLogProgress(chipTool, " ***** Test Step 14 : Query ProductLabel\n"); - err = TestQueryProductLabel_14(); - break; - case 15: - ChipLogProgress(chipTool, " ***** Test Step 15 : Query SerialNumber\n"); - err = TestQuerySerialNumber_15(); - break; - case 16: - ChipLogProgress(chipTool, " ***** Test Step 16 : Query LocalConfigDisabled\n"); - err = TestQueryLocalConfigDisabled_16(); - break; - case 17: - ChipLogProgress(chipTool, " ***** Test Step 17 : Query Reachable\n"); - err = TestQueryReachable_17(); + ChipLogProgress(chipTool, " ***** Test Step 7 : Check on/off attribute value is false after off command\n"); + err = TestCheckOnOffAttributeValueIsFalseAfterOffCommand_7(); break; } @@ -7524,620 +8099,449 @@ class Test_TC_DM_1_1 : public TestCommand private: std::atomic_uint16_t mTestIndex; - const uint16_t mTestCount = 18; + const uint16_t mTestCount = 8; chip::Callback::Callback mOnFailureCallback_0{ OnFailureCallback_0, this }; - chip::Callback::Callback mOnSuccessCallback_0{ OnSuccessCallback_0, - this }; + chip::Callback::Callback mOnSuccessCallback_0{ OnSuccessCallback_0, this }; chip::Callback::Callback mOnFailureCallback_1{ OnFailureCallback_1, this }; - chip::Callback::Callback mOnSuccessCallback_1{ OnSuccessCallback_1, this }; - chip::Callback::Callback mOnFailureCallback_2{ OnFailureCallback_2, this }; - chip::Callback::Callback mOnSuccessCallback_2{ OnSuccessCallback_2, this }; - chip::Callback::Callback mOnFailureCallback_3{ OnFailureCallback_3, this }; - chip::Callback::Callback mOnSuccessCallback_3{ OnSuccessCallback_3, - this }; - chip::Callback::Callback mOnFailureCallback_4{ OnFailureCallback_4, this }; - chip::Callback::Callback mOnSuccessCallback_4{ OnSuccessCallback_4, this }; - chip::Callback::Callback mOnFailureCallback_5{ OnFailureCallback_5, this }; - chip::Callback::Callback mOnSuccessCallback_5{ OnSuccessCallback_5, this }; - chip::Callback::Callback mOnFailureCallback_6{ OnFailureCallback_6, this }; - chip::Callback::Callback mOnSuccessCallback_6{ OnSuccessCallback_6, this }; - chip::Callback::Callback mOnFailureCallback_7{ OnFailureCallback_7, this }; - chip::Callback::Callback mOnSuccessCallback_7{ OnSuccessCallback_7, this }; - chip::Callback::Callback mOnFailureCallback_8{ OnFailureCallback_8, this }; - chip::Callback::Callback mOnSuccessCallback_8{ - OnSuccessCallback_8, this - }; - chip::Callback::Callback mOnFailureCallback_9{ OnFailureCallback_9, this }; - chip::Callback::Callback mOnSuccessCallback_9{ OnSuccessCallback_9, this }; - chip::Callback::Callback mOnFailureCallback_10{ OnFailureCallback_10, this }; - chip::Callback::Callback mOnSuccessCallback_10{ - OnSuccessCallback_10, this - }; - chip::Callback::Callback mOnFailureCallback_11{ OnFailureCallback_11, this }; - chip::Callback::Callback mOnSuccessCallback_11{ - OnSuccessCallback_11, this - }; - chip::Callback::Callback mOnFailureCallback_12{ OnFailureCallback_12, this }; - chip::Callback::Callback mOnSuccessCallback_12{ OnSuccessCallback_12, - this }; - chip::Callback::Callback mOnFailureCallback_13{ OnFailureCallback_13, this }; - chip::Callback::Callback mOnSuccessCallback_13{ OnSuccessCallback_13, - this }; - chip::Callback::Callback mOnFailureCallback_14{ OnFailureCallback_14, this }; - chip::Callback::Callback mOnSuccessCallback_14{ OnSuccessCallback_14, - this }; - chip::Callback::Callback mOnFailureCallback_15{ OnFailureCallback_15, this }; - chip::Callback::Callback mOnSuccessCallback_15{ OnSuccessCallback_15, - this }; - chip::Callback::Callback mOnFailureCallback_16{ OnFailureCallback_16, this }; - chip::Callback::Callback mOnSuccessCallback_16{ OnSuccessCallback_16, - this }; - chip::Callback::Callback mOnFailureCallback_17{ OnFailureCallback_17, this }; - chip::Callback::Callback mOnSuccessCallback_17{ OnSuccessCallback_17, this }; + chip::Callback::Callback mOnSuccessCallback_1{ OnSuccessCallback_1, this }; + chip::Callback::Callback mOnFailureCallback_2{ OnFailureCallback_2, this }; + chip::Callback::Callback mOnSuccessCallback_2{ OnSuccessCallback_2, this }; + chip::Callback::Callback mOnFailureCallback_3{ OnFailureCallback_3, this }; + chip::Callback::Callback mOnSuccessCallback_3{ OnSuccessCallback_3, this }; + chip::Callback::Callback mOnFailureCallback_4{ OnFailureCallback_4, this }; + chip::Callback::Callback mOnSuccessCallback_4{ OnSuccessCallback_4, this }; + chip::Callback::Callback mOnFailureCallback_5{ OnFailureCallback_5, this }; + chip::Callback::Callback mOnSuccessCallback_5{ OnSuccessCallback_5, this }; + chip::Callback::Callback mOnFailureCallback_6{ OnFailureCallback_6, this }; + chip::Callback::Callback mOnSuccessCallback_6{ OnSuccessCallback_6, this }; + chip::Callback::Callback mOnFailureCallback_7{ OnFailureCallback_7, this }; + chip::Callback::Callback mOnSuccessCallback_7{ OnSuccessCallback_7, this }; static void OnFailureCallback_0(void * context, uint8_t status) { - (static_cast(context))->OnFailureResponse_0(status); + (static_cast(context))->OnFailureResponse_0(status); } - static void OnSuccessCallback_0(void * context, uint16_t interactionModelVersion) - { - (static_cast(context))->OnSuccessResponse_0(interactionModelVersion); - } + static void OnSuccessCallback_0(void * context) { (static_cast(context))->OnSuccessResponse_0(); } static void OnFailureCallback_1(void * context, uint8_t status) { - (static_cast(context))->OnFailureResponse_1(status); + (static_cast(context))->OnFailureResponse_1(status); } - static void OnSuccessCallback_1(void * context, chip::ByteSpan vendorName) + static void OnSuccessCallback_1(void * context, bool onOff) { - (static_cast(context))->OnSuccessResponse_1(vendorName); + (static_cast(context))->OnSuccessResponse_1(onOff); } static void OnFailureCallback_2(void * context, uint8_t status) { - (static_cast(context))->OnFailureResponse_2(status); + (static_cast(context))->OnFailureResponse_2(status); } - static void OnSuccessCallback_2(void * context, uint16_t vendorID) - { - (static_cast(context))->OnSuccessResponse_2(vendorID); - } + static void OnSuccessCallback_2(void * context) { (static_cast(context))->OnSuccessResponse_2(); } static void OnFailureCallback_3(void * context, uint8_t status) { - (static_cast(context))->OnFailureResponse_3(status); + (static_cast(context))->OnFailureResponse_3(status); } - static void OnSuccessCallback_3(void * context, chip::ByteSpan productName) - { - (static_cast(context))->OnSuccessResponse_3(productName); - } + static void OnSuccessCallback_3(void * context) { (static_cast(context))->OnSuccessResponse_3(); } static void OnFailureCallback_4(void * context, uint8_t status) { - (static_cast(context))->OnFailureResponse_4(status); + (static_cast(context))->OnFailureResponse_4(status); } - static void OnSuccessCallback_4(void * context, uint16_t productID) - { - (static_cast(context))->OnSuccessResponse_4(productID); - } + static void OnSuccessCallback_4(void * context) { (static_cast(context))->OnSuccessResponse_4(); } static void OnFailureCallback_5(void * context, uint8_t status) { - (static_cast(context))->OnFailureResponse_5(status); + (static_cast(context))->OnFailureResponse_5(status); } - static void OnSuccessCallback_5(void * context, chip::ByteSpan userLabel) - { - (static_cast(context))->OnSuccessResponse_5(userLabel); - } + static void OnSuccessCallback_5(void * context) { (static_cast(context))->OnSuccessResponse_5(); } static void OnFailureCallback_6(void * context, uint8_t status) { - (static_cast(context))->OnFailureResponse_6(status); + (static_cast(context))->OnFailureResponse_6(status); } - static void OnSuccessCallback_6(void * context, chip::ByteSpan location) - { - (static_cast(context))->OnSuccessResponse_6(location); - } + static void OnSuccessCallback_6(void * context) { (static_cast(context))->OnSuccessResponse_6(); } static void OnFailureCallback_7(void * context, uint8_t status) { - (static_cast(context))->OnFailureResponse_7(status); - } - - static void OnSuccessCallback_7(void * context, uint16_t hardwareVersion) - { - (static_cast(context))->OnSuccessResponse_7(hardwareVersion); - } - - static void OnFailureCallback_8(void * context, uint8_t status) - { - (static_cast(context))->OnFailureResponse_8(status); - } - - static void OnSuccessCallback_8(void * context, chip::ByteSpan hardwareVersionString) - { - (static_cast(context))->OnSuccessResponse_8(hardwareVersionString); - } - - static void OnFailureCallback_9(void * context, uint8_t status) - { - (static_cast(context))->OnFailureResponse_9(status); - } - - static void OnSuccessCallback_9(void * context, uint32_t softwareVersion) - { - (static_cast(context))->OnSuccessResponse_9(softwareVersion); - } - - static void OnFailureCallback_10(void * context, uint8_t status) - { - (static_cast(context))->OnFailureResponse_10(status); - } - - static void OnSuccessCallback_10(void * context, chip::ByteSpan softwareVersionString) - { - (static_cast(context))->OnSuccessResponse_10(softwareVersionString); - } - - static void OnFailureCallback_11(void * context, uint8_t status) - { - (static_cast(context))->OnFailureResponse_11(status); - } - - static void OnSuccessCallback_11(void * context, chip::ByteSpan manufacturingDate) - { - (static_cast(context))->OnSuccessResponse_11(manufacturingDate); - } - - static void OnFailureCallback_12(void * context, uint8_t status) - { - (static_cast(context))->OnFailureResponse_12(status); - } - - static void OnSuccessCallback_12(void * context, chip::ByteSpan partNumber) - { - (static_cast(context))->OnSuccessResponse_12(partNumber); - } - - static void OnFailureCallback_13(void * context, uint8_t status) - { - (static_cast(context))->OnFailureResponse_13(status); - } - - static void OnSuccessCallback_13(void * context, chip::ByteSpan productURL) - { - (static_cast(context))->OnSuccessResponse_13(productURL); - } - - static void OnFailureCallback_14(void * context, uint8_t status) - { - (static_cast(context))->OnFailureResponse_14(status); - } - - static void OnSuccessCallback_14(void * context, chip::ByteSpan productLabel) - { - (static_cast(context))->OnSuccessResponse_14(productLabel); - } - - static void OnFailureCallback_15(void * context, uint8_t status) - { - (static_cast(context))->OnFailureResponse_15(status); - } - - static void OnSuccessCallback_15(void * context, chip::ByteSpan serialNumber) - { - (static_cast(context))->OnSuccessResponse_15(serialNumber); - } - - static void OnFailureCallback_16(void * context, uint8_t status) - { - (static_cast(context))->OnFailureResponse_16(status); - } - - static void OnSuccessCallback_16(void * context, bool localConfigDisabled) - { - (static_cast(context))->OnSuccessResponse_16(localConfigDisabled); - } - - static void OnFailureCallback_17(void * context, uint8_t status) - { - (static_cast(context))->OnFailureResponse_17(status); + (static_cast(context))->OnFailureResponse_7(status); } - static void OnSuccessCallback_17(void * context, bool reachable) + static void OnSuccessCallback_7(void * context, bool onOff) { - (static_cast(context))->OnSuccessResponse_17(reachable); + (static_cast(context))->OnSuccessResponse_7(onOff); } // // Tests methods // - CHIP_ERROR TestQueryInteractionModelVersion_0() + CHIP_ERROR TestTurnOnLightForColorControlTests_0() { - chip::Controller::BasicClusterTest cluster; - cluster.Associate(mDevice, 0); + chip::Controller::OnOffClusterTest cluster; + cluster.Associate(mDevice, 1); - return cluster.ReadAttributeInteractionModelVersion(mOnSuccessCallback_0.Cancel(), mOnFailureCallback_0.Cancel()); + return cluster.On(mOnSuccessCallback_0.Cancel(), mOnFailureCallback_0.Cancel()); } void OnFailureResponse_0(uint8_t status) { ThrowFailureResponse(); } - void OnSuccessResponse_0(uint16_t interactionModelVersion) - { - VerifyOrReturn(CheckConstraintType("interactionModelVersion", "", "uint16")); - NextTest(); - } + void OnSuccessResponse_0() { NextTest(); } - CHIP_ERROR TestQueryVendorName_1() + CHIP_ERROR TestCheckOnOffAttributeValueIsTrueAfterOnCommand_1() { - chip::Controller::BasicClusterTest cluster; - cluster.Associate(mDevice, 0); + chip::Controller::OnOffClusterTest cluster; + cluster.Associate(mDevice, 1); - return cluster.ReadAttributeVendorName(mOnSuccessCallback_1.Cancel(), mOnFailureCallback_1.Cancel()); + return cluster.ReadAttributeOnOff(mOnSuccessCallback_1.Cancel(), mOnFailureCallback_1.Cancel()); } void OnFailureResponse_1(uint8_t status) { ThrowFailureResponse(); } - void OnSuccessResponse_1(chip::ByteSpan vendorName) + void OnSuccessResponse_1(bool onOff) { - VerifyOrReturn(CheckConstraintType("vendorName", "", "string")); - VerifyOrReturn(CheckConstraintMaxLength("vendorName", vendorName.size(), 32)); + VerifyOrReturn(CheckValue("onOff", onOff, 1)); NextTest(); } - CHIP_ERROR TestQueryVendorID_2() + CHIP_ERROR TestEnhancedMoveHueDownCommand_2() { - chip::Controller::BasicClusterTest cluster; - cluster.Associate(mDevice, 0); + chip::Controller::ColorControlClusterTest cluster; + cluster.Associate(mDevice, 1); - return cluster.ReadAttributeVendorID(mOnSuccessCallback_2.Cancel(), mOnFailureCallback_2.Cancel()); + uint8_t moveModeArgument = 3; + uint16_t rateArgument = 5U; + uint8_t optionsMaskArgument = 0; + uint8_t optionsOverrideArgument = 0; + + return cluster.EnhancedMoveHue(mOnSuccessCallback_2.Cancel(), mOnFailureCallback_2.Cancel(), moveModeArgument, rateArgument, + optionsMaskArgument, optionsOverrideArgument); } void OnFailureResponse_2(uint8_t status) { ThrowFailureResponse(); } - void OnSuccessResponse_2(uint16_t vendorID) - { - VerifyOrReturn(CheckConstraintType("vendorID", "", "uint16")); - NextTest(); - } + void OnSuccessResponse_2() { NextTest(); } - CHIP_ERROR TestQueryProductName_3() + CHIP_ERROR TestEnhancedMoveHueStopCommand_3() { - chip::Controller::BasicClusterTest cluster; - cluster.Associate(mDevice, 0); + chip::Controller::ColorControlClusterTest cluster; + cluster.Associate(mDevice, 1); - return cluster.ReadAttributeProductName(mOnSuccessCallback_3.Cancel(), mOnFailureCallback_3.Cancel()); + uint8_t moveModeArgument = 0; + uint16_t rateArgument = 0U; + uint8_t optionsMaskArgument = 0; + uint8_t optionsOverrideArgument = 0; + + return cluster.EnhancedMoveHue(mOnSuccessCallback_3.Cancel(), mOnFailureCallback_3.Cancel(), moveModeArgument, rateArgument, + optionsMaskArgument, optionsOverrideArgument); } void OnFailureResponse_3(uint8_t status) { ThrowFailureResponse(); } - void OnSuccessResponse_3(chip::ByteSpan productName) - { - VerifyOrReturn(CheckConstraintType("productName", "", "string")); - VerifyOrReturn(CheckConstraintMaxLength("productName", productName.size(), 32)); - NextTest(); - } + void OnSuccessResponse_3() { NextTest(); } - CHIP_ERROR TestQueryProductID_4() + CHIP_ERROR TestEnhancedMoveHueUpCommand_4() { - chip::Controller::BasicClusterTest cluster; - cluster.Associate(mDevice, 0); + chip::Controller::ColorControlClusterTest cluster; + cluster.Associate(mDevice, 1); - return cluster.ReadAttributeProductID(mOnSuccessCallback_4.Cancel(), mOnFailureCallback_4.Cancel()); + uint8_t moveModeArgument = 1; + uint16_t rateArgument = 50U; + uint8_t optionsMaskArgument = 0; + uint8_t optionsOverrideArgument = 0; + + return cluster.EnhancedMoveHue(mOnSuccessCallback_4.Cancel(), mOnFailureCallback_4.Cancel(), moveModeArgument, rateArgument, + optionsMaskArgument, optionsOverrideArgument); } void OnFailureResponse_4(uint8_t status) { ThrowFailureResponse(); } - void OnSuccessResponse_4(uint16_t productID) - { - VerifyOrReturn(CheckConstraintType("productID", "", "uint16")); - NextTest(); - } + void OnSuccessResponse_4() { NextTest(); } - CHIP_ERROR TestQueryUserLabel_5() + CHIP_ERROR TestEnhancedMoveHueStopCommand_5() { - chip::Controller::BasicClusterTest cluster; - cluster.Associate(mDevice, 0); + chip::Controller::ColorControlClusterTest cluster; + cluster.Associate(mDevice, 1); - return cluster.ReadAttributeUserLabel(mOnSuccessCallback_5.Cancel(), mOnFailureCallback_5.Cancel()); + uint8_t moveModeArgument = 0; + uint16_t rateArgument = 0U; + uint8_t optionsMaskArgument = 0; + uint8_t optionsOverrideArgument = 0; + + return cluster.EnhancedMoveHue(mOnSuccessCallback_5.Cancel(), mOnFailureCallback_5.Cancel(), moveModeArgument, rateArgument, + optionsMaskArgument, optionsOverrideArgument); } void OnFailureResponse_5(uint8_t status) { ThrowFailureResponse(); } - void OnSuccessResponse_5(chip::ByteSpan userLabel) - { - VerifyOrReturn(CheckConstraintType("userLabel", "", "string")); - VerifyOrReturn(CheckConstraintMaxLength("userLabel", userLabel.size(), 32)); - NextTest(); - } + void OnSuccessResponse_5() { NextTest(); } - CHIP_ERROR TestQueryUserLocation_6() + CHIP_ERROR TestTurnOffLightThatWeTurnedOn_6() { - chip::Controller::BasicClusterTest cluster; - cluster.Associate(mDevice, 0); + chip::Controller::OnOffClusterTest cluster; + cluster.Associate(mDevice, 1); - return cluster.ReadAttributeLocation(mOnSuccessCallback_6.Cancel(), mOnFailureCallback_6.Cancel()); + return cluster.Off(mOnSuccessCallback_6.Cancel(), mOnFailureCallback_6.Cancel()); } void OnFailureResponse_6(uint8_t status) { ThrowFailureResponse(); } - void OnSuccessResponse_6(chip::ByteSpan location) - { - VerifyOrReturn(CheckConstraintType("location", "", "string")); - VerifyOrReturn(CheckConstraintFormat("location", "", "ISO 3166-1 alpha-2")); - VerifyOrReturn(CheckConstraintMaxLength("location", location.size(), 2)); - NextTest(); - } + void OnSuccessResponse_6() { NextTest(); } - CHIP_ERROR TestQueryHardwareVersion_7() + CHIP_ERROR TestCheckOnOffAttributeValueIsFalseAfterOffCommand_7() { - chip::Controller::BasicClusterTest cluster; - cluster.Associate(mDevice, 0); + chip::Controller::OnOffClusterTest cluster; + cluster.Associate(mDevice, 1); - return cluster.ReadAttributeHardwareVersion(mOnSuccessCallback_7.Cancel(), mOnFailureCallback_7.Cancel()); + return cluster.ReadAttributeOnOff(mOnSuccessCallback_7.Cancel(), mOnFailureCallback_7.Cancel()); } void OnFailureResponse_7(uint8_t status) { ThrowFailureResponse(); } - void OnSuccessResponse_7(uint16_t hardwareVersion) + void OnSuccessResponse_7(bool onOff) { - VerifyOrReturn(CheckConstraintType("hardwareVersion", "", "uint16")); + VerifyOrReturn(CheckValue("onOff", onOff, 0)); NextTest(); } +}; - CHIP_ERROR TestQueryHardwareVersionString_8() - { - chip::Controller::BasicClusterTest cluster; - cluster.Associate(mDevice, 0); - - return cluster.ReadAttributeHardwareVersionString(mOnSuccessCallback_8.Cancel(), mOnFailureCallback_8.Cancel()); - } - - void OnFailureResponse_8(uint8_t status) { ThrowFailureResponse(); } +class Test_TC_CC_7_3 : public TestCommand +{ +public: + Test_TC_CC_7_3() : TestCommand("Test_TC_CC_7_3"), mTestIndex(0) {} - void OnSuccessResponse_8(chip::ByteSpan hardwareVersionString) + /////////// TestCommand Interface ///////// + void NextTest() override { - VerifyOrReturn(CheckConstraintType("hardwareVersionString", "", "string")); - VerifyOrReturn(CheckConstraintMinLength("hardwareVersionString", hardwareVersionString.size(), 1)); - VerifyOrReturn(CheckConstraintMaxLength("hardwareVersionString", hardwareVersionString.size(), 64)); - NextTest(); - } + CHIP_ERROR err = CHIP_NO_ERROR; - CHIP_ERROR TestQuerySoftwareVersion_9() - { - chip::Controller::BasicClusterTest cluster; - cluster.Associate(mDevice, 0); + if (0 == mTestIndex) + { + ChipLogProgress(chipTool, " **** Test Start: Test_TC_CC_7_3\n"); + } - return cluster.ReadAttributeSoftwareVersion(mOnSuccessCallback_9.Cancel(), mOnFailureCallback_9.Cancel()); - } + if (mTestCount == mTestIndex) + { + ChipLogProgress(chipTool, " **** Test Complete: Test_TC_CC_7_3\n"); + SetCommandExitStatus(CHIP_NO_ERROR); + return; + } - void OnFailureResponse_9(uint8_t status) { ThrowFailureResponse(); } + // Ensure we increment mTestIndex before we start running the relevant + // command. That way if we lose the timeslice after we send the message + // but before our function call returns, we won't end up with an + // incorrect mTestIndex value observed when we get the response. + switch (mTestIndex++) + { + case 0: + ChipLogProgress(chipTool, " ***** Test Step 0 : Turn on light for color control tests\n"); + err = TestTurnOnLightForColorControlTests_0(); + break; + case 1: + ChipLogProgress(chipTool, " ***** Test Step 1 : Check on/off attribute value is true after on command\n"); + err = TestCheckOnOffAttributeValueIsTrueAfterOnCommand_1(); + break; + case 2: + ChipLogProgress(chipTool, " ***** Test Step 2 : Enhanced Step Hue Up command\n"); + err = TestEnhancedStepHueUpCommand_2(); + break; + case 3: + ChipLogProgress(chipTool, " ***** Test Step 3 : Enhanced Step Hue Down command\n"); + err = TestEnhancedStepHueDownCommand_3(); + break; + case 4: + ChipLogProgress(chipTool, " ***** Test Step 4 : Turn off light that we turned on\n"); + err = TestTurnOffLightThatWeTurnedOn_4(); + break; + case 5: + ChipLogProgress(chipTool, " ***** Test Step 5 : Check on/off attribute value is false after off command\n"); + err = TestCheckOnOffAttributeValueIsFalseAfterOffCommand_5(); + break; + } - void OnSuccessResponse_9(uint32_t softwareVersion) - { - VerifyOrReturn(CheckConstraintType("softwareVersion", "", "uint32")); - NextTest(); + if (CHIP_NO_ERROR != err) + { + ChipLogError(chipTool, " ***** Test Failure: %s\n", chip::ErrorStr(err)); + SetCommandExitStatus(err); + } } - CHIP_ERROR TestQuerySoftwareVersionString_10() - { - chip::Controller::BasicClusterTest cluster; - cluster.Associate(mDevice, 0); - - return cluster.ReadAttributeSoftwareVersionString(mOnSuccessCallback_10.Cancel(), mOnFailureCallback_10.Cancel()); - } +private: + std::atomic_uint16_t mTestIndex; + const uint16_t mTestCount = 6; - void OnFailureResponse_10(uint8_t status) { ThrowFailureResponse(); } + chip::Callback::Callback mOnFailureCallback_0{ OnFailureCallback_0, this }; + chip::Callback::Callback mOnSuccessCallback_0{ OnSuccessCallback_0, this }; + chip::Callback::Callback mOnFailureCallback_1{ OnFailureCallback_1, this }; + chip::Callback::Callback mOnSuccessCallback_1{ OnSuccessCallback_1, this }; + chip::Callback::Callback mOnFailureCallback_2{ OnFailureCallback_2, this }; + chip::Callback::Callback mOnSuccessCallback_2{ OnSuccessCallback_2, this }; + chip::Callback::Callback mOnFailureCallback_3{ OnFailureCallback_3, this }; + chip::Callback::Callback mOnSuccessCallback_3{ OnSuccessCallback_3, this }; + chip::Callback::Callback mOnFailureCallback_4{ OnFailureCallback_4, this }; + chip::Callback::Callback mOnSuccessCallback_4{ OnSuccessCallback_4, this }; + chip::Callback::Callback mOnFailureCallback_5{ OnFailureCallback_5, this }; + chip::Callback::Callback mOnSuccessCallback_5{ OnSuccessCallback_5, this }; - void OnSuccessResponse_10(chip::ByteSpan softwareVersionString) + static void OnFailureCallback_0(void * context, uint8_t status) { - VerifyOrReturn(CheckConstraintType("softwareVersionString", "", "string")); - VerifyOrReturn(CheckConstraintFormat("softwareVersionString", "", "ASCII")); - VerifyOrReturn(CheckConstraintMinLength("softwareVersionString", softwareVersionString.size(), 1)); - VerifyOrReturn(CheckConstraintMaxLength("softwareVersionString", softwareVersionString.size(), 64)); - NextTest(); + (static_cast(context))->OnFailureResponse_0(status); } - CHIP_ERROR TestQueryManufacturingDate_11() - { - chip::Controller::BasicClusterTest cluster; - cluster.Associate(mDevice, 0); - - return cluster.ReadAttributeManufacturingDate(mOnSuccessCallback_11.Cancel(), mOnFailureCallback_11.Cancel()); - } + static void OnSuccessCallback_0(void * context) { (static_cast(context))->OnSuccessResponse_0(); } - void OnFailureResponse_11(uint8_t status) + static void OnFailureCallback_1(void * context, uint8_t status) { - (status == EMBER_ZCL_STATUS_UNSUPPORTED_ATTRIBUTE) ? NextTest() : ThrowFailureResponse(); + (static_cast(context))->OnFailureResponse_1(status); } - void OnSuccessResponse_11(chip::ByteSpan manufacturingDate) + static void OnSuccessCallback_1(void * context, bool onOff) { - VerifyOrReturn(CheckConstraintType("manufacturingDate", "", "string")); - VerifyOrReturn(CheckConstraintFormat("manufacturingDate", "", "ISO 8601")); - VerifyOrReturn(CheckConstraintMinLength("manufacturingDate", manufacturingDate.size(), 8)); - VerifyOrReturn(CheckConstraintMaxLength("manufacturingDate", manufacturingDate.size(), 16)); - NextTest(); + (static_cast(context))->OnSuccessResponse_1(onOff); } - CHIP_ERROR TestQueryPartNumber_12() + static void OnFailureCallback_2(void * context, uint8_t status) { - chip::Controller::BasicClusterTest cluster; - cluster.Associate(mDevice, 0); - - return cluster.ReadAttributePartNumber(mOnSuccessCallback_12.Cancel(), mOnFailureCallback_12.Cancel()); + (static_cast(context))->OnFailureResponse_2(status); } - void OnFailureResponse_12(uint8_t status) - { - (status == EMBER_ZCL_STATUS_UNSUPPORTED_ATTRIBUTE) ? NextTest() : ThrowFailureResponse(); - } + static void OnSuccessCallback_2(void * context) { (static_cast(context))->OnSuccessResponse_2(); } - void OnSuccessResponse_12(chip::ByteSpan partNumber) + static void OnFailureCallback_3(void * context, uint8_t status) { - VerifyOrReturn(CheckConstraintType("partNumber", "", "string")); - VerifyOrReturn(CheckConstraintMaxLength("partNumber", partNumber.size(), 32)); - NextTest(); + (static_cast(context))->OnFailureResponse_3(status); } - CHIP_ERROR TestQueryProductURL_13() - { - chip::Controller::BasicClusterTest cluster; - cluster.Associate(mDevice, 0); - - return cluster.ReadAttributeProductURL(mOnSuccessCallback_13.Cancel(), mOnFailureCallback_13.Cancel()); - } + static void OnSuccessCallback_3(void * context) { (static_cast(context))->OnSuccessResponse_3(); } - void OnFailureResponse_13(uint8_t status) + static void OnFailureCallback_4(void * context, uint8_t status) { - (status == EMBER_ZCL_STATUS_UNSUPPORTED_ATTRIBUTE) ? NextTest() : ThrowFailureResponse(); + (static_cast(context))->OnFailureResponse_4(status); } - void OnSuccessResponse_13(chip::ByteSpan productURL) - { - VerifyOrReturn(CheckConstraintType("productURL", "", "string")); - VerifyOrReturn(CheckConstraintFormat("productURL", "", "RFC3986")); - VerifyOrReturn(CheckConstraintMaxLength("productURL", productURL.size(), 256)); - NextTest(); - } + static void OnSuccessCallback_4(void * context) { (static_cast(context))->OnSuccessResponse_4(); } - CHIP_ERROR TestQueryProductLabel_14() + static void OnFailureCallback_5(void * context, uint8_t status) { - chip::Controller::BasicClusterTest cluster; - cluster.Associate(mDevice, 0); - - return cluster.ReadAttributeProductLabel(mOnSuccessCallback_14.Cancel(), mOnFailureCallback_14.Cancel()); + (static_cast(context))->OnFailureResponse_5(status); } - void OnFailureResponse_14(uint8_t status) + static void OnSuccessCallback_5(void * context, bool onOff) { - (status == EMBER_ZCL_STATUS_UNSUPPORTED_ATTRIBUTE) ? NextTest() : ThrowFailureResponse(); + (static_cast(context))->OnSuccessResponse_5(onOff); } - void OnSuccessResponse_14(chip::ByteSpan productLabel) - { - VerifyOrReturn(CheckConstraintType("productLabel", "", "string")); - VerifyOrReturn(CheckConstraintMaxLength("productLabel", productLabel.size(), 64)); - NextTest(); - } + // + // Tests methods + // - CHIP_ERROR TestQuerySerialNumber_15() + CHIP_ERROR TestTurnOnLightForColorControlTests_0() { - chip::Controller::BasicClusterTest cluster; - cluster.Associate(mDevice, 0); + chip::Controller::OnOffClusterTest cluster; + cluster.Associate(mDevice, 1); - return cluster.ReadAttributeSerialNumber(mOnSuccessCallback_15.Cancel(), mOnFailureCallback_15.Cancel()); + return cluster.On(mOnSuccessCallback_0.Cancel(), mOnFailureCallback_0.Cancel()); } - void OnFailureResponse_15(uint8_t status) - { - (status == EMBER_ZCL_STATUS_UNSUPPORTED_ATTRIBUTE) ? NextTest() : ThrowFailureResponse(); - } + void OnFailureResponse_0(uint8_t status) { ThrowFailureResponse(); } - void OnSuccessResponse_15(chip::ByteSpan serialNumber) - { - VerifyOrReturn(CheckConstraintType("serialNumber", "", "string")); - VerifyOrReturn(CheckConstraintMaxLength("serialNumber", serialNumber.size(), 32)); - NextTest(); - } + void OnSuccessResponse_0() { NextTest(); } - CHIP_ERROR TestQueryLocalConfigDisabled_16() + CHIP_ERROR TestCheckOnOffAttributeValueIsTrueAfterOnCommand_1() { - chip::Controller::BasicClusterTest cluster; - cluster.Associate(mDevice, 0); + chip::Controller::OnOffClusterTest cluster; + cluster.Associate(mDevice, 1); - return cluster.ReadAttributeLocalConfigDisabled(mOnSuccessCallback_16.Cancel(), mOnFailureCallback_16.Cancel()); + return cluster.ReadAttributeOnOff(mOnSuccessCallback_1.Cancel(), mOnFailureCallback_1.Cancel()); } - void OnFailureResponse_16(uint8_t status) - { - (status == EMBER_ZCL_STATUS_UNSUPPORTED_ATTRIBUTE) ? NextTest() : ThrowFailureResponse(); - } + void OnFailureResponse_1(uint8_t status) { ThrowFailureResponse(); } - void OnSuccessResponse_16(bool localConfigDisabled) + void OnSuccessResponse_1(bool onOff) { - VerifyOrReturn(CheckConstraintType("localConfigDisabled", "", "boolean")); + VerifyOrReturn(CheckValue("onOff", onOff, 1)); NextTest(); } - CHIP_ERROR TestQueryReachable_17() + CHIP_ERROR TestEnhancedStepHueUpCommand_2() { - chip::Controller::BasicClusterTest cluster; - cluster.Associate(mDevice, 0); + chip::Controller::ColorControlClusterTest cluster; + cluster.Associate(mDevice, 1); - return cluster.ReadAttributeReachable(mOnSuccessCallback_17.Cancel(), mOnFailureCallback_17.Cancel()); - } + uint8_t stepModeArgument = 0; + uint16_t stepSizeArgument = 50U; + uint16_t transitionTimeArgument = 1U; + uint8_t optionsMaskArgument = 0; + uint8_t optionsOverrideArgument = 0; - void OnFailureResponse_17(uint8_t status) - { - (status == EMBER_ZCL_STATUS_UNSUPPORTED_ATTRIBUTE) ? NextTest() : ThrowFailureResponse(); + return cluster.EnhancedStepHue(mOnSuccessCallback_2.Cancel(), mOnFailureCallback_2.Cancel(), stepModeArgument, + stepSizeArgument, transitionTimeArgument, optionsMaskArgument, optionsOverrideArgument); } - void OnSuccessResponse_17(bool reachable) + void OnFailureResponse_2(uint8_t status) { ThrowFailureResponse(); } + + void OnSuccessResponse_2() { NextTest(); } + + CHIP_ERROR TestEnhancedStepHueDownCommand_3() { - VerifyOrReturn(CheckConstraintType("reachable", "", "boolean")); - NextTest(); + chip::Controller::ColorControlClusterTest cluster; + cluster.Associate(mDevice, 1); + + uint8_t stepModeArgument = 1; + uint16_t stepSizeArgument = 75U; + uint16_t transitionTimeArgument = 1U; + uint8_t optionsMaskArgument = 0; + uint8_t optionsOverrideArgument = 0; + + return cluster.EnhancedStepHue(mOnSuccessCallback_3.Cancel(), mOnFailureCallback_3.Cancel(), stepModeArgument, + stepSizeArgument, transitionTimeArgument, optionsMaskArgument, optionsOverrideArgument); } -}; -class Test_TC_DM_3_1 : public TestCommand -{ -public: - Test_TC_DM_3_1() : TestCommand("Test_TC_DM_3_1"), mTestIndex(0) {} + void OnFailureResponse_3(uint8_t status) { ThrowFailureResponse(); } - /////////// TestCommand Interface ///////// - void NextTest() override + void OnSuccessResponse_3() { NextTest(); } + + CHIP_ERROR TestTurnOffLightThatWeTurnedOn_4() { - CHIP_ERROR err = CHIP_NO_ERROR; + chip::Controller::OnOffClusterTest cluster; + cluster.Associate(mDevice, 1); - if (0 == mTestIndex) - { - ChipLogProgress(chipTool, " **** Test Start: Test_TC_DM_3_1\n"); - } + return cluster.Off(mOnSuccessCallback_4.Cancel(), mOnFailureCallback_4.Cancel()); + } - if (mTestCount == mTestIndex) - { - ChipLogProgress(chipTool, " **** Test Complete: Test_TC_DM_3_1\n"); - SetCommandExitStatus(CHIP_NO_ERROR); - return; - } + void OnFailureResponse_4(uint8_t status) { ThrowFailureResponse(); } - // Ensure we increment mTestIndex before we start running the relevant - // command. That way if we lose the timeslice after we send the message - // but before our function call returns, we won't end up with an - // incorrect mTestIndex value observed when we get the response. - switch (mTestIndex++) - { - } + void OnSuccessResponse_4() { NextTest(); } - if (CHIP_NO_ERROR != err) - { - ChipLogError(chipTool, " ***** Test Failure: %s\n", chip::ErrorStr(err)); - SetCommandExitStatus(err); - } + CHIP_ERROR TestCheckOnOffAttributeValueIsFalseAfterOffCommand_5() + { + chip::Controller::OnOffClusterTest cluster; + cluster.Associate(mDevice, 1); + + return cluster.ReadAttributeOnOff(mOnSuccessCallback_5.Cancel(), mOnFailureCallback_5.Cancel()); } -private: - std::atomic_uint16_t mTestIndex; - const uint16_t mTestCount = 0; + void OnFailureResponse_5(uint8_t status) { ThrowFailureResponse(); } - // - // Tests methods - // + void OnSuccessResponse_5(bool onOff) + { + VerifyOrReturn(CheckValue("onOff", onOff, 0)); + NextTest(); + } }; -class Test_TC_WNCV_1_1 : public TestCommand +class Test_TC_CC_7_4 : public TestCommand { public: - Test_TC_WNCV_1_1() : TestCommand("Test_TC_WNCV_1_1"), mTestIndex(0) {} + Test_TC_CC_7_4() : TestCommand("Test_TC_CC_7_4"), mTestIndex(0) {} /////////// TestCommand Interface ///////// void NextTest() override @@ -8146,12 +8550,12 @@ class Test_TC_WNCV_1_1 : public TestCommand if (0 == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Start: Test_TC_WNCV_1_1\n"); + ChipLogProgress(chipTool, " **** Test Start: Test_TC_CC_7_4\n"); } if (mTestCount == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Complete: Test_TC_WNCV_1_1\n"); + ChipLogProgress(chipTool, " **** Test Complete: Test_TC_CC_7_4\n"); SetCommandExitStatus(CHIP_NO_ERROR); return; } @@ -8163,17 +8567,24 @@ class Test_TC_WNCV_1_1 : public TestCommand switch (mTestIndex++) { case 0: - ChipLogProgress(chipTool, " ***** Test Step 0 : read the global attribute: ClusterRevision\n"); - err = TestReadTheGlobalAttributeClusterRevision_0(); + ChipLogProgress(chipTool, " ***** Test Step 0 : Turn on light for color control tests\n"); + err = TestTurnOnLightForColorControlTests_0(); break; case 1: - ChipLogProgress(chipTool, - " ***** Test Step 1 : write the default value to mandatory global attribute: ClusterRevision\n"); - err = TestWriteTheDefaultValueToMandatoryGlobalAttributeClusterRevision_1(); + ChipLogProgress(chipTool, " ***** Test Step 1 : Check on/off attribute value is true after on command\n"); + err = TestCheckOnOffAttributeValueIsTrueAfterOnCommand_1(); break; case 2: - ChipLogProgress(chipTool, " ***** Test Step 2 : reads back global attribute: ClusterRevision\n"); - err = TestReadsBackGlobalAttributeClusterRevision_2(); + ChipLogProgress(chipTool, " ***** Test Step 2 : Enhanced move to hue and saturation command\n"); + err = TestEnhancedMoveToHueAndSaturationCommand_2(); + break; + case 3: + ChipLogProgress(chipTool, " ***** Test Step 3 : Turn off light that we turned on\n"); + err = TestTurnOffLightThatWeTurnedOn_3(); + break; + case 4: + ChipLogProgress(chipTool, " ***** Test Step 4 : Check on/off attribute value is false after off command\n"); + err = TestCheckOnOffAttributeValueIsFalseAfterOffCommand_4(); break; } @@ -8186,101 +8597,145 @@ class Test_TC_WNCV_1_1 : public TestCommand private: std::atomic_uint16_t mTestIndex; - const uint16_t mTestCount = 3; + const uint16_t mTestCount = 5; chip::Callback::Callback mOnFailureCallback_0{ OnFailureCallback_0, this }; - chip::Callback::Callback mOnSuccessCallback_0{ OnSuccessCallback_0, this }; + chip::Callback::Callback mOnSuccessCallback_0{ OnSuccessCallback_0, this }; chip::Callback::Callback mOnFailureCallback_1{ OnFailureCallback_1, this }; - chip::Callback::Callback mOnSuccessCallback_1{ OnSuccessCallback_1, this }; + chip::Callback::Callback mOnSuccessCallback_1{ OnSuccessCallback_1, this }; chip::Callback::Callback mOnFailureCallback_2{ OnFailureCallback_2, this }; - chip::Callback::Callback mOnSuccessCallback_2{ OnSuccessCallback_2, this }; + chip::Callback::Callback mOnSuccessCallback_2{ OnSuccessCallback_2, this }; + chip::Callback::Callback mOnFailureCallback_3{ OnFailureCallback_3, this }; + chip::Callback::Callback mOnSuccessCallback_3{ OnSuccessCallback_3, this }; + chip::Callback::Callback mOnFailureCallback_4{ OnFailureCallback_4, this }; + chip::Callback::Callback mOnSuccessCallback_4{ OnSuccessCallback_4, this }; static void OnFailureCallback_0(void * context, uint8_t status) { - (static_cast(context))->OnFailureResponse_0(status); + (static_cast(context))->OnFailureResponse_0(status); } - static void OnSuccessCallback_0(void * context, uint16_t clusterRevision) - { - (static_cast(context))->OnSuccessResponse_0(clusterRevision); - } + static void OnSuccessCallback_0(void * context) { (static_cast(context))->OnSuccessResponse_0(); } static void OnFailureCallback_1(void * context, uint8_t status) { - (static_cast(context))->OnFailureResponse_1(status); + (static_cast(context))->OnFailureResponse_1(status); } - static void OnSuccessCallback_1(void * context, uint16_t clusterRevision) + static void OnSuccessCallback_1(void * context, bool onOff) { - (static_cast(context))->OnSuccessResponse_1(clusterRevision); + (static_cast(context))->OnSuccessResponse_1(onOff); } static void OnFailureCallback_2(void * context, uint8_t status) { - (static_cast(context))->OnFailureResponse_2(status); + (static_cast(context))->OnFailureResponse_2(status); } - static void OnSuccessCallback_2(void * context, uint16_t clusterRevision) + static void OnSuccessCallback_2(void * context) { (static_cast(context))->OnSuccessResponse_2(); } + + static void OnFailureCallback_3(void * context, uint8_t status) { - (static_cast(context))->OnSuccessResponse_2(clusterRevision); + (static_cast(context))->OnFailureResponse_3(status); + } + + static void OnSuccessCallback_3(void * context) { (static_cast(context))->OnSuccessResponse_3(); } + + static void OnFailureCallback_4(void * context, uint8_t status) + { + (static_cast(context))->OnFailureResponse_4(status); + } + + static void OnSuccessCallback_4(void * context, bool onOff) + { + (static_cast(context))->OnSuccessResponse_4(onOff); } // // Tests methods // - CHIP_ERROR TestReadTheGlobalAttributeClusterRevision_0() + CHIP_ERROR TestTurnOnLightForColorControlTests_0() { - chip::Controller::WindowCoveringClusterTest cluster; + chip::Controller::OnOffClusterTest cluster; cluster.Associate(mDevice, 1); - return cluster.ReadAttributeClusterRevision(mOnSuccessCallback_0.Cancel(), mOnFailureCallback_0.Cancel()); + return cluster.On(mOnSuccessCallback_0.Cancel(), mOnFailureCallback_0.Cancel()); } void OnFailureResponse_0(uint8_t status) { ThrowFailureResponse(); } - void OnSuccessResponse_0(uint16_t clusterRevision) + void OnSuccessResponse_0() { NextTest(); } + + CHIP_ERROR TestCheckOnOffAttributeValueIsTrueAfterOnCommand_1() { - VerifyOrReturn(CheckValue("clusterRevision", clusterRevision, 5U)); + chip::Controller::OnOffClusterTest cluster; + cluster.Associate(mDevice, 1); + + return cluster.ReadAttributeOnOff(mOnSuccessCallback_1.Cancel(), mOnFailureCallback_1.Cancel()); + } + + void OnFailureResponse_1(uint8_t status) { ThrowFailureResponse(); } + + void OnSuccessResponse_1(bool onOff) + { + VerifyOrReturn(CheckValue("onOff", onOff, 1)); NextTest(); } - CHIP_ERROR TestWriteTheDefaultValueToMandatoryGlobalAttributeClusterRevision_1() + CHIP_ERROR TestEnhancedMoveToHueAndSaturationCommand_2() { - chip::Controller::WindowCoveringClusterTest cluster; + chip::Controller::ColorControlClusterTest cluster; cluster.Associate(mDevice, 1); - uint16_t clusterRevisionArgument = 5U; + uint16_t enhancedHueArgument = 1200U; + uint8_t saturationArgument = 90; + uint16_t transitionTimeArgument = 10U; + uint8_t optionsMaskArgument = 0; + uint8_t optionsOverrideArgument = 0; - return cluster.WriteAttributeClusterRevision(mOnSuccessCallback_1.Cancel(), mOnFailureCallback_1.Cancel(), - clusterRevisionArgument); + return cluster.EnhancedMoveToHueAndSaturation(mOnSuccessCallback_2.Cancel(), mOnFailureCallback_2.Cancel(), + enhancedHueArgument, saturationArgument, transitionTimeArgument, + optionsMaskArgument, optionsOverrideArgument); } - void OnFailureResponse_1(uint8_t status) { NextTest(); } + void OnFailureResponse_2(uint8_t status) { ThrowFailureResponse(); } - void OnSuccessResponse_1(uint16_t clusterRevision) { ThrowSuccessResponse(); } + void OnSuccessResponse_2() { NextTest(); } - CHIP_ERROR TestReadsBackGlobalAttributeClusterRevision_2() + CHIP_ERROR TestTurnOffLightThatWeTurnedOn_3() { - chip::Controller::WindowCoveringClusterTest cluster; + chip::Controller::OnOffClusterTest cluster; cluster.Associate(mDevice, 1); - return cluster.ReadAttributeClusterRevision(mOnSuccessCallback_2.Cancel(), mOnFailureCallback_2.Cancel()); + return cluster.Off(mOnSuccessCallback_3.Cancel(), mOnFailureCallback_3.Cancel()); } - void OnFailureResponse_2(uint8_t status) { ThrowFailureResponse(); } + void OnFailureResponse_3(uint8_t status) { ThrowFailureResponse(); } - void OnSuccessResponse_2(uint16_t clusterRevision) + void OnSuccessResponse_3() { NextTest(); } + + CHIP_ERROR TestCheckOnOffAttributeValueIsFalseAfterOffCommand_4() { - VerifyOrReturn(CheckValue("clusterRevision", clusterRevision, 5U)); + chip::Controller::OnOffClusterTest cluster; + cluster.Associate(mDevice, 1); + + return cluster.ReadAttributeOnOff(mOnSuccessCallback_4.Cancel(), mOnFailureCallback_4.Cancel()); + } + + void OnFailureResponse_4(uint8_t status) { ThrowFailureResponse(); } + + void OnSuccessResponse_4(bool onOff) + { + VerifyOrReturn(CheckValue("onOff", onOff, 0)); NextTest(); } }; -class Test_TC_WNCV_2_1 : public TestCommand +class Test_TC_CC_8_1 : public TestCommand { public: - Test_TC_WNCV_2_1() : TestCommand("Test_TC_WNCV_2_1"), mTestIndex(0) {} + Test_TC_CC_8_1() : TestCommand("Test_TC_CC_8_1"), mTestIndex(0) {} /////////// TestCommand Interface ///////// void NextTest() override @@ -8289,12 +8744,12 @@ class Test_TC_WNCV_2_1 : public TestCommand if (0 == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Start: Test_TC_WNCV_2_1\n"); + ChipLogProgress(chipTool, " **** Test Start: Test_TC_CC_8_1\n"); } if (mTestCount == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Complete: Test_TC_WNCV_2_1\n"); + ChipLogProgress(chipTool, " **** Test Complete: Test_TC_CC_8_1\n"); SetCommandExitStatus(CHIP_NO_ERROR); return; } @@ -8306,48 +8761,68 @@ class Test_TC_WNCV_2_1 : public TestCommand switch (mTestIndex++) { case 0: - ChipLogProgress(chipTool, " ***** Test Step 0 : read the RO mandatory attribute default: Type\n"); - err = TestReadTheRoMandatoryAttributeDefaultType_0(); + ChipLogProgress(chipTool, " ***** Test Step 0 : Turn on light for color control tests\n"); + err = TestTurnOnLightForColorControlTests_0(); break; case 1: - ChipLogProgress(chipTool, " ***** Test Step 1 : reads back the RO mandatory attribute: Type\n"); - err = TestReadsBackTheRoMandatoryAttributeType_1(); + ChipLogProgress(chipTool, " ***** Test Step 1 : Check on/off attribute value is true after on command\n"); + err = TestCheckOnOffAttributeValueIsTrueAfterOnCommand_1(); break; case 2: - ChipLogProgress(chipTool, " ***** Test Step 2 : read the RO mandatory attribute default: ConfigStatus\n"); - err = TestReadTheRoMandatoryAttributeDefaultConfigStatus_2(); + ChipLogProgress(chipTool, " ***** Test Step 2 : Color Loop Set Command - Set all Attributs\n"); + err = TestColorLoopSetCommandSetAllAttributs_2(); break; case 3: - ChipLogProgress(chipTool, " ***** Test Step 3 : reads back the RO mandatory attribute: ConfigStatus\n"); - err = TestReadsBackTheRoMandatoryAttributeConfigStatus_3(); + ChipLogProgress(chipTool, " ***** Test Step 3 : Check ColorLoopDirection Value\n"); + err = TestCheckColorLoopDirectionValue_3(); break; case 4: - ChipLogProgress(chipTool, " ***** Test Step 4 : read the RO mandatory attribute default: OperationalStatus\n"); - err = TestReadTheRoMandatoryAttributeDefaultOperationalStatus_4(); + ChipLogProgress(chipTool, " ***** Test Step 4 : Check ColorLoopTime Value\n"); + err = TestCheckColorLoopTimeValue_4(); break; case 5: - ChipLogProgress(chipTool, " ***** Test Step 5 : reads back the RO mandatory attribute: OperationalStatus\n"); - err = TestReadsBackTheRoMandatoryAttributeOperationalStatus_5(); + ChipLogProgress(chipTool, " ***** Test Step 5 : Check ColorLoopStartEnhancedHue Value\n"); + err = TestCheckColorLoopStartEnhancedHueValue_5(); break; case 6: - ChipLogProgress(chipTool, " ***** Test Step 6 : read the RO mandatory attribute default: EndProductType\n"); - err = TestReadTheRoMandatoryAttributeDefaultEndProductType_6(); + ChipLogProgress(chipTool, " ***** Test Step 6 : Check ColorLoopActive Value\n"); + err = TestCheckColorLoopActiveValue_6(); break; case 7: - ChipLogProgress(chipTool, " ***** Test Step 7 : reads back the RO mandatory attribute: EndProductType\n"); - err = TestReadsBackTheRoMandatoryAttributeEndProductType_7(); + ChipLogProgress(chipTool, " ***** Test Step 7 : Color Loop Set Command - Start Color Loop\n"); + err = TestColorLoopSetCommandStartColorLoop_7(); break; case 8: - ChipLogProgress(chipTool, " ***** Test Step 8 : read the RW mandatory attribute default: Mode\n"); - err = TestReadTheRwMandatoryAttributeDefaultMode_8(); + ChipLogProgress(chipTool, " ***** Test Step 8 : Check ColorLoopActive Value\n"); + err = TestCheckColorLoopActiveValue_8(); break; case 9: - ChipLogProgress(chipTool, " ***** Test Step 9 : write a value into the RW mandatory attribute:: Mode\n"); - err = TestWriteAValueIntoTheRwMandatoryAttributeMode_9(); + ChipLogProgress(chipTool, " ***** Test Step 9 : Color Loop Set Command - Set direction and time while running\n"); + err = TestColorLoopSetCommandSetDirectionAndTimeWhileRunning_9(); break; case 10: - ChipLogProgress(chipTool, " ***** Test Step 10 : reads back the RW mandatory attribute: Mode\n"); - err = TestReadsBackTheRwMandatoryAttributeMode_10(); + ChipLogProgress(chipTool, " ***** Test Step 10 : Check ColorLoopDirection Value\n"); + err = TestCheckColorLoopDirectionValue_10(); + break; + case 11: + ChipLogProgress(chipTool, " ***** Test Step 11 : Check ColorLoopTime Value\n"); + err = TestCheckColorLoopTimeValue_11(); + break; + case 12: + ChipLogProgress(chipTool, " ***** Test Step 12 : Color Loop Set Command - Set direction while running\n"); + err = TestColorLoopSetCommandSetDirectionWhileRunning_12(); + break; + case 13: + ChipLogProgress(chipTool, " ***** Test Step 13 : Check ColorLoopDirection Value\n"); + err = TestCheckColorLoopDirectionValue_13(); + break; + case 14: + ChipLogProgress(chipTool, " ***** Test Step 14 : Turn off light that we turned on\n"); + err = TestTurnOffLightThatWeTurnedOn_14(); + break; + case 15: + ChipLogProgress(chipTool, " ***** Test Step 15 : Check on/off attribute value is false after off command\n"); + err = TestCheckOnOffAttributeValueIsFalseAfterOffCommand_15(); break; } @@ -8360,711 +8835,469 @@ class Test_TC_WNCV_2_1 : public TestCommand private: std::atomic_uint16_t mTestIndex; - const uint16_t mTestCount = 11; + const uint16_t mTestCount = 16; chip::Callback::Callback mOnFailureCallback_0{ OnFailureCallback_0, this }; - chip::Callback::Callback mOnSuccessCallback_0{ OnSuccessCallback_0, this }; + chip::Callback::Callback mOnSuccessCallback_0{ OnSuccessCallback_0, this }; chip::Callback::Callback mOnFailureCallback_1{ OnFailureCallback_1, this }; - chip::Callback::Callback mOnSuccessCallback_1{ OnSuccessCallback_1, this }; + chip::Callback::Callback mOnSuccessCallback_1{ OnSuccessCallback_1, this }; chip::Callback::Callback mOnFailureCallback_2{ OnFailureCallback_2, this }; - chip::Callback::Callback mOnSuccessCallback_2{ OnSuccessCallback_2, this }; + chip::Callback::Callback mOnSuccessCallback_2{ OnSuccessCallback_2, this }; chip::Callback::Callback mOnFailureCallback_3{ OnFailureCallback_3, this }; - chip::Callback::Callback mOnSuccessCallback_3{ OnSuccessCallback_3, this }; + chip::Callback::Callback mOnSuccessCallback_3{ OnSuccessCallback_3, + this }; chip::Callback::Callback mOnFailureCallback_4{ OnFailureCallback_4, this }; - chip::Callback::Callback mOnSuccessCallback_4{ OnSuccessCallback_4, this }; + chip::Callback::Callback mOnSuccessCallback_4{ OnSuccessCallback_4, this }; chip::Callback::Callback mOnFailureCallback_5{ OnFailureCallback_5, this }; - chip::Callback::Callback mOnSuccessCallback_5{ OnSuccessCallback_5, this }; + chip::Callback::Callback mOnSuccessCallback_5{ + OnSuccessCallback_5, this + }; chip::Callback::Callback mOnFailureCallback_6{ OnFailureCallback_6, this }; - chip::Callback::Callback mOnSuccessCallback_6{ OnSuccessCallback_6, this }; + chip::Callback::Callback mOnSuccessCallback_6{ OnSuccessCallback_6, this }; chip::Callback::Callback mOnFailureCallback_7{ OnFailureCallback_7, this }; - chip::Callback::Callback mOnSuccessCallback_7{ OnSuccessCallback_7, this }; + chip::Callback::Callback mOnSuccessCallback_7{ OnSuccessCallback_7, this }; chip::Callback::Callback mOnFailureCallback_8{ OnFailureCallback_8, this }; - chip::Callback::Callback mOnSuccessCallback_8{ OnSuccessCallback_8, this }; + chip::Callback::Callback mOnSuccessCallback_8{ OnSuccessCallback_8, this }; chip::Callback::Callback mOnFailureCallback_9{ OnFailureCallback_9, this }; - chip::Callback::Callback mOnSuccessCallback_9{ OnSuccessCallback_9, this }; + chip::Callback::Callback mOnSuccessCallback_9{ OnSuccessCallback_9, this }; chip::Callback::Callback mOnFailureCallback_10{ OnFailureCallback_10, this }; - chip::Callback::Callback mOnSuccessCallback_10{ OnSuccessCallback_10, this }; + chip::Callback::Callback mOnSuccessCallback_10{ OnSuccessCallback_10, + this }; + chip::Callback::Callback mOnFailureCallback_11{ OnFailureCallback_11, this }; + chip::Callback::Callback mOnSuccessCallback_11{ OnSuccessCallback_11, this }; + chip::Callback::Callback mOnFailureCallback_12{ OnFailureCallback_12, this }; + chip::Callback::Callback mOnSuccessCallback_12{ OnSuccessCallback_12, this }; + chip::Callback::Callback mOnFailureCallback_13{ OnFailureCallback_13, this }; + chip::Callback::Callback mOnSuccessCallback_13{ OnSuccessCallback_13, + this }; + chip::Callback::Callback mOnFailureCallback_14{ OnFailureCallback_14, this }; + chip::Callback::Callback mOnSuccessCallback_14{ OnSuccessCallback_14, this }; + chip::Callback::Callback mOnFailureCallback_15{ OnFailureCallback_15, this }; + chip::Callback::Callback mOnSuccessCallback_15{ OnSuccessCallback_15, this }; static void OnFailureCallback_0(void * context, uint8_t status) { - (static_cast(context))->OnFailureResponse_0(status); - } - - static void OnSuccessCallback_0(void * context, uint8_t type) - { - (static_cast(context))->OnSuccessResponse_0(type); - } - - static void OnFailureCallback_1(void * context, uint8_t status) - { - (static_cast(context))->OnFailureResponse_1(status); - } - - static void OnSuccessCallback_1(void * context, uint8_t type) - { - (static_cast(context))->OnSuccessResponse_1(type); - } - - static void OnFailureCallback_2(void * context, uint8_t status) - { - (static_cast(context))->OnFailureResponse_2(status); - } - - static void OnSuccessCallback_2(void * context, uint8_t configStatus) - { - (static_cast(context))->OnSuccessResponse_2(configStatus); - } - - static void OnFailureCallback_3(void * context, uint8_t status) - { - (static_cast(context))->OnFailureResponse_3(status); - } - - static void OnSuccessCallback_3(void * context, uint8_t configStatus) - { - (static_cast(context))->OnSuccessResponse_3(configStatus); - } - - static void OnFailureCallback_4(void * context, uint8_t status) - { - (static_cast(context))->OnFailureResponse_4(status); - } - - static void OnSuccessCallback_4(void * context, uint8_t operationalStatus) - { - (static_cast(context))->OnSuccessResponse_4(operationalStatus); - } - - static void OnFailureCallback_5(void * context, uint8_t status) - { - (static_cast(context))->OnFailureResponse_5(status); - } - - static void OnSuccessCallback_5(void * context, uint8_t operationalStatus) - { - (static_cast(context))->OnSuccessResponse_5(operationalStatus); - } - - static void OnFailureCallback_6(void * context, uint8_t status) - { - (static_cast(context))->OnFailureResponse_6(status); - } - - static void OnSuccessCallback_6(void * context, uint8_t endProductType) - { - (static_cast(context))->OnSuccessResponse_6(endProductType); - } - - static void OnFailureCallback_7(void * context, uint8_t status) - { - (static_cast(context))->OnFailureResponse_7(status); - } - - static void OnSuccessCallback_7(void * context, uint8_t endProductType) - { - (static_cast(context))->OnSuccessResponse_7(endProductType); - } - - static void OnFailureCallback_8(void * context, uint8_t status) - { - (static_cast(context))->OnFailureResponse_8(status); - } - - static void OnSuccessCallback_8(void * context, uint8_t mode) - { - (static_cast(context))->OnSuccessResponse_8(mode); - } - - static void OnFailureCallback_9(void * context, uint8_t status) - { - (static_cast(context))->OnFailureResponse_9(status); - } - - static void OnSuccessCallback_9(void * context, uint8_t mode) - { - (static_cast(context))->OnSuccessResponse_9(mode); - } - - static void OnFailureCallback_10(void * context, uint8_t status) - { - (static_cast(context))->OnFailureResponse_10(status); - } - - static void OnSuccessCallback_10(void * context, uint8_t mode) - { - (static_cast(context))->OnSuccessResponse_10(mode); - } - - // - // Tests methods - // - - CHIP_ERROR TestReadTheRoMandatoryAttributeDefaultType_0() - { - chip::Controller::WindowCoveringClusterTest cluster; - cluster.Associate(mDevice, 1); - - return cluster.ReadAttributeType(mOnSuccessCallback_0.Cancel(), mOnFailureCallback_0.Cancel()); - } - - void OnFailureResponse_0(uint8_t status) { ThrowFailureResponse(); } - - void OnSuccessResponse_0(uint8_t type) - { - VerifyOrReturn(CheckValue("type", type, 0)); - NextTest(); - } - - CHIP_ERROR TestReadsBackTheRoMandatoryAttributeType_1() - { - chip::Controller::WindowCoveringClusterTest cluster; - cluster.Associate(mDevice, 1); - - return cluster.ReadAttributeType(mOnSuccessCallback_1.Cancel(), mOnFailureCallback_1.Cancel()); - } - - void OnFailureResponse_1(uint8_t status) { ThrowFailureResponse(); } - - void OnSuccessResponse_1(uint8_t type) - { - VerifyOrReturn(CheckValue("type", type, 0)); - NextTest(); - } - - CHIP_ERROR TestReadTheRoMandatoryAttributeDefaultConfigStatus_2() - { - chip::Controller::WindowCoveringClusterTest cluster; - cluster.Associate(mDevice, 1); - - return cluster.ReadAttributeConfigStatus(mOnSuccessCallback_2.Cancel(), mOnFailureCallback_2.Cancel()); + (static_cast(context))->OnFailureResponse_0(status); } - void OnFailureResponse_2(uint8_t status) { ThrowFailureResponse(); } + static void OnSuccessCallback_0(void * context) { (static_cast(context))->OnSuccessResponse_0(); } - void OnSuccessResponse_2(uint8_t configStatus) + static void OnFailureCallback_1(void * context, uint8_t status) { - VerifyOrReturn(CheckValue("configStatus", configStatus, 3)); - NextTest(); + (static_cast(context))->OnFailureResponse_1(status); } - CHIP_ERROR TestReadsBackTheRoMandatoryAttributeConfigStatus_3() + static void OnSuccessCallback_1(void * context, bool onOff) { - chip::Controller::WindowCoveringClusterTest cluster; - cluster.Associate(mDevice, 1); + (static_cast(context))->OnSuccessResponse_1(onOff); + } - return cluster.ReadAttributeConfigStatus(mOnSuccessCallback_3.Cancel(), mOnFailureCallback_3.Cancel()); + static void OnFailureCallback_2(void * context, uint8_t status) + { + (static_cast(context))->OnFailureResponse_2(status); } - void OnFailureResponse_3(uint8_t status) { ThrowFailureResponse(); } + static void OnSuccessCallback_2(void * context) { (static_cast(context))->OnSuccessResponse_2(); } - void OnSuccessResponse_3(uint8_t configStatus) + static void OnFailureCallback_3(void * context, uint8_t status) { - VerifyOrReturn(CheckValue("configStatus", configStatus, 3)); - NextTest(); + (static_cast(context))->OnFailureResponse_3(status); } - CHIP_ERROR TestReadTheRoMandatoryAttributeDefaultOperationalStatus_4() + static void OnSuccessCallback_3(void * context, uint8_t colorLoopDirection) { - chip::Controller::WindowCoveringClusterTest cluster; - cluster.Associate(mDevice, 1); - - return cluster.ReadAttributeOperationalStatus(mOnSuccessCallback_4.Cancel(), mOnFailureCallback_4.Cancel()); + (static_cast(context))->OnSuccessResponse_3(colorLoopDirection); } - void OnFailureResponse_4(uint8_t status) { ThrowFailureResponse(); } - - void OnSuccessResponse_4(uint8_t operationalStatus) + static void OnFailureCallback_4(void * context, uint8_t status) { - VerifyOrReturn(CheckValue("operationalStatus", operationalStatus, 0)); - NextTest(); + (static_cast(context))->OnFailureResponse_4(status); } - CHIP_ERROR TestReadsBackTheRoMandatoryAttributeOperationalStatus_5() + static void OnSuccessCallback_4(void * context, uint16_t colorLoopTime) { - chip::Controller::WindowCoveringClusterTest cluster; - cluster.Associate(mDevice, 1); - - return cluster.ReadAttributeOperationalStatus(mOnSuccessCallback_5.Cancel(), mOnFailureCallback_5.Cancel()); + (static_cast(context))->OnSuccessResponse_4(colorLoopTime); } - void OnFailureResponse_5(uint8_t status) { ThrowFailureResponse(); } - - void OnSuccessResponse_5(uint8_t operationalStatus) + static void OnFailureCallback_5(void * context, uint8_t status) { - VerifyOrReturn(CheckValue("operationalStatus", operationalStatus, 0)); - NextTest(); + (static_cast(context))->OnFailureResponse_5(status); } - CHIP_ERROR TestReadTheRoMandatoryAttributeDefaultEndProductType_6() + static void OnSuccessCallback_5(void * context, uint16_t colorLoopStartEnhancedHue) { - chip::Controller::WindowCoveringClusterTest cluster; - cluster.Associate(mDevice, 1); - - return cluster.ReadAttributeEndProductType(mOnSuccessCallback_6.Cancel(), mOnFailureCallback_6.Cancel()); + (static_cast(context))->OnSuccessResponse_5(colorLoopStartEnhancedHue); } - void OnFailureResponse_6(uint8_t status) { ThrowFailureResponse(); } - - void OnSuccessResponse_6(uint8_t endProductType) + static void OnFailureCallback_6(void * context, uint8_t status) { - VerifyOrReturn(CheckValue("endProductType", endProductType, 0)); - NextTest(); + (static_cast(context))->OnFailureResponse_6(status); } - CHIP_ERROR TestReadsBackTheRoMandatoryAttributeEndProductType_7() + static void OnSuccessCallback_6(void * context, uint8_t colorLoopActive) { - chip::Controller::WindowCoveringClusterTest cluster; - cluster.Associate(mDevice, 1); + (static_cast(context))->OnSuccessResponse_6(colorLoopActive); + } - return cluster.ReadAttributeEndProductType(mOnSuccessCallback_7.Cancel(), mOnFailureCallback_7.Cancel()); + static void OnFailureCallback_7(void * context, uint8_t status) + { + (static_cast(context))->OnFailureResponse_7(status); } - void OnFailureResponse_7(uint8_t status) { ThrowFailureResponse(); } + static void OnSuccessCallback_7(void * context) { (static_cast(context))->OnSuccessResponse_7(); } - void OnSuccessResponse_7(uint8_t endProductType) + static void OnFailureCallback_8(void * context, uint8_t status) { - VerifyOrReturn(CheckValue("endProductType", endProductType, 0)); - NextTest(); + (static_cast(context))->OnFailureResponse_8(status); } - CHIP_ERROR TestReadTheRwMandatoryAttributeDefaultMode_8() + static void OnSuccessCallback_8(void * context, uint8_t colorLoopActive) { - chip::Controller::WindowCoveringClusterTest cluster; - cluster.Associate(mDevice, 1); + (static_cast(context))->OnSuccessResponse_8(colorLoopActive); + } - return cluster.ReadAttributeMode(mOnSuccessCallback_8.Cancel(), mOnFailureCallback_8.Cancel()); + static void OnFailureCallback_9(void * context, uint8_t status) + { + (static_cast(context))->OnFailureResponse_9(status); } - void OnFailureResponse_8(uint8_t status) { ThrowFailureResponse(); } + static void OnSuccessCallback_9(void * context) { (static_cast(context))->OnSuccessResponse_9(); } - void OnSuccessResponse_8(uint8_t mode) + static void OnFailureCallback_10(void * context, uint8_t status) { - VerifyOrReturn(CheckValue("mode", mode, 0)); - NextTest(); + (static_cast(context))->OnFailureResponse_10(status); } - CHIP_ERROR TestWriteAValueIntoTheRwMandatoryAttributeMode_9() + static void OnSuccessCallback_10(void * context, uint8_t colorLoopDirection) { - chip::Controller::WindowCoveringClusterTest cluster; - cluster.Associate(mDevice, 1); - - uint8_t modeArgument = 7; - - return cluster.WriteAttributeMode(mOnSuccessCallback_9.Cancel(), mOnFailureCallback_9.Cancel(), modeArgument); + (static_cast(context))->OnSuccessResponse_10(colorLoopDirection); } - void OnFailureResponse_9(uint8_t status) { ThrowFailureResponse(); } - - void OnSuccessResponse_9(uint8_t mode) { NextTest(); } - - CHIP_ERROR TestReadsBackTheRwMandatoryAttributeMode_10() + static void OnFailureCallback_11(void * context, uint8_t status) { - chip::Controller::WindowCoveringClusterTest cluster; - cluster.Associate(mDevice, 1); - - return cluster.ReadAttributeMode(mOnSuccessCallback_10.Cancel(), mOnFailureCallback_10.Cancel()); + (static_cast(context))->OnFailureResponse_11(status); } - void OnFailureResponse_10(uint8_t status) { ThrowFailureResponse(); } - - void OnSuccessResponse_10(uint8_t mode) + static void OnSuccessCallback_11(void * context, uint16_t colorLoopTime) { - VerifyOrReturn(CheckValue("mode", mode, 7)); - NextTest(); + (static_cast(context))->OnSuccessResponse_11(colorLoopTime); } -}; - -class Test_TC_WNCV_3_1 : public TestCommand -{ -public: - Test_TC_WNCV_3_1() : TestCommand("Test_TC_WNCV_3_1"), mTestIndex(0) {} - /////////// TestCommand Interface ///////// - void NextTest() override + static void OnFailureCallback_12(void * context, uint8_t status) { - CHIP_ERROR err = CHIP_NO_ERROR; - - if (0 == mTestIndex) - { - ChipLogProgress(chipTool, " **** Test Start: Test_TC_WNCV_3_1\n"); - } - - if (mTestCount == mTestIndex) - { - ChipLogProgress(chipTool, " **** Test Complete: Test_TC_WNCV_3_1\n"); - SetCommandExitStatus(CHIP_NO_ERROR); - return; - } - - // Ensure we increment mTestIndex before we start running the relevant - // command. That way if we lose the timeslice after we send the message - // but before our function call returns, we won't end up with an - // incorrect mTestIndex value observed when we get the response. - switch (mTestIndex++) - { - case 0: - ChipLogProgress(chipTool, " ***** Test Step 0 : 1a: TH adjusts the the DUT to a non-open position\n"); - err = Test1aThAdjustsTheTheDutToANonOpenPosition_0(); - break; - case 1: - ChipLogProgress(chipTool, " ***** Test Step 1 : 2a: TH sends UpOrOpen command to DUT\n"); - err = Test2aThSendsUpOrOpenCommandToDut_1(); - break; - case 2: - ChipLogProgress(chipTool, " ***** Test Step 2 : 3a: TH reads OperationalStatus attribute from DUT\n"); - err = Test3aThReadsOperationalStatusAttributeFromDut_2(); - break; - } - - if (CHIP_NO_ERROR != err) - { - ChipLogError(chipTool, " ***** Test Failure: %s\n", chip::ErrorStr(err)); - SetCommandExitStatus(err); - } + (static_cast(context))->OnFailureResponse_12(status); } -private: - std::atomic_uint16_t mTestIndex; - const uint16_t mTestCount = 3; - - chip::Callback::Callback mOnFailureCallback_0{ OnFailureCallback_0, this }; - chip::Callback::Callback mOnSuccessCallback_0{ OnSuccessCallback_0, this }; - chip::Callback::Callback mOnFailureCallback_1{ OnFailureCallback_1, this }; - chip::Callback::Callback mOnSuccessCallback_1{ OnSuccessCallback_1, this }; - chip::Callback::Callback mOnFailureCallback_2{ OnFailureCallback_2, this }; - chip::Callback::Callback mOnSuccessCallback_2{ OnSuccessCallback_2, this }; + static void OnSuccessCallback_12(void * context) { (static_cast(context))->OnSuccessResponse_12(); } - static void OnFailureCallback_0(void * context, uint8_t status) + static void OnFailureCallback_13(void * context, uint8_t status) { - (static_cast(context))->OnFailureResponse_0(status); + (static_cast(context))->OnFailureResponse_13(status); } - static void OnSuccessCallback_0(void * context) { (static_cast(context))->OnSuccessResponse_0(); } + static void OnSuccessCallback_13(void * context, uint8_t colorLoopDirection) + { + (static_cast(context))->OnSuccessResponse_13(colorLoopDirection); + } - static void OnFailureCallback_1(void * context, uint8_t status) + static void OnFailureCallback_14(void * context, uint8_t status) { - (static_cast(context))->OnFailureResponse_1(status); + (static_cast(context))->OnFailureResponse_14(status); } - static void OnSuccessCallback_1(void * context) { (static_cast(context))->OnSuccessResponse_1(); } + static void OnSuccessCallback_14(void * context) { (static_cast(context))->OnSuccessResponse_14(); } - static void OnFailureCallback_2(void * context, uint8_t status) + static void OnFailureCallback_15(void * context, uint8_t status) { - (static_cast(context))->OnFailureResponse_2(status); + (static_cast(context))->OnFailureResponse_15(status); } - static void OnSuccessCallback_2(void * context, uint8_t operationalStatus) + static void OnSuccessCallback_15(void * context, bool onOff) { - (static_cast(context))->OnSuccessResponse_2(operationalStatus); + (static_cast(context))->OnSuccessResponse_15(onOff); } // // Tests methods // - CHIP_ERROR Test1aThAdjustsTheTheDutToANonOpenPosition_0() + CHIP_ERROR TestTurnOnLightForColorControlTests_0() { - chip::Controller::WindowCoveringClusterTest cluster; + chip::Controller::OnOffClusterTest cluster; cluster.Associate(mDevice, 1); - return cluster.DownOrClose(mOnSuccessCallback_0.Cancel(), mOnFailureCallback_0.Cancel()); + return cluster.On(mOnSuccessCallback_0.Cancel(), mOnFailureCallback_0.Cancel()); } void OnFailureResponse_0(uint8_t status) { ThrowFailureResponse(); } void OnSuccessResponse_0() { NextTest(); } - CHIP_ERROR Test2aThSendsUpOrOpenCommandToDut_1() + CHIP_ERROR TestCheckOnOffAttributeValueIsTrueAfterOnCommand_1() + { + chip::Controller::OnOffClusterTest cluster; + cluster.Associate(mDevice, 1); + + return cluster.ReadAttributeOnOff(mOnSuccessCallback_1.Cancel(), mOnFailureCallback_1.Cancel()); + } + + void OnFailureResponse_1(uint8_t status) { ThrowFailureResponse(); } + + void OnSuccessResponse_1(bool onOff) + { + VerifyOrReturn(CheckValue("onOff", onOff, 1)); + NextTest(); + } + + CHIP_ERROR TestColorLoopSetCommandSetAllAttributs_2() + { + chip::Controller::ColorControlClusterTest cluster; + cluster.Associate(mDevice, 1); + + uint8_t updateFlagsArgument = 14; + uint8_t actionArgument = 0; + uint8_t directionArgument = 1; + uint16_t timeArgument = 100U; + uint16_t startHueArgument = 500U; + uint8_t optionsMaskArgument = 0; + uint8_t optionsOverrideArgument = 0; + + return cluster.ColorLoopSet(mOnSuccessCallback_2.Cancel(), mOnFailureCallback_2.Cancel(), updateFlagsArgument, + actionArgument, directionArgument, timeArgument, startHueArgument, optionsMaskArgument, + optionsOverrideArgument); + } + + void OnFailureResponse_2(uint8_t status) { ThrowFailureResponse(); } + + void OnSuccessResponse_2() { NextTest(); } + + CHIP_ERROR TestCheckColorLoopDirectionValue_3() { - chip::Controller::WindowCoveringClusterTest cluster; + chip::Controller::ColorControlClusterTest cluster; cluster.Associate(mDevice, 1); - return cluster.UpOrOpen(mOnSuccessCallback_1.Cancel(), mOnFailureCallback_1.Cancel()); + return cluster.ReadAttributeColorLoopDirection(mOnSuccessCallback_3.Cancel(), mOnFailureCallback_3.Cancel()); } - void OnFailureResponse_1(uint8_t status) { ThrowFailureResponse(); } + void OnFailureResponse_3(uint8_t status) { ThrowFailureResponse(); } - void OnSuccessResponse_1() { NextTest(); } + void OnSuccessResponse_3(uint8_t colorLoopDirection) + { + VerifyOrReturn(CheckValue("colorLoopDirection", colorLoopDirection, 1)); + NextTest(); + } - CHIP_ERROR Test3aThReadsOperationalStatusAttributeFromDut_2() + CHIP_ERROR TestCheckColorLoopTimeValue_4() { - chip::Controller::WindowCoveringClusterTest cluster; + chip::Controller::ColorControlClusterTest cluster; cluster.Associate(mDevice, 1); - return cluster.ReadAttributeOperationalStatus(mOnSuccessCallback_2.Cancel(), mOnFailureCallback_2.Cancel()); + return cluster.ReadAttributeColorLoopTime(mOnSuccessCallback_4.Cancel(), mOnFailureCallback_4.Cancel()); } - void OnFailureResponse_2(uint8_t status) { ThrowFailureResponse(); } + void OnFailureResponse_4(uint8_t status) { ThrowFailureResponse(); } - void OnSuccessResponse_2(uint8_t operationalStatus) + void OnSuccessResponse_4(uint16_t colorLoopTime) { - VerifyOrReturn(CheckValue("operationalStatus", operationalStatus, 0)); + VerifyOrReturn(CheckValue("colorLoopTime", colorLoopTime, 100U)); NextTest(); } -}; - -class Test_TC_WNCV_3_2 : public TestCommand -{ -public: - Test_TC_WNCV_3_2() : TestCommand("Test_TC_WNCV_3_2"), mTestIndex(0) {} - /////////// TestCommand Interface ///////// - void NextTest() override + CHIP_ERROR TestCheckColorLoopStartEnhancedHueValue_5() { - CHIP_ERROR err = CHIP_NO_ERROR; - - if (0 == mTestIndex) - { - ChipLogProgress(chipTool, " **** Test Start: Test_TC_WNCV_3_2\n"); - } - - if (mTestCount == mTestIndex) - { - ChipLogProgress(chipTool, " **** Test Complete: Test_TC_WNCV_3_2\n"); - SetCommandExitStatus(CHIP_NO_ERROR); - return; - } - - // Ensure we increment mTestIndex before we start running the relevant - // command. That way if we lose the timeslice after we send the message - // but before our function call returns, we won't end up with an - // incorrect mTestIndex value observed when we get the response. - switch (mTestIndex++) - { - case 0: - ChipLogProgress(chipTool, " ***** Test Step 0 : 1a: TH adjusts the the DUT to a non-closed position\n"); - err = Test1aThAdjustsTheTheDutToANonClosedPosition_0(); - break; - case 1: - ChipLogProgress(chipTool, " ***** Test Step 1 : 2a: TH sends DownOrClose command to DUT\n"); - err = Test2aThSendsDownOrCloseCommandToDut_1(); - break; - case 2: - ChipLogProgress(chipTool, " ***** Test Step 2 : 3a: TH reads OperationalStatus attribute from DUT\n"); - err = Test3aThReadsOperationalStatusAttributeFromDut_2(); - break; - } + chip::Controller::ColorControlClusterTest cluster; + cluster.Associate(mDevice, 1); - if (CHIP_NO_ERROR != err) - { - ChipLogError(chipTool, " ***** Test Failure: %s\n", chip::ErrorStr(err)); - SetCommandExitStatus(err); - } + return cluster.ReadAttributeColorLoopStartEnhancedHue(mOnSuccessCallback_5.Cancel(), mOnFailureCallback_5.Cancel()); } -private: - std::atomic_uint16_t mTestIndex; - const uint16_t mTestCount = 3; - - chip::Callback::Callback mOnFailureCallback_0{ OnFailureCallback_0, this }; - chip::Callback::Callback mOnSuccessCallback_0{ OnSuccessCallback_0, this }; - chip::Callback::Callback mOnFailureCallback_1{ OnFailureCallback_1, this }; - chip::Callback::Callback mOnSuccessCallback_1{ OnSuccessCallback_1, this }; - chip::Callback::Callback mOnFailureCallback_2{ OnFailureCallback_2, this }; - chip::Callback::Callback mOnSuccessCallback_2{ OnSuccessCallback_2, this }; + void OnFailureResponse_5(uint8_t status) { ThrowFailureResponse(); } - static void OnFailureCallback_0(void * context, uint8_t status) + void OnSuccessResponse_5(uint16_t colorLoopStartEnhancedHue) { - (static_cast(context))->OnFailureResponse_0(status); + VerifyOrReturn(CheckValue("colorLoopStartEnhancedHue", colorLoopStartEnhancedHue, 500U)); + NextTest(); } - static void OnSuccessCallback_0(void * context) { (static_cast(context))->OnSuccessResponse_0(); } - - static void OnFailureCallback_1(void * context, uint8_t status) + CHIP_ERROR TestCheckColorLoopActiveValue_6() { - (static_cast(context))->OnFailureResponse_1(status); + chip::Controller::ColorControlClusterTest cluster; + cluster.Associate(mDevice, 1); + + return cluster.ReadAttributeColorLoopActive(mOnSuccessCallback_6.Cancel(), mOnFailureCallback_6.Cancel()); } - static void OnSuccessCallback_1(void * context) { (static_cast(context))->OnSuccessResponse_1(); } + void OnFailureResponse_6(uint8_t status) { ThrowFailureResponse(); } - static void OnFailureCallback_2(void * context, uint8_t status) + void OnSuccessResponse_6(uint8_t colorLoopActive) { - (static_cast(context))->OnFailureResponse_2(status); + VerifyOrReturn(CheckValue("colorLoopActive", colorLoopActive, 0)); + NextTest(); } - static void OnSuccessCallback_2(void * context, uint8_t operationalStatus) + CHIP_ERROR TestColorLoopSetCommandStartColorLoop_7() { - (static_cast(context))->OnSuccessResponse_2(operationalStatus); + chip::Controller::ColorControlClusterTest cluster; + cluster.Associate(mDevice, 1); + + uint8_t updateFlagsArgument = 1; + uint8_t actionArgument = 1; + uint8_t directionArgument = 0; + uint16_t timeArgument = 0U; + uint16_t startHueArgument = 0U; + uint8_t optionsMaskArgument = 0; + uint8_t optionsOverrideArgument = 0; + + return cluster.ColorLoopSet(mOnSuccessCallback_7.Cancel(), mOnFailureCallback_7.Cancel(), updateFlagsArgument, + actionArgument, directionArgument, timeArgument, startHueArgument, optionsMaskArgument, + optionsOverrideArgument); } - // - // Tests methods - // + void OnFailureResponse_7(uint8_t status) { ThrowFailureResponse(); } - CHIP_ERROR Test1aThAdjustsTheTheDutToANonClosedPosition_0() + void OnSuccessResponse_7() { NextTest(); } + + CHIP_ERROR TestCheckColorLoopActiveValue_8() { - chip::Controller::WindowCoveringClusterTest cluster; + chip::Controller::ColorControlClusterTest cluster; cluster.Associate(mDevice, 1); - return cluster.UpOrOpen(mOnSuccessCallback_0.Cancel(), mOnFailureCallback_0.Cancel()); + return cluster.ReadAttributeColorLoopActive(mOnSuccessCallback_8.Cancel(), mOnFailureCallback_8.Cancel()); } - void OnFailureResponse_0(uint8_t status) { ThrowFailureResponse(); } + void OnFailureResponse_8(uint8_t status) { ThrowFailureResponse(); } - void OnSuccessResponse_0() { NextTest(); } + void OnSuccessResponse_8(uint8_t colorLoopActive) + { + VerifyOrReturn(CheckValue("colorLoopActive", colorLoopActive, 1)); + NextTest(); + } - CHIP_ERROR Test2aThSendsDownOrCloseCommandToDut_1() + CHIP_ERROR TestColorLoopSetCommandSetDirectionAndTimeWhileRunning_9() { - chip::Controller::WindowCoveringClusterTest cluster; + chip::Controller::ColorControlClusterTest cluster; cluster.Associate(mDevice, 1); - return cluster.DownOrClose(mOnSuccessCallback_1.Cancel(), mOnFailureCallback_1.Cancel()); + uint8_t updateFlagsArgument = 6; + uint8_t actionArgument = 0; + uint8_t directionArgument = 0; + uint16_t timeArgument = 3500U; + uint16_t startHueArgument = 0U; + uint8_t optionsMaskArgument = 0; + uint8_t optionsOverrideArgument = 0; + + return cluster.ColorLoopSet(mOnSuccessCallback_9.Cancel(), mOnFailureCallback_9.Cancel(), updateFlagsArgument, + actionArgument, directionArgument, timeArgument, startHueArgument, optionsMaskArgument, + optionsOverrideArgument); } - void OnFailureResponse_1(uint8_t status) { ThrowFailureResponse(); } + void OnFailureResponse_9(uint8_t status) { ThrowFailureResponse(); } - void OnSuccessResponse_1() { NextTest(); } + void OnSuccessResponse_9() { NextTest(); } - CHIP_ERROR Test3aThReadsOperationalStatusAttributeFromDut_2() + CHIP_ERROR TestCheckColorLoopDirectionValue_10() { - chip::Controller::WindowCoveringClusterTest cluster; + chip::Controller::ColorControlClusterTest cluster; cluster.Associate(mDevice, 1); - return cluster.ReadAttributeOperationalStatus(mOnSuccessCallback_2.Cancel(), mOnFailureCallback_2.Cancel()); + return cluster.ReadAttributeColorLoopDirection(mOnSuccessCallback_10.Cancel(), mOnFailureCallback_10.Cancel()); } - void OnFailureResponse_2(uint8_t status) { ThrowFailureResponse(); } + void OnFailureResponse_10(uint8_t status) { ThrowFailureResponse(); } - void OnSuccessResponse_2(uint8_t operationalStatus) + void OnSuccessResponse_10(uint8_t colorLoopDirection) { - VerifyOrReturn(CheckValue("operationalStatus", operationalStatus, 0)); + VerifyOrReturn(CheckValue("colorLoopDirection", colorLoopDirection, 0)); NextTest(); } -}; - -class Test_TC_WNCV_3_3 : public TestCommand -{ -public: - Test_TC_WNCV_3_3() : TestCommand("Test_TC_WNCV_3_3"), mTestIndex(0) {} - /////////// TestCommand Interface ///////// - void NextTest() override + CHIP_ERROR TestCheckColorLoopTimeValue_11() { - CHIP_ERROR err = CHIP_NO_ERROR; - - if (0 == mTestIndex) - { - ChipLogProgress(chipTool, " **** Test Start: Test_TC_WNCV_3_3\n"); - } - - if (mTestCount == mTestIndex) - { - ChipLogProgress(chipTool, " **** Test Complete: Test_TC_WNCV_3_3\n"); - SetCommandExitStatus(CHIP_NO_ERROR); - return; - } - - // Ensure we increment mTestIndex before we start running the relevant - // command. That way if we lose the timeslice after we send the message - // but before our function call returns, we won't end up with an - // incorrect mTestIndex value observed when we get the response. - switch (mTestIndex++) - { - case 0: - ChipLogProgress(chipTool, " ***** Test Step 0 : 1a: TH adjusts the the DUT to a non-open position\n"); - err = Test1aThAdjustsTheTheDutToANonOpenPosition_0(); - break; - case 1: - ChipLogProgress(chipTool, " ***** Test Step 1 : 2a: TH sends StopMotion command to DUT\n"); - err = Test2aThSendsStopMotionCommandToDut_1(); - break; - case 2: - ChipLogProgress(chipTool, " ***** Test Step 2 : 2b: TH reads OperationalStatus attribute from DUT\n"); - err = Test2bThReadsOperationalStatusAttributeFromDut_2(); - break; - } + chip::Controller::ColorControlClusterTest cluster; + cluster.Associate(mDevice, 1); - if (CHIP_NO_ERROR != err) - { - ChipLogError(chipTool, " ***** Test Failure: %s\n", chip::ErrorStr(err)); - SetCommandExitStatus(err); - } + return cluster.ReadAttributeColorLoopTime(mOnSuccessCallback_11.Cancel(), mOnFailureCallback_11.Cancel()); } -private: - std::atomic_uint16_t mTestIndex; - const uint16_t mTestCount = 3; - - chip::Callback::Callback mOnFailureCallback_0{ OnFailureCallback_0, this }; - chip::Callback::Callback mOnSuccessCallback_0{ OnSuccessCallback_0, this }; - chip::Callback::Callback mOnFailureCallback_1{ OnFailureCallback_1, this }; - chip::Callback::Callback mOnSuccessCallback_1{ OnSuccessCallback_1, this }; - chip::Callback::Callback mOnFailureCallback_2{ OnFailureCallback_2, this }; - chip::Callback::Callback mOnSuccessCallback_2{ OnSuccessCallback_2, this }; + void OnFailureResponse_11(uint8_t status) { ThrowFailureResponse(); } - static void OnFailureCallback_0(void * context, uint8_t status) + void OnSuccessResponse_11(uint16_t colorLoopTime) { - (static_cast(context))->OnFailureResponse_0(status); + VerifyOrReturn(CheckValue("colorLoopTime", colorLoopTime, 3500U)); + NextTest(); } - static void OnSuccessCallback_0(void * context) { (static_cast(context))->OnSuccessResponse_0(); } - - static void OnFailureCallback_1(void * context, uint8_t status) + CHIP_ERROR TestColorLoopSetCommandSetDirectionWhileRunning_12() { - (static_cast(context))->OnFailureResponse_1(status); - } + chip::Controller::ColorControlClusterTest cluster; + cluster.Associate(mDevice, 1); - static void OnSuccessCallback_1(void * context) { (static_cast(context))->OnSuccessResponse_1(); } + uint8_t updateFlagsArgument = 2; + uint8_t actionArgument = 0; + uint8_t directionArgument = 1; + uint16_t timeArgument = 0U; + uint16_t startHueArgument = 0U; + uint8_t optionsMaskArgument = 0; + uint8_t optionsOverrideArgument = 0; - static void OnFailureCallback_2(void * context, uint8_t status) - { - (static_cast(context))->OnFailureResponse_2(status); + return cluster.ColorLoopSet(mOnSuccessCallback_12.Cancel(), mOnFailureCallback_12.Cancel(), updateFlagsArgument, + actionArgument, directionArgument, timeArgument, startHueArgument, optionsMaskArgument, + optionsOverrideArgument); } - static void OnSuccessCallback_2(void * context, uint8_t operationalStatus) - { - (static_cast(context))->OnSuccessResponse_2(operationalStatus); - } + void OnFailureResponse_12(uint8_t status) { ThrowFailureResponse(); } - // - // Tests methods - // + void OnSuccessResponse_12() { NextTest(); } - CHIP_ERROR Test1aThAdjustsTheTheDutToANonOpenPosition_0() + CHIP_ERROR TestCheckColorLoopDirectionValue_13() { - chip::Controller::WindowCoveringClusterTest cluster; + chip::Controller::ColorControlClusterTest cluster; cluster.Associate(mDevice, 1); - return cluster.UpOrOpen(mOnSuccessCallback_0.Cancel(), mOnFailureCallback_0.Cancel()); + return cluster.ReadAttributeColorLoopDirection(mOnSuccessCallback_13.Cancel(), mOnFailureCallback_13.Cancel()); } - void OnFailureResponse_0(uint8_t status) { ThrowFailureResponse(); } + void OnFailureResponse_13(uint8_t status) { ThrowFailureResponse(); } - void OnSuccessResponse_0() { NextTest(); } + void OnSuccessResponse_13(uint8_t colorLoopDirection) + { + VerifyOrReturn(CheckValue("colorLoopDirection", colorLoopDirection, 1)); + NextTest(); + } - CHIP_ERROR Test2aThSendsStopMotionCommandToDut_1() + CHIP_ERROR TestTurnOffLightThatWeTurnedOn_14() { - chip::Controller::WindowCoveringClusterTest cluster; + chip::Controller::OnOffClusterTest cluster; cluster.Associate(mDevice, 1); - return cluster.StopMotion(mOnSuccessCallback_1.Cancel(), mOnFailureCallback_1.Cancel()); + return cluster.Off(mOnSuccessCallback_14.Cancel(), mOnFailureCallback_14.Cancel()); } - void OnFailureResponse_1(uint8_t status) { ThrowFailureResponse(); } + void OnFailureResponse_14(uint8_t status) { ThrowFailureResponse(); } - void OnSuccessResponse_1() { NextTest(); } + void OnSuccessResponse_14() { NextTest(); } - CHIP_ERROR Test2bThReadsOperationalStatusAttributeFromDut_2() + CHIP_ERROR TestCheckOnOffAttributeValueIsFalseAfterOffCommand_15() { - chip::Controller::WindowCoveringClusterTest cluster; + chip::Controller::OnOffClusterTest cluster; cluster.Associate(mDevice, 1); - return cluster.ReadAttributeOperationalStatus(mOnSuccessCallback_2.Cancel(), mOnFailureCallback_2.Cancel()); + return cluster.ReadAttributeOnOff(mOnSuccessCallback_15.Cancel(), mOnFailureCallback_15.Cancel()); } - void OnFailureResponse_2(uint8_t status) { ThrowFailureResponse(); } + void OnFailureResponse_15(uint8_t status) { ThrowFailureResponse(); } - void OnSuccessResponse_2(uint8_t operationalStatus) + void OnSuccessResponse_15(bool onOff) { - VerifyOrReturn(CheckValue("operationalStatus", operationalStatus, 0)); + VerifyOrReturn(CheckValue("onOff", onOff, 0)); NextTest(); } }; -class Test_TC_BI_1_1 : public TestCommand +class TV_TargetNavigatorCluster : public TestCommand { public: - Test_TC_BI_1_1() : TestCommand("Test_TC_BI_1_1"), mTestIndex(0) {} + TV_TargetNavigatorCluster() : TestCommand("TV_TargetNavigatorCluster"), mTestIndex(0) {} /////////// TestCommand Interface ///////// void NextTest() override @@ -9073,12 +9306,12 @@ class Test_TC_BI_1_1 : public TestCommand if (0 == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Start: Test_TC_BI_1_1\n"); + ChipLogProgress(chipTool, " **** Test Start: TV_TargetNavigatorCluster\n"); } if (mTestCount == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Complete: Test_TC_BI_1_1\n"); + ChipLogProgress(chipTool, " **** Test Complete: TV_TargetNavigatorCluster\n"); SetCommandExitStatus(CHIP_NO_ERROR); return; } @@ -9090,17 +9323,12 @@ class Test_TC_BI_1_1 : public TestCommand switch (mTestIndex++) { case 0: - ChipLogProgress(chipTool, " ***** Test Step 0 : read the global attribute: ClusterRevision\n"); - err = TestReadTheGlobalAttributeClusterRevision_0(); + ChipLogProgress(chipTool, " ***** Test Step 0 : Read attribute Target Navigator list\n"); + err = TestReadAttributeTargetNavigatorList_0(); break; case 1: - ChipLogProgress(chipTool, - " ***** Test Step 1 : write the default values to mandatory global attribute: ClusterRevision\n"); - err = TestWriteTheDefaultValuesToMandatoryGlobalAttributeClusterRevision_1(); - break; - case 2: - ChipLogProgress(chipTool, " ***** Test Step 2 : reads back global attribute: ClusterRevision\n"); - err = TestReadsBackGlobalAttributeClusterRevision_2(); + ChipLogProgress(chipTool, " ***** Test Step 1 : Navigate Target Command\n"); + err = TestNavigateTargetCommand_1(); break; } @@ -9113,101 +9341,76 @@ class Test_TC_BI_1_1 : public TestCommand private: std::atomic_uint16_t mTestIndex; - const uint16_t mTestCount = 3; + const uint16_t mTestCount = 2; chip::Callback::Callback mOnFailureCallback_0{ OnFailureCallback_0, this }; - chip::Callback::Callback mOnSuccessCallback_0{ OnSuccessCallback_0, this }; + chip::Callback::Callback + mOnSuccessCallback_0{ OnSuccessCallback_0, this }; chip::Callback::Callback mOnFailureCallback_1{ OnFailureCallback_1, this }; - chip::Callback::Callback mOnSuccessCallback_1{ OnSuccessCallback_1, this }; - chip::Callback::Callback mOnFailureCallback_2{ OnFailureCallback_2, this }; - chip::Callback::Callback mOnSuccessCallback_2{ OnSuccessCallback_2, this }; + chip::Callback::Callback mOnSuccessCallback_1{ + OnSuccessCallback_1, this + }; static void OnFailureCallback_0(void * context, uint8_t status) { - (static_cast(context))->OnFailureResponse_0(status); + (static_cast(context))->OnFailureResponse_0(status); } - static void OnSuccessCallback_0(void * context, uint16_t clusterRevision) + static void OnSuccessCallback_0(void * context, uint16_t count, _NavigateTargetTargetInfo * targetNavigatorList) { - (static_cast(context))->OnSuccessResponse_0(clusterRevision); + (static_cast(context))->OnSuccessResponse_0(count, targetNavigatorList); } static void OnFailureCallback_1(void * context, uint8_t status) { - (static_cast(context))->OnFailureResponse_1(status); - } - - static void OnSuccessCallback_1(void * context, uint16_t clusterRevision) - { - (static_cast(context))->OnSuccessResponse_1(clusterRevision); - } - - static void OnFailureCallback_2(void * context, uint8_t status) - { - (static_cast(context))->OnFailureResponse_2(status); + (static_cast(context))->OnFailureResponse_1(status); } - static void OnSuccessCallback_2(void * context, uint16_t clusterRevision) + static void OnSuccessCallback_1(void * context, uint8_t status, chip::ByteSpan data) { - (static_cast(context))->OnSuccessResponse_2(clusterRevision); + (static_cast(context))->OnSuccessResponse_1(status, data); } // // Tests methods // - CHIP_ERROR TestReadTheGlobalAttributeClusterRevision_0() + CHIP_ERROR TestReadAttributeTargetNavigatorList_0() { - chip::Controller::BinaryInputBasicClusterTest cluster; + chip::Controller::TargetNavigatorClusterTest cluster; cluster.Associate(mDevice, 1); - return cluster.ReadAttributeClusterRevision(mOnSuccessCallback_0.Cancel(), mOnFailureCallback_0.Cancel()); + return cluster.ReadAttributeTargetNavigatorList(mOnSuccessCallback_0.Cancel(), mOnFailureCallback_0.Cancel()); } void OnFailureResponse_0(uint8_t status) { ThrowFailureResponse(); } - void OnSuccessResponse_0(uint16_t clusterRevision) + void OnSuccessResponse_0(uint16_t count, _NavigateTargetTargetInfo * targetNavigatorList) { - VerifyOrReturn(CheckValue("clusterRevision", clusterRevision, 1U)); + VerifyOrReturn(CheckValueAsList("targetNavigatorList", count, 2)); NextTest(); } - CHIP_ERROR TestWriteTheDefaultValuesToMandatoryGlobalAttributeClusterRevision_1() + CHIP_ERROR TestNavigateTargetCommand_1() { - chip::Controller::BinaryInputBasicClusterTest cluster; + chip::Controller::TargetNavigatorClusterTest cluster; cluster.Associate(mDevice, 1); - uint16_t clusterRevisionArgument = 1U; - - return cluster.WriteAttributeClusterRevision(mOnSuccessCallback_1.Cancel(), mOnFailureCallback_1.Cancel(), - clusterRevisionArgument); - } - - void OnFailureResponse_1(uint8_t status) { NextTest(); } - - void OnSuccessResponse_1(uint16_t clusterRevision) { ThrowSuccessResponse(); } - - CHIP_ERROR TestReadsBackGlobalAttributeClusterRevision_2() - { - chip::Controller::BinaryInputBasicClusterTest cluster; - cluster.Associate(mDevice, 1); + uint8_t targetArgument = 1; + chip::ByteSpan dataArgument = chip::ByteSpan(chip::Uint8::from_const_char("1"), strlen("1")); - return cluster.ReadAttributeClusterRevision(mOnSuccessCallback_2.Cancel(), mOnFailureCallback_2.Cancel()); + return cluster.NavigateTarget(mOnSuccessCallback_1.Cancel(), mOnFailureCallback_1.Cancel(), targetArgument, dataArgument); } - void OnFailureResponse_2(uint8_t status) { ThrowFailureResponse(); } + void OnFailureResponse_1(uint8_t status) { ThrowFailureResponse(); } - void OnSuccessResponse_2(uint16_t clusterRevision) - { - VerifyOrReturn(CheckValue("clusterRevision", clusterRevision, 1U)); - NextTest(); - } + void OnSuccessResponse_1(uint8_t status, chip::ByteSpan data) { NextTest(); } }; -class Test_TC_FLW_1_1 : public TestCommand +class TV_AudioOutputCluster : public TestCommand { public: - Test_TC_FLW_1_1() : TestCommand("Test_TC_FLW_1_1"), mTestIndex(0) {} + TV_AudioOutputCluster() : TestCommand("TV_AudioOutputCluster"), mTestIndex(0) {} /////////// TestCommand Interface ///////// void NextTest() override @@ -9216,12 +9419,12 @@ class Test_TC_FLW_1_1 : public TestCommand if (0 == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Start: Test_TC_FLW_1_1\n"); + ChipLogProgress(chipTool, " **** Test Start: TV_AudioOutputCluster\n"); } if (mTestCount == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Complete: Test_TC_FLW_1_1\n"); + ChipLogProgress(chipTool, " **** Test Complete: TV_AudioOutputCluster\n"); SetCommandExitStatus(CHIP_NO_ERROR); return; } @@ -9233,9 +9436,16 @@ class Test_TC_FLW_1_1 : public TestCommand switch (mTestIndex++) { case 0: - ChipLogProgress(chipTool, - " ***** Test Step 0 : write the default values to mandatory global attribute: ClusterRevision\n"); - err = TestWriteTheDefaultValuesToMandatoryGlobalAttributeClusterRevision_0(); + ChipLogProgress(chipTool, " ***** Test Step 0 : Read attribute Audio Output list\n"); + err = TestReadAttributeAudioOutputList_0(); + break; + case 1: + ChipLogProgress(chipTool, " ***** Test Step 1 : Select Output Command\n"); + err = TestSelectOutputCommand_1(); + break; + case 2: + ChipLogProgress(chipTool, " ***** Test Step 2 : Rename Output Command\n"); + err = TestRenameOutputCommand_2(); break; } @@ -9248,45 +9458,95 @@ class Test_TC_FLW_1_1 : public TestCommand private: std::atomic_uint16_t mTestIndex; - const uint16_t mTestCount = 1; + const uint16_t mTestCount = 3; chip::Callback::Callback mOnFailureCallback_0{ OnFailureCallback_0, this }; - chip::Callback::Callback mOnSuccessCallback_0{ OnSuccessCallback_0, this }; + chip::Callback::Callback mOnSuccessCallback_0{ + OnSuccessCallback_0, this + }; + chip::Callback::Callback mOnFailureCallback_1{ OnFailureCallback_1, this }; + chip::Callback::Callback mOnSuccessCallback_1{ OnSuccessCallback_1, this }; + chip::Callback::Callback mOnFailureCallback_2{ OnFailureCallback_2, this }; + chip::Callback::Callback mOnSuccessCallback_2{ OnSuccessCallback_2, this }; static void OnFailureCallback_0(void * context, uint8_t status) { - (static_cast(context))->OnFailureResponse_0(status); + (static_cast(context))->OnFailureResponse_0(status); } - static void OnSuccessCallback_0(void * context, uint16_t clusterRevision) + static void OnSuccessCallback_0(void * context, uint16_t count, _AudioOutputInfo * audioOutputList) { - (static_cast(context))->OnSuccessResponse_0(clusterRevision); + (static_cast(context))->OnSuccessResponse_0(count, audioOutputList); + } + + static void OnFailureCallback_1(void * context, uint8_t status) + { + (static_cast(context))->OnFailureResponse_1(status); + } + + static void OnSuccessCallback_1(void * context) { (static_cast(context))->OnSuccessResponse_1(); } + + static void OnFailureCallback_2(void * context, uint8_t status) + { + (static_cast(context))->OnFailureResponse_2(status); } + static void OnSuccessCallback_2(void * context) { (static_cast(context))->OnSuccessResponse_2(); } + // // Tests methods // - CHIP_ERROR TestWriteTheDefaultValuesToMandatoryGlobalAttributeClusterRevision_0() + CHIP_ERROR TestReadAttributeAudioOutputList_0() { - chip::Controller::FlowMeasurementClusterTest cluster; - cluster.Associate(mDevice, 1); + chip::Controller::AudioOutputClusterTest cluster; + cluster.Associate(mDevice, 2); - uint16_t clusterRevisionArgument = 2U; + return cluster.ReadAttributeAudioOutputList(mOnSuccessCallback_0.Cancel(), mOnFailureCallback_0.Cancel()); + } - return cluster.WriteAttributeClusterRevision(mOnSuccessCallback_0.Cancel(), mOnFailureCallback_0.Cancel(), - clusterRevisionArgument); + void OnFailureResponse_0(uint8_t status) { ThrowFailureResponse(); } + + void OnSuccessResponse_0(uint16_t count, _AudioOutputInfo * audioOutputList) + { + VerifyOrReturn(CheckValueAsList("audioOutputList", count, 3)); + NextTest(); } - void OnFailureResponse_0(uint8_t status) { NextTest(); } + CHIP_ERROR TestSelectOutputCommand_1() + { + chip::Controller::AudioOutputClusterTest cluster; + cluster.Associate(mDevice, 2); - void OnSuccessResponse_0(uint16_t clusterRevision) { ThrowSuccessResponse(); } + uint8_t indexArgument = 1; + + return cluster.SelectOutput(mOnSuccessCallback_1.Cancel(), mOnFailureCallback_1.Cancel(), indexArgument); + } + + void OnFailureResponse_1(uint8_t status) { ThrowFailureResponse(); } + + void OnSuccessResponse_1() { NextTest(); } + + CHIP_ERROR TestRenameOutputCommand_2() + { + chip::Controller::AudioOutputClusterTest cluster; + cluster.Associate(mDevice, 2); + + uint8_t indexArgument = 1; + chip::ByteSpan nameArgument = chip::ByteSpan(chip::Uint8::from_const_char("exampleName"), strlen("exampleName")); + + return cluster.RenameOutput(mOnSuccessCallback_2.Cancel(), mOnFailureCallback_2.Cancel(), indexArgument, nameArgument); + } + + void OnFailureResponse_2(uint8_t status) { ThrowFailureResponse(); } + + void OnSuccessResponse_2() { NextTest(); } }; -class Test_TC_TM_1_1 : public TestCommand +class TV_ApplicationLauncherCluster : public TestCommand { public: - Test_TC_TM_1_1() : TestCommand("Test_TC_TM_1_1"), mTestIndex(0) {} + TV_ApplicationLauncherCluster() : TestCommand("TV_ApplicationLauncherCluster"), mTestIndex(0) {} /////////// TestCommand Interface ///////// void NextTest() override @@ -9295,12 +9555,12 @@ class Test_TC_TM_1_1 : public TestCommand if (0 == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Start: Test_TC_TM_1_1\n"); + ChipLogProgress(chipTool, " **** Test Start: TV_ApplicationLauncherCluster\n"); } if (mTestCount == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Complete: Test_TC_TM_1_1\n"); + ChipLogProgress(chipTool, " **** Test Complete: TV_ApplicationLauncherCluster\n"); SetCommandExitStatus(CHIP_NO_ERROR); return; } @@ -9312,17 +9572,20 @@ class Test_TC_TM_1_1 : public TestCommand switch (mTestIndex++) { case 0: - ChipLogProgress(chipTool, " ***** Test Step 0 : read the global attribute: ClusterRevision\n"); - err = TestReadTheGlobalAttributeClusterRevision_0(); + ChipLogProgress(chipTool, " ***** Test Step 0 : Read attribute Application Launcher list\n"); + err = TestReadAttributeApplicationLauncherList_0(); break; case 1: - ChipLogProgress(chipTool, - " ***** Test Step 1 : write the default values to mandatory global attribute: ClusterRevision\n"); - err = TestWriteTheDefaultValuesToMandatoryGlobalAttributeClusterRevision_1(); + ChipLogProgress(chipTool, " ***** Test Step 1 : Launch App Command\n"); + err = TestLaunchAppCommand_1(); break; case 2: - ChipLogProgress(chipTool, " ***** Test Step 2 : reads back global attribute: ClusterRevision\n"); - err = TestReadsBackGlobalAttributeClusterRevision_2(); + ChipLogProgress(chipTool, " ***** Test Step 2 : Read attribute catalog vendor id\n"); + err = TestReadAttributeCatalogVendorId_2(); + break; + case 3: + ChipLogProgress(chipTool, " ***** Test Step 3 : Read attribute application id\n"); + err = TestReadAttributeApplicationId_3(); break; } @@ -9335,101 +9598,135 @@ class Test_TC_TM_1_1 : public TestCommand private: std::atomic_uint16_t mTestIndex; - const uint16_t mTestCount = 3; + const uint16_t mTestCount = 4; chip::Callback::Callback mOnFailureCallback_0{ OnFailureCallback_0, this }; - chip::Callback::Callback mOnSuccessCallback_0{ OnSuccessCallback_0, this }; + chip::Callback::Callback mOnSuccessCallback_0{ + OnSuccessCallback_0, this + }; chip::Callback::Callback mOnFailureCallback_1{ OnFailureCallback_1, this }; - chip::Callback::Callback mOnSuccessCallback_1{ OnSuccessCallback_1, this }; + chip::Callback::Callback mOnSuccessCallback_1{ + OnSuccessCallback_1, this + }; chip::Callback::Callback mOnFailureCallback_2{ OnFailureCallback_2, this }; - chip::Callback::Callback mOnSuccessCallback_2{ OnSuccessCallback_2, this }; + chip::Callback::Callback mOnSuccessCallback_2{ OnSuccessCallback_2, this }; + chip::Callback::Callback mOnFailureCallback_3{ OnFailureCallback_3, this }; + chip::Callback::Callback mOnSuccessCallback_3{ OnSuccessCallback_3, this }; static void OnFailureCallback_0(void * context, uint8_t status) { - (static_cast(context))->OnFailureResponse_0(status); + (static_cast(context))->OnFailureResponse_0(status); } - static void OnSuccessCallback_0(void * context, uint16_t clusterRevision) + static void OnSuccessCallback_0(void * context, uint16_t count, uint16_t * applicationLauncherList) { - (static_cast(context))->OnSuccessResponse_0(clusterRevision); + (static_cast(context))->OnSuccessResponse_0(count, applicationLauncherList); } static void OnFailureCallback_1(void * context, uint8_t status) { - (static_cast(context))->OnFailureResponse_1(status); + (static_cast(context))->OnFailureResponse_1(status); } - static void OnSuccessCallback_1(void * context, uint16_t clusterRevision) + static void OnSuccessCallback_1(void * context, uint8_t status, chip::ByteSpan data) { - (static_cast(context))->OnSuccessResponse_1(clusterRevision); + (static_cast(context))->OnSuccessResponse_1(status, data); } static void OnFailureCallback_2(void * context, uint8_t status) { - (static_cast(context))->OnFailureResponse_2(status); + (static_cast(context))->OnFailureResponse_2(status); } - static void OnSuccessCallback_2(void * context, uint16_t clusterRevision) + static void OnSuccessCallback_2(void * context, uint8_t catalogVendorId) { - (static_cast(context))->OnSuccessResponse_2(clusterRevision); + (static_cast(context))->OnSuccessResponse_2(catalogVendorId); + } + + static void OnFailureCallback_3(void * context, uint8_t status) + { + (static_cast(context))->OnFailureResponse_3(status); + } + + static void OnSuccessCallback_3(void * context, uint8_t applicationId) + { + (static_cast(context))->OnSuccessResponse_3(applicationId); } // // Tests methods // - CHIP_ERROR TestReadTheGlobalAttributeClusterRevision_0() + CHIP_ERROR TestReadAttributeApplicationLauncherList_0() { - chip::Controller::TemperatureMeasurementClusterTest cluster; + chip::Controller::ApplicationLauncherClusterTest cluster; cluster.Associate(mDevice, 1); - return cluster.ReadAttributeClusterRevision(mOnSuccessCallback_0.Cancel(), mOnFailureCallback_0.Cancel()); + return cluster.ReadAttributeApplicationLauncherList(mOnSuccessCallback_0.Cancel(), mOnFailureCallback_0.Cancel()); } void OnFailureResponse_0(uint8_t status) { ThrowFailureResponse(); } - void OnSuccessResponse_0(uint16_t clusterRevision) + void OnSuccessResponse_0(uint16_t count, uint16_t * applicationLauncherList) { - VerifyOrReturn(CheckValue("clusterRevision", clusterRevision, 3U)); + VerifyOrReturn(CheckValueAsList("applicationLauncherList", count, 2)); NextTest(); } - CHIP_ERROR TestWriteTheDefaultValuesToMandatoryGlobalAttributeClusterRevision_1() + CHIP_ERROR TestLaunchAppCommand_1() { - chip::Controller::TemperatureMeasurementClusterTest cluster; + chip::Controller::ApplicationLauncherClusterTest cluster; cluster.Associate(mDevice, 1); - uint16_t clusterRevisionArgument = 3U; + chip::ByteSpan dataArgument = chip::ByteSpan(chip::Uint8::from_const_char("exampleData"), strlen("exampleData")); + uint16_t catalogVendorIdArgument = 1U; + chip::ByteSpan applicationIdArgument = chip::ByteSpan(chip::Uint8::from_const_char("appId"), strlen("appId")); - return cluster.WriteAttributeClusterRevision(mOnSuccessCallback_1.Cancel(), mOnFailureCallback_1.Cancel(), - clusterRevisionArgument); + return cluster.LaunchApp(mOnSuccessCallback_1.Cancel(), mOnFailureCallback_1.Cancel(), dataArgument, + catalogVendorIdArgument, applicationIdArgument); } - void OnFailureResponse_1(uint8_t status) { NextTest(); } + void OnFailureResponse_1(uint8_t status) { ThrowFailureResponse(); } - void OnSuccessResponse_1(uint16_t clusterRevision) { ThrowSuccessResponse(); } + void OnSuccessResponse_1(uint8_t status, chip::ByteSpan data) { NextTest(); } - CHIP_ERROR TestReadsBackGlobalAttributeClusterRevision_2() + CHIP_ERROR TestReadAttributeCatalogVendorId_2() { - chip::Controller::TemperatureMeasurementClusterTest cluster; + chip::Controller::ApplicationLauncherClusterTest cluster; cluster.Associate(mDevice, 1); - return cluster.ReadAttributeClusterRevision(mOnSuccessCallback_2.Cancel(), mOnFailureCallback_2.Cancel()); + return cluster.ReadAttributeCatalogVendorId(mOnSuccessCallback_2.Cancel(), mOnFailureCallback_2.Cancel()); } void OnFailureResponse_2(uint8_t status) { ThrowFailureResponse(); } - void OnSuccessResponse_2(uint16_t clusterRevision) + void OnSuccessResponse_2(uint8_t catalogVendorId) { - VerifyOrReturn(CheckValue("clusterRevision", clusterRevision, 3U)); + VerifyOrReturn(CheckValue("catalogVendorId", catalogVendorId, 0)); + NextTest(); + } + + CHIP_ERROR TestReadAttributeApplicationId_3() + { + chip::Controller::ApplicationLauncherClusterTest cluster; + cluster.Associate(mDevice, 1); + + return cluster.ReadAttributeApplicationId(mOnSuccessCallback_3.Cancel(), mOnFailureCallback_3.Cancel()); + } + + void OnFailureResponse_3(uint8_t status) { ThrowFailureResponse(); } + + void OnSuccessResponse_3(uint8_t applicationId) + { + VerifyOrReturn(CheckValue("applicationId", applicationId, 0)); NextTest(); } }; -class Test_TC_OCC_1_1 : public TestCommand +class TV_KeypadInputCluster : public TestCommand { public: - Test_TC_OCC_1_1() : TestCommand("Test_TC_OCC_1_1"), mTestIndex(0) {} + TV_KeypadInputCluster() : TestCommand("TV_KeypadInputCluster"), mTestIndex(0) {} /////////// TestCommand Interface ///////// void NextTest() override @@ -9438,12 +9735,12 @@ class Test_TC_OCC_1_1 : public TestCommand if (0 == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Start: Test_TC_OCC_1_1\n"); + ChipLogProgress(chipTool, " **** Test Start: TV_KeypadInputCluster\n"); } if (mTestCount == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Complete: Test_TC_OCC_1_1\n"); + ChipLogProgress(chipTool, " **** Test Complete: TV_KeypadInputCluster\n"); SetCommandExitStatus(CHIP_NO_ERROR); return; } @@ -9455,13 +9752,8 @@ class Test_TC_OCC_1_1 : public TestCommand switch (mTestIndex++) { case 0: - ChipLogProgress(chipTool, " ***** Test Step 0 : read the global attribute: ClusterRevision\n"); - err = TestReadTheGlobalAttributeClusterRevision_0(); - break; - case 1: - ChipLogProgress(chipTool, - " ***** Test Step 1 : write the default values to mandatory global attribute: ClusterRevision\n"); - err = TestWriteTheDefaultValuesToMandatoryGlobalAttributeClusterRevision_1(); + ChipLogProgress(chipTool, " ***** Test Step 0 : Send Key Command\n"); + err = TestSendKeyCommand_0(); break; } @@ -9474,73 +9766,44 @@ class Test_TC_OCC_1_1 : public TestCommand private: std::atomic_uint16_t mTestIndex; - const uint16_t mTestCount = 2; + const uint16_t mTestCount = 1; chip::Callback::Callback mOnFailureCallback_0{ OnFailureCallback_0, this }; - chip::Callback::Callback mOnSuccessCallback_0{ OnSuccessCallback_0, this }; - chip::Callback::Callback mOnFailureCallback_1{ OnFailureCallback_1, this }; - chip::Callback::Callback mOnSuccessCallback_1{ OnSuccessCallback_1, this }; + chip::Callback::Callback mOnSuccessCallback_0{ OnSuccessCallback_0, this }; static void OnFailureCallback_0(void * context, uint8_t status) { - (static_cast(context))->OnFailureResponse_0(status); - } - - static void OnSuccessCallback_0(void * context, uint16_t clusterRevision) - { - (static_cast(context))->OnSuccessResponse_0(clusterRevision); - } - - static void OnFailureCallback_1(void * context, uint8_t status) - { - (static_cast(context))->OnFailureResponse_1(status); + (static_cast(context))->OnFailureResponse_0(status); } - static void OnSuccessCallback_1(void * context, uint16_t clusterRevision) + static void OnSuccessCallback_0(void * context, uint8_t status) { - (static_cast(context))->OnSuccessResponse_1(clusterRevision); + (static_cast(context))->OnSuccessResponse_0(status); } // // Tests methods // - CHIP_ERROR TestReadTheGlobalAttributeClusterRevision_0() - { - chip::Controller::OccupancySensingClusterTest cluster; - cluster.Associate(mDevice, 1); - - return cluster.ReadAttributeClusterRevision(mOnSuccessCallback_0.Cancel(), mOnFailureCallback_0.Cancel()); - } - - void OnFailureResponse_0(uint8_t status) { ThrowFailureResponse(); } - - void OnSuccessResponse_0(uint16_t clusterRevision) - { - VerifyOrReturn(CheckValue("clusterRevision", clusterRevision, 2U)); - NextTest(); - } - - CHIP_ERROR TestWriteTheDefaultValuesToMandatoryGlobalAttributeClusterRevision_1() + CHIP_ERROR TestSendKeyCommand_0() { - chip::Controller::OccupancySensingClusterTest cluster; + chip::Controller::KeypadInputClusterTest cluster; cluster.Associate(mDevice, 1); - uint16_t clusterRevisionArgument = 2U; + uint8_t keyCodeArgument = 3; - return cluster.WriteAttributeClusterRevision(mOnSuccessCallback_1.Cancel(), mOnFailureCallback_1.Cancel(), - clusterRevisionArgument); + return cluster.SendKey(mOnSuccessCallback_0.Cancel(), mOnFailureCallback_0.Cancel(), keyCodeArgument); } - void OnFailureResponse_1(uint8_t status) { NextTest(); } + void OnFailureResponse_0(uint8_t status) { ThrowFailureResponse(); } - void OnSuccessResponse_1(uint16_t clusterRevision) { ThrowSuccessResponse(); } + void OnSuccessResponse_0(uint8_t status) { NextTest(); } }; -class TestOperationalCredentialsCluster : public TestCommand +class TV_AccountLoginCluster : public TestCommand { public: - TestOperationalCredentialsCluster() : TestCommand("TestOperationalCredentialsCluster"), mTestIndex(0) {} + TV_AccountLoginCluster() : TestCommand("TV_AccountLoginCluster"), mTestIndex(0) {} /////////// TestCommand Interface ///////// void NextTest() override @@ -9549,12 +9812,12 @@ class TestOperationalCredentialsCluster : public TestCommand if (0 == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Start: TestOperationalCredentialsCluster\n"); + ChipLogProgress(chipTool, " **** Test Start: TV_AccountLoginCluster\n"); } if (mTestCount == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Complete: TestOperationalCredentialsCluster\n"); + ChipLogProgress(chipTool, " **** Test Complete: TV_AccountLoginCluster\n"); SetCommandExitStatus(CHIP_NO_ERROR); return; } @@ -9566,12 +9829,12 @@ class TestOperationalCredentialsCluster : public TestCommand switch (mTestIndex++) { case 0: - ChipLogProgress(chipTool, " ***** Test Step 0 : Read number of supported fabrics\n"); - err = TestReadNumberOfSupportedFabrics_0(); + ChipLogProgress(chipTool, " ***** Test Step 0 : Get Setup PIN Command\n"); + err = TestGetSetupPinCommand_0(); break; case 1: - ChipLogProgress(chipTool, " ***** Test Step 1 : Read number of commissioned fabrics\n"); - err = TestReadNumberOfCommissionedFabrics_1(); + ChipLogProgress(chipTool, " ***** Test Step 1 : Login Command\n"); + err = TestLoginCommand_1(); break; } @@ -9587,74 +9850,66 @@ class TestOperationalCredentialsCluster : public TestCommand const uint16_t mTestCount = 2; chip::Callback::Callback mOnFailureCallback_0{ OnFailureCallback_0, this }; - chip::Callback::Callback mOnSuccessCallback_0{ OnSuccessCallback_0, this }; + chip::Callback::Callback mOnSuccessCallback_0{ OnSuccessCallback_0, this }; chip::Callback::Callback mOnFailureCallback_1{ OnFailureCallback_1, this }; - chip::Callback::Callback mOnSuccessCallback_1{ OnSuccessCallback_1, - this }; + chip::Callback::Callback mOnSuccessCallback_1{ OnSuccessCallback_1, this }; static void OnFailureCallback_0(void * context, uint8_t status) { - (static_cast(context))->OnFailureResponse_0(status); + (static_cast(context))->OnFailureResponse_0(status); } - static void OnSuccessCallback_0(void * context, uint8_t supportedFabrics) + static void OnSuccessCallback_0(void * context, chip::ByteSpan setupPIN) { - (static_cast(context))->OnSuccessResponse_0(supportedFabrics); + (static_cast(context))->OnSuccessResponse_0(setupPIN); } static void OnFailureCallback_1(void * context, uint8_t status) { - (static_cast(context))->OnFailureResponse_1(status); + (static_cast(context))->OnFailureResponse_1(status); } - static void OnSuccessCallback_1(void * context, uint8_t commissionedFabrics) - { - (static_cast(context))->OnSuccessResponse_1(commissionedFabrics); - } + static void OnSuccessCallback_1(void * context) { (static_cast(context))->OnSuccessResponse_1(); } // // Tests methods // - CHIP_ERROR TestReadNumberOfSupportedFabrics_0() + CHIP_ERROR TestGetSetupPinCommand_0() { - chip::Controller::OperationalCredentialsClusterTest cluster; - cluster.Associate(mDevice, 0); + chip::Controller::AccountLoginClusterTest cluster; + cluster.Associate(mDevice, 3); - return cluster.ReadAttributeSupportedFabrics(mOnSuccessCallback_0.Cancel(), mOnFailureCallback_0.Cancel()); + chip::ByteSpan tempAccountIdentifierArgument = chip::ByteSpan(chip::Uint8::from_const_char("asdf"), strlen("asdf")); + + return cluster.GetSetupPIN(mOnSuccessCallback_0.Cancel(), mOnFailureCallback_0.Cancel(), tempAccountIdentifierArgument); } void OnFailureResponse_0(uint8_t status) { ThrowFailureResponse(); } - void OnSuccessResponse_0(uint8_t supportedFabrics) - { - VerifyOrReturn(CheckConstraintType("supportedFabrics", "", "uint8")); - VerifyOrReturn(CheckConstraintMinValue("supportedFabrics", supportedFabrics, 4)); - NextTest(); - } + void OnSuccessResponse_0(chip::ByteSpan setupPIN) { NextTest(); } - CHIP_ERROR TestReadNumberOfCommissionedFabrics_1() + CHIP_ERROR TestLoginCommand_1() { - chip::Controller::OperationalCredentialsClusterTest cluster; - cluster.Associate(mDevice, 0); + chip::Controller::AccountLoginClusterTest cluster; + cluster.Associate(mDevice, 3); - return cluster.ReadAttributeCommissionedFabrics(mOnSuccessCallback_1.Cancel(), mOnFailureCallback_1.Cancel()); + chip::ByteSpan tempAccountIdentifierArgument = chip::ByteSpan(chip::Uint8::from_const_char("asdf"), strlen("asdf")); + chip::ByteSpan setupPINArgument = chip::ByteSpan(chip::Uint8::from_const_char("tempPin123"), strlen("tempPin123")); + + return cluster.Login(mOnSuccessCallback_1.Cancel(), mOnFailureCallback_1.Cancel(), tempAccountIdentifierArgument, + setupPINArgument); } void OnFailureResponse_1(uint8_t status) { ThrowFailureResponse(); } - void OnSuccessResponse_1(uint8_t commissionedFabrics) - { - VerifyOrReturn(CheckConstraintType("commissionedFabrics", "", "uint8")); - VerifyOrReturn(CheckConstraintMinValue("commissionedFabrics", commissionedFabrics, 1)); - NextTest(); - } + void OnSuccessResponse_1() { NextTest(); } }; -class Test_TC_LVL_1_1 : public TestCommand +class TV_WakeOnLanCluster : public TestCommand { public: - Test_TC_LVL_1_1() : TestCommand("Test_TC_LVL_1_1"), mTestIndex(0) {} + TV_WakeOnLanCluster() : TestCommand("TV_WakeOnLanCluster"), mTestIndex(0) {} /////////// TestCommand Interface ///////// void NextTest() override @@ -9663,12 +9918,12 @@ class Test_TC_LVL_1_1 : public TestCommand if (0 == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Start: Test_TC_LVL_1_1\n"); + ChipLogProgress(chipTool, " **** Test Start: TV_WakeOnLanCluster\n"); } if (mTestCount == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Complete: Test_TC_LVL_1_1\n"); + ChipLogProgress(chipTool, " **** Test Complete: TV_WakeOnLanCluster\n"); SetCommandExitStatus(CHIP_NO_ERROR); return; } @@ -9680,9 +9935,8 @@ class Test_TC_LVL_1_1 : public TestCommand switch (mTestIndex++) { case 0: - ChipLogProgress(chipTool, - " ***** Test Step 0 : write the default values to mandatory global attribute: ClusterRevision\n"); - err = TestWriteTheDefaultValuesToMandatoryGlobalAttributeClusterRevision_0(); + ChipLogProgress(chipTool, " ***** Test Step 0 : Read mac address\n"); + err = TestReadMacAddress_0(); break; } @@ -9698,42 +9952,45 @@ class Test_TC_LVL_1_1 : public TestCommand const uint16_t mTestCount = 1; chip::Callback::Callback mOnFailureCallback_0{ OnFailureCallback_0, this }; - chip::Callback::Callback mOnSuccessCallback_0{ OnSuccessCallback_0, this }; + chip::Callback::Callback mOnSuccessCallback_0{ + OnSuccessCallback_0, this + }; static void OnFailureCallback_0(void * context, uint8_t status) { - (static_cast(context))->OnFailureResponse_0(status); + (static_cast(context))->OnFailureResponse_0(status); } - static void OnSuccessCallback_0(void * context, uint16_t clusterRevision) + static void OnSuccessCallback_0(void * context, chip::ByteSpan wakeOnLanMacAddress) { - (static_cast(context))->OnSuccessResponse_0(clusterRevision); + (static_cast(context))->OnSuccessResponse_0(wakeOnLanMacAddress); } // // Tests methods // - CHIP_ERROR TestWriteTheDefaultValuesToMandatoryGlobalAttributeClusterRevision_0() + CHIP_ERROR TestReadMacAddress_0() { - chip::Controller::LevelControlClusterTest cluster; + chip::Controller::WakeOnLanClusterTest cluster; cluster.Associate(mDevice, 1); - uint16_t clusterRevisionArgument = 4U; - - return cluster.WriteAttributeClusterRevision(mOnSuccessCallback_0.Cancel(), mOnFailureCallback_0.Cancel(), - clusterRevisionArgument); + return cluster.ReadAttributeWakeOnLanMacAddress(mOnSuccessCallback_0.Cancel(), mOnFailureCallback_0.Cancel()); } - void OnFailureResponse_0(uint8_t status) { NextTest(); } + void OnFailureResponse_0(uint8_t status) { ThrowFailureResponse(); } - void OnSuccessResponse_0(uint16_t clusterRevision) { ThrowSuccessResponse(); } + void OnSuccessResponse_0(chip::ByteSpan wakeOnLanMacAddress) + { + VerifyOrReturn(CheckValueAsString("wakeOnLanMacAddress", wakeOnLanMacAddress, "00:00:00:00:00")); + NextTest(); + } }; -class Test_TC_CC_1_1 : public TestCommand +class TV_ApplicationBasicCluster : public TestCommand { public: - Test_TC_CC_1_1() : TestCommand("Test_TC_CC_1_1"), mTestIndex(0) {} + TV_ApplicationBasicCluster() : TestCommand("TV_ApplicationBasicCluster"), mTestIndex(0) {} /////////// TestCommand Interface ///////// void NextTest() override @@ -9742,12 +9999,12 @@ class Test_TC_CC_1_1 : public TestCommand if (0 == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Start: Test_TC_CC_1_1\n"); + ChipLogProgress(chipTool, " **** Test Start: TV_ApplicationBasicCluster\n"); } if (mTestCount == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Complete: Test_TC_CC_1_1\n"); + ChipLogProgress(chipTool, " **** Test Complete: TV_ApplicationBasicCluster\n"); SetCommandExitStatus(CHIP_NO_ERROR); return; } @@ -9759,9 +10016,20 @@ class Test_TC_CC_1_1 : public TestCommand switch (mTestIndex++) { case 0: - ChipLogProgress(chipTool, - " ***** Test Step 0 : write the default values to mandatory global attribute: ClusterRevision\n"); - err = TestWriteTheDefaultValuesToMandatoryGlobalAttributeClusterRevision_0(); + ChipLogProgress(chipTool, " ***** Test Step 0 : Change Status Command\n"); + err = TestChangeStatusCommand_0(); + break; + case 1: + ChipLogProgress(chipTool, " ***** Test Step 1 : Read attribute vendor id\n"); + err = TestReadAttributeVendorId_1(); + break; + case 2: + ChipLogProgress(chipTool, " ***** Test Step 2 : Read attribute product id\n"); + err = TestReadAttributeProductId_2(); + break; + case 3: + ChipLogProgress(chipTool, " ***** Test Step 3 : Read attribute catalog vendor id\n"); + err = TestReadAttributeCatalogVendorId_3(); break; } @@ -9774,45 +10042,125 @@ class Test_TC_CC_1_1 : public TestCommand private: std::atomic_uint16_t mTestIndex; - const uint16_t mTestCount = 1; + const uint16_t mTestCount = 4; chip::Callback::Callback mOnFailureCallback_0{ OnFailureCallback_0, this }; - chip::Callback::Callback mOnSuccessCallback_0{ OnSuccessCallback_0, this }; + chip::Callback::Callback mOnSuccessCallback_0{ OnSuccessCallback_0, this }; + chip::Callback::Callback mOnFailureCallback_1{ OnFailureCallback_1, this }; + chip::Callback::Callback mOnSuccessCallback_1{ OnSuccessCallback_1, this }; + chip::Callback::Callback mOnFailureCallback_2{ OnFailureCallback_2, this }; + chip::Callback::Callback mOnSuccessCallback_2{ OnSuccessCallback_2, this }; + chip::Callback::Callback mOnFailureCallback_3{ OnFailureCallback_3, this }; + chip::Callback::Callback mOnSuccessCallback_3{ OnSuccessCallback_3, this }; static void OnFailureCallback_0(void * context, uint8_t status) { - (static_cast(context))->OnFailureResponse_0(status); + (static_cast(context))->OnFailureResponse_0(status); } - static void OnSuccessCallback_0(void * context, uint16_t clusterRevision) + static void OnSuccessCallback_0(void * context) { (static_cast(context))->OnSuccessResponse_0(); } + + static void OnFailureCallback_1(void * context, uint8_t status) { - (static_cast(context))->OnSuccessResponse_0(clusterRevision); + (static_cast(context))->OnFailureResponse_1(status); + } + + static void OnSuccessCallback_1(void * context, uint16_t vendorId) + { + (static_cast(context))->OnSuccessResponse_1(vendorId); + } + + static void OnFailureCallback_2(void * context, uint8_t status) + { + (static_cast(context))->OnFailureResponse_2(status); + } + + static void OnSuccessCallback_2(void * context, uint16_t productId) + { + (static_cast(context))->OnSuccessResponse_2(productId); + } + + static void OnFailureCallback_3(void * context, uint8_t status) + { + (static_cast(context))->OnFailureResponse_3(status); + } + + static void OnSuccessCallback_3(void * context, uint16_t catalogVendorId) + { + (static_cast(context))->OnSuccessResponse_3(catalogVendorId); } // // Tests methods // - CHIP_ERROR TestWriteTheDefaultValuesToMandatoryGlobalAttributeClusterRevision_0() + CHIP_ERROR TestChangeStatusCommand_0() { - chip::Controller::ColorControlClusterTest cluster; - cluster.Associate(mDevice, 1); + chip::Controller::ApplicationBasicClusterTest cluster; + cluster.Associate(mDevice, 3); - uint16_t clusterRevisionArgument = 4U; + uint8_t statusArgument = 1; - return cluster.WriteAttributeClusterRevision(mOnSuccessCallback_0.Cancel(), mOnFailureCallback_0.Cancel(), - clusterRevisionArgument); + return cluster.ChangeStatus(mOnSuccessCallback_0.Cancel(), mOnFailureCallback_0.Cancel(), statusArgument); } - void OnFailureResponse_0(uint8_t status) { NextTest(); } + void OnFailureResponse_0(uint8_t status) { ThrowFailureResponse(); } - void OnSuccessResponse_0(uint16_t clusterRevision) { ThrowSuccessResponse(); } + void OnSuccessResponse_0() { NextTest(); } + + CHIP_ERROR TestReadAttributeVendorId_1() + { + chip::Controller::ApplicationBasicClusterTest cluster; + cluster.Associate(mDevice, 3); + + return cluster.ReadAttributeVendorId(mOnSuccessCallback_1.Cancel(), mOnFailureCallback_1.Cancel()); + } + + void OnFailureResponse_1(uint8_t status) { ThrowFailureResponse(); } + + void OnSuccessResponse_1(uint16_t vendorId) + { + VerifyOrReturn(CheckValue("vendorId", vendorId, 1U)); + NextTest(); + } + + CHIP_ERROR TestReadAttributeProductId_2() + { + chip::Controller::ApplicationBasicClusterTest cluster; + cluster.Associate(mDevice, 3); + + return cluster.ReadAttributeProductId(mOnSuccessCallback_2.Cancel(), mOnFailureCallback_2.Cancel()); + } + + void OnFailureResponse_2(uint8_t status) { ThrowFailureResponse(); } + + void OnSuccessResponse_2(uint16_t productId) + { + VerifyOrReturn(CheckValue("productId", productId, 1U)); + NextTest(); + } + + CHIP_ERROR TestReadAttributeCatalogVendorId_3() + { + chip::Controller::ApplicationBasicClusterTest cluster; + cluster.Associate(mDevice, 3); + + return cluster.ReadAttributeCatalogVendorId(mOnSuccessCallback_3.Cancel(), mOnFailureCallback_3.Cancel()); + } + + void OnFailureResponse_3(uint8_t status) { ThrowFailureResponse(); } + + void OnSuccessResponse_3(uint16_t catalogVendorId) + { + VerifyOrReturn(CheckValue("catalogVendorId", catalogVendorId, 1U)); + NextTest(); + } }; -class Test_TC_RH_1_1 : public TestCommand +class TV_MediaPlaybackCluster : public TestCommand { public: - Test_TC_RH_1_1() : TestCommand("Test_TC_RH_1_1"), mTestIndex(0) {} + TV_MediaPlaybackCluster() : TestCommand("TV_MediaPlaybackCluster"), mTestIndex(0) {} /////////// TestCommand Interface ///////// void NextTest() override @@ -9821,393 +10169,416 @@ class Test_TC_RH_1_1 : public TestCommand if (0 == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Start: Test_TC_RH_1_1\n"); + ChipLogProgress(chipTool, " **** Test Start: TV_MediaPlaybackCluster\n"); } if (mTestCount == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Complete: Test_TC_RH_1_1\n"); + ChipLogProgress(chipTool, " **** Test Complete: TV_MediaPlaybackCluster\n"); SetCommandExitStatus(CHIP_NO_ERROR); return; } - // Ensure we increment mTestIndex before we start running the relevant - // command. That way if we lose the timeslice after we send the message - // but before our function call returns, we won't end up with an - // incorrect mTestIndex value observed when we get the response. - switch (mTestIndex++) - { - case 0: - ChipLogProgress(chipTool, - " ***** Test Step 0 : write the default values to mandatory global attribute: ClusterRevision\n"); - err = TestWriteTheDefaultValuesToMandatoryGlobalAttributeClusterRevision_0(); - break; - } + // Ensure we increment mTestIndex before we start running the relevant + // command. That way if we lose the timeslice after we send the message + // but before our function call returns, we won't end up with an + // incorrect mTestIndex value observed when we get the response. + switch (mTestIndex++) + { + case 0: + ChipLogProgress(chipTool, " ***** Test Step 0 : Media Playback Play Command\n"); + err = TestMediaPlaybackPlayCommand_0(); + break; + case 1: + ChipLogProgress(chipTool, " ***** Test Step 1 : Media Playback Pause Command\n"); + err = TestMediaPlaybackPauseCommand_1(); + break; + case 2: + ChipLogProgress(chipTool, " ***** Test Step 2 : Media Playback Stop Command\n"); + err = TestMediaPlaybackStopCommand_2(); + break; + case 3: + ChipLogProgress(chipTool, " ***** Test Step 3 : Media Playback Start Over Command\n"); + err = TestMediaPlaybackStartOverCommand_3(); + break; + case 4: + ChipLogProgress(chipTool, " ***** Test Step 4 : Media Playback Previous Command\n"); + err = TestMediaPlaybackPreviousCommand_4(); + break; + case 5: + ChipLogProgress(chipTool, " ***** Test Step 5 : Media Playback Next Command\n"); + err = TestMediaPlaybackNextCommand_5(); + break; + case 6: + ChipLogProgress(chipTool, " ***** Test Step 6 : Media Playback Rewind Command\n"); + err = TestMediaPlaybackRewindCommand_6(); + break; + case 7: + ChipLogProgress(chipTool, " ***** Test Step 7 : Media Playback Fast Forward Command\n"); + err = TestMediaPlaybackFastForwardCommand_7(); + break; + case 8: + ChipLogProgress(chipTool, " ***** Test Step 8 : Media Playback Skip Forward Command\n"); + err = TestMediaPlaybackSkipForwardCommand_8(); + break; + case 9: + ChipLogProgress(chipTool, " ***** Test Step 9 : Media Playback Skip Backward Command\n"); + err = TestMediaPlaybackSkipBackwardCommand_9(); + break; + case 10: + ChipLogProgress(chipTool, " ***** Test Step 10 : Media Playback Seek Command\n"); + err = TestMediaPlaybackSeekCommand_10(); + break; + } + + if (CHIP_NO_ERROR != err) + { + ChipLogError(chipTool, " ***** Test Failure: %s\n", chip::ErrorStr(err)); + SetCommandExitStatus(err); + } + } + +private: + std::atomic_uint16_t mTestIndex; + const uint16_t mTestCount = 11; + + chip::Callback::Callback mOnFailureCallback_0{ OnFailureCallback_0, this }; + chip::Callback::Callback mOnSuccessCallback_0{ OnSuccessCallback_0, + this }; + chip::Callback::Callback mOnFailureCallback_1{ OnFailureCallback_1, this }; + chip::Callback::Callback mOnSuccessCallback_1{ OnSuccessCallback_1, + this }; + chip::Callback::Callback mOnFailureCallback_2{ OnFailureCallback_2, this }; + chip::Callback::Callback mOnSuccessCallback_2{ OnSuccessCallback_2, + this }; + chip::Callback::Callback mOnFailureCallback_3{ OnFailureCallback_3, this }; + chip::Callback::Callback mOnSuccessCallback_3{ OnSuccessCallback_3, + this }; + chip::Callback::Callback mOnFailureCallback_4{ OnFailureCallback_4, this }; + chip::Callback::Callback mOnSuccessCallback_4{ OnSuccessCallback_4, + this }; + chip::Callback::Callback mOnFailureCallback_5{ OnFailureCallback_5, this }; + chip::Callback::Callback mOnSuccessCallback_5{ OnSuccessCallback_5, + this }; + chip::Callback::Callback mOnFailureCallback_6{ OnFailureCallback_6, this }; + chip::Callback::Callback mOnSuccessCallback_6{ OnSuccessCallback_6, + this }; + chip::Callback::Callback mOnFailureCallback_7{ OnFailureCallback_7, this }; + chip::Callback::Callback mOnSuccessCallback_7{ OnSuccessCallback_7, + this }; + chip::Callback::Callback mOnFailureCallback_8{ OnFailureCallback_8, this }; + chip::Callback::Callback mOnSuccessCallback_8{ OnSuccessCallback_8, + this }; + chip::Callback::Callback mOnFailureCallback_9{ OnFailureCallback_9, this }; + chip::Callback::Callback mOnSuccessCallback_9{ OnSuccessCallback_9, + this }; + chip::Callback::Callback mOnFailureCallback_10{ OnFailureCallback_10, this }; + chip::Callback::Callback mOnSuccessCallback_10{ OnSuccessCallback_10, + this }; + + static void OnFailureCallback_0(void * context, uint8_t status) + { + (static_cast(context))->OnFailureResponse_0(status); + } - if (CHIP_NO_ERROR != err) - { - ChipLogError(chipTool, " ***** Test Failure: %s\n", chip::ErrorStr(err)); - SetCommandExitStatus(err); - } + static void OnSuccessCallback_0(void * context, uint8_t mediaPlaybackStatus) + { + (static_cast(context))->OnSuccessResponse_0(mediaPlaybackStatus); } -private: - std::atomic_uint16_t mTestIndex; - const uint16_t mTestCount = 1; + static void OnFailureCallback_1(void * context, uint8_t status) + { + (static_cast(context))->OnFailureResponse_1(status); + } - chip::Callback::Callback mOnFailureCallback_0{ OnFailureCallback_0, this }; - chip::Callback::Callback mOnSuccessCallback_0{ OnSuccessCallback_0, this }; + static void OnSuccessCallback_1(void * context, uint8_t mediaPlaybackStatus) + { + (static_cast(context))->OnSuccessResponse_1(mediaPlaybackStatus); + } - static void OnFailureCallback_0(void * context, uint8_t status) + static void OnFailureCallback_2(void * context, uint8_t status) { - (static_cast(context))->OnFailureResponse_0(status); + (static_cast(context))->OnFailureResponse_2(status); } - static void OnSuccessCallback_0(void * context, uint16_t clusterRevision) + static void OnSuccessCallback_2(void * context, uint8_t mediaPlaybackStatus) { - (static_cast(context))->OnSuccessResponse_0(clusterRevision); + (static_cast(context))->OnSuccessResponse_2(mediaPlaybackStatus); } - // - // Tests methods - // + static void OnFailureCallback_3(void * context, uint8_t status) + { + (static_cast(context))->OnFailureResponse_3(status); + } - CHIP_ERROR TestWriteTheDefaultValuesToMandatoryGlobalAttributeClusterRevision_0() + static void OnSuccessCallback_3(void * context, uint8_t mediaPlaybackStatus) { - chip::Controller::RelativeHumidityMeasurementClusterTest cluster; - cluster.Associate(mDevice, 1); + (static_cast(context))->OnSuccessResponse_3(mediaPlaybackStatus); + } - uint16_t clusterRevisionArgument = 1U; + static void OnFailureCallback_4(void * context, uint8_t status) + { + (static_cast(context))->OnFailureResponse_4(status); + } - return cluster.WriteAttributeClusterRevision(mOnSuccessCallback_0.Cancel(), mOnFailureCallback_0.Cancel(), - clusterRevisionArgument); + static void OnSuccessCallback_4(void * context, uint8_t mediaPlaybackStatus) + { + (static_cast(context))->OnSuccessResponse_4(mediaPlaybackStatus); } - void OnFailureResponse_0(uint8_t status) { NextTest(); } + static void OnFailureCallback_5(void * context, uint8_t status) + { + (static_cast(context))->OnFailureResponse_5(status); + } - void OnSuccessResponse_0(uint16_t clusterRevision) { ThrowSuccessResponse(); } -}; + static void OnSuccessCallback_5(void * context, uint8_t mediaPlaybackStatus) + { + (static_cast(context))->OnSuccessResponse_5(mediaPlaybackStatus); + } -class Test_TC_MC_1_1 : public TestCommand -{ -public: - Test_TC_MC_1_1() : TestCommand("Test_TC_MC_1_1"), mTestIndex(0) {} + static void OnFailureCallback_6(void * context, uint8_t status) + { + (static_cast(context))->OnFailureResponse_6(status); + } - /////////// TestCommand Interface ///////// - void NextTest() override + static void OnSuccessCallback_6(void * context, uint8_t mediaPlaybackStatus) { - CHIP_ERROR err = CHIP_NO_ERROR; + (static_cast(context))->OnSuccessResponse_6(mediaPlaybackStatus); + } - if (0 == mTestIndex) - { - ChipLogProgress(chipTool, " **** Test Start: Test_TC_MC_1_1\n"); - } + static void OnFailureCallback_7(void * context, uint8_t status) + { + (static_cast(context))->OnFailureResponse_7(status); + } - if (mTestCount == mTestIndex) - { - ChipLogProgress(chipTool, " **** Test Complete: Test_TC_MC_1_1\n"); - SetCommandExitStatus(CHIP_NO_ERROR); - return; - } + static void OnSuccessCallback_7(void * context, uint8_t mediaPlaybackStatus) + { + (static_cast(context))->OnSuccessResponse_7(mediaPlaybackStatus); + } - // Ensure we increment mTestIndex before we start running the relevant - // command. That way if we lose the timeslice after we send the message - // but before our function call returns, we won't end up with an - // incorrect mTestIndex value observed when we get the response. - switch (mTestIndex++) - { - case 0: - ChipLogProgress(chipTool, - " ***** Test Step 0 : write the default values to mandatory global attribute: ClusterRevision\n"); - err = TestWriteTheDefaultValuesToMandatoryGlobalAttributeClusterRevision_0(); - break; - } + static void OnFailureCallback_8(void * context, uint8_t status) + { + (static_cast(context))->OnFailureResponse_8(status); + } - if (CHIP_NO_ERROR != err) - { - ChipLogError(chipTool, " ***** Test Failure: %s\n", chip::ErrorStr(err)); - SetCommandExitStatus(err); - } + static void OnSuccessCallback_8(void * context, uint8_t mediaPlaybackStatus) + { + (static_cast(context))->OnSuccessResponse_8(mediaPlaybackStatus); } -private: - std::atomic_uint16_t mTestIndex; - const uint16_t mTestCount = 1; + static void OnFailureCallback_9(void * context, uint8_t status) + { + (static_cast(context))->OnFailureResponse_9(status); + } - chip::Callback::Callback mOnFailureCallback_0{ OnFailureCallback_0, this }; - chip::Callback::Callback mOnSuccessCallback_0{ OnSuccessCallback_0, this }; + static void OnSuccessCallback_9(void * context, uint8_t mediaPlaybackStatus) + { + (static_cast(context))->OnSuccessResponse_9(mediaPlaybackStatus); + } - static void OnFailureCallback_0(void * context, uint8_t status) + static void OnFailureCallback_10(void * context, uint8_t status) { - (static_cast(context))->OnFailureResponse_0(status); + (static_cast(context))->OnFailureResponse_10(status); } - static void OnSuccessCallback_0(void * context, uint16_t clusterRevision) + static void OnSuccessCallback_10(void * context, uint8_t mediaPlaybackStatus) { - (static_cast(context))->OnSuccessResponse_0(clusterRevision); + (static_cast(context))->OnSuccessResponse_10(mediaPlaybackStatus); } // // Tests methods // - CHIP_ERROR TestWriteTheDefaultValuesToMandatoryGlobalAttributeClusterRevision_0() + CHIP_ERROR TestMediaPlaybackPlayCommand_0() { - chip::Controller::RelativeHumidityMeasurementClusterTest cluster; - cluster.Associate(mDevice, 1); - - uint16_t clusterRevisionArgument = 1U; + chip::Controller::MediaPlaybackClusterTest cluster; + cluster.Associate(mDevice, 3); - return cluster.WriteAttributeClusterRevision(mOnSuccessCallback_0.Cancel(), mOnFailureCallback_0.Cancel(), - clusterRevisionArgument); + return cluster.MediaPlay(mOnSuccessCallback_0.Cancel(), mOnFailureCallback_0.Cancel()); } - void OnFailureResponse_0(uint8_t status) { NextTest(); } - - void OnSuccessResponse_0(uint16_t clusterRevision) { ThrowSuccessResponse(); } -}; - -class Test_TC_TSTAT_1_1 : public TestCommand -{ -public: - Test_TC_TSTAT_1_1() : TestCommand("Test_TC_TSTAT_1_1"), mTestIndex(0) {} + void OnFailureResponse_0(uint8_t status) { ThrowFailureResponse(); } - /////////// TestCommand Interface ///////// - void NextTest() override + void OnSuccessResponse_0(uint8_t mediaPlaybackStatus) { - CHIP_ERROR err = CHIP_NO_ERROR; + VerifyOrReturn(CheckValue("mediaPlaybackStatus", mediaPlaybackStatus, 0)); + NextTest(); + } - if (0 == mTestIndex) - { - ChipLogProgress(chipTool, " **** Test Start: Test_TC_TSTAT_1_1\n"); - } + CHIP_ERROR TestMediaPlaybackPauseCommand_1() + { + chip::Controller::MediaPlaybackClusterTest cluster; + cluster.Associate(mDevice, 3); - if (mTestCount == mTestIndex) - { - ChipLogProgress(chipTool, " **** Test Complete: Test_TC_TSTAT_1_1\n"); - SetCommandExitStatus(CHIP_NO_ERROR); - return; - } + return cluster.MediaPause(mOnSuccessCallback_1.Cancel(), mOnFailureCallback_1.Cancel()); + } - // Ensure we increment mTestIndex before we start running the relevant - // command. That way if we lose the timeslice after we send the message - // but before our function call returns, we won't end up with an - // incorrect mTestIndex value observed when we get the response. - switch (mTestIndex++) - { - case 0: - ChipLogProgress(chipTool, - " ***** Test Step 0 : write the default values to mandatory global attribute: ClusterRevision\n"); - err = TestWriteTheDefaultValuesToMandatoryGlobalAttributeClusterRevision_0(); - break; - } + void OnFailureResponse_1(uint8_t status) { ThrowFailureResponse(); } - if (CHIP_NO_ERROR != err) - { - ChipLogError(chipTool, " ***** Test Failure: %s\n", chip::ErrorStr(err)); - SetCommandExitStatus(err); - } + void OnSuccessResponse_1(uint8_t mediaPlaybackStatus) + { + VerifyOrReturn(CheckValue("mediaPlaybackStatus", mediaPlaybackStatus, 0)); + NextTest(); } -private: - std::atomic_uint16_t mTestIndex; - const uint16_t mTestCount = 1; + CHIP_ERROR TestMediaPlaybackStopCommand_2() + { + chip::Controller::MediaPlaybackClusterTest cluster; + cluster.Associate(mDevice, 3); - chip::Callback::Callback mOnFailureCallback_0{ OnFailureCallback_0, this }; - chip::Callback::Callback mOnSuccessCallback_0{ OnSuccessCallback_0, this }; + return cluster.MediaStop(mOnSuccessCallback_2.Cancel(), mOnFailureCallback_2.Cancel()); + } - static void OnFailureCallback_0(void * context, uint8_t status) + void OnFailureResponse_2(uint8_t status) { ThrowFailureResponse(); } + + void OnSuccessResponse_2(uint8_t mediaPlaybackStatus) { - (static_cast(context))->OnFailureResponse_0(status); + VerifyOrReturn(CheckValue("mediaPlaybackStatus", mediaPlaybackStatus, 0)); + NextTest(); } - static void OnSuccessCallback_0(void * context, uint16_t clusterRevision) + CHIP_ERROR TestMediaPlaybackStartOverCommand_3() { - (static_cast(context))->OnSuccessResponse_0(clusterRevision); + chip::Controller::MediaPlaybackClusterTest cluster; + cluster.Associate(mDevice, 3); + + return cluster.MediaStartOver(mOnSuccessCallback_3.Cancel(), mOnFailureCallback_3.Cancel()); } - // - // Tests methods - // + void OnFailureResponse_3(uint8_t status) { ThrowFailureResponse(); } - CHIP_ERROR TestWriteTheDefaultValuesToMandatoryGlobalAttributeClusterRevision_0() + void OnSuccessResponse_3(uint8_t mediaPlaybackStatus) { - chip::Controller::ThermostatClusterTest cluster; - cluster.Associate(mDevice, 1); - - uint16_t clusterRevisionArgument = 5U; - - return cluster.WriteAttributeClusterRevision(mOnSuccessCallback_0.Cancel(), mOnFailureCallback_0.Cancel(), - clusterRevisionArgument); + VerifyOrReturn(CheckValue("mediaPlaybackStatus", mediaPlaybackStatus, 0)); + NextTest(); } - void OnFailureResponse_0(uint8_t status) { NextTest(); } + CHIP_ERROR TestMediaPlaybackPreviousCommand_4() + { + chip::Controller::MediaPlaybackClusterTest cluster; + cluster.Associate(mDevice, 3); - void OnSuccessResponse_0(uint16_t clusterRevision) { ThrowSuccessResponse(); } -}; + return cluster.MediaPrevious(mOnSuccessCallback_4.Cancel(), mOnFailureCallback_4.Cancel()); + } -class Test_TC_PCC_1_1 : public TestCommand -{ -public: - Test_TC_PCC_1_1() : TestCommand("Test_TC_PCC_1_1"), mTestIndex(0) {} + void OnFailureResponse_4(uint8_t status) { ThrowFailureResponse(); } - /////////// TestCommand Interface ///////// - void NextTest() override + void OnSuccessResponse_4(uint8_t mediaPlaybackStatus) { - CHIP_ERROR err = CHIP_NO_ERROR; - - if (0 == mTestIndex) - { - ChipLogProgress(chipTool, " **** Test Start: Test_TC_PCC_1_1\n"); - } - - if (mTestCount == mTestIndex) - { - ChipLogProgress(chipTool, " **** Test Complete: Test_TC_PCC_1_1\n"); - SetCommandExitStatus(CHIP_NO_ERROR); - return; - } + VerifyOrReturn(CheckValue("mediaPlaybackStatus", mediaPlaybackStatus, 0)); + NextTest(); + } - // Ensure we increment mTestIndex before we start running the relevant - // command. That way if we lose the timeslice after we send the message - // but before our function call returns, we won't end up with an - // incorrect mTestIndex value observed when we get the response. - switch (mTestIndex++) - { - case 0: - ChipLogProgress(chipTool, - " ***** Test Step 0 : write the default values to mandatory global attribute: ClusterRevision\n"); - err = TestWriteTheDefaultValuesToMandatoryGlobalAttributeClusterRevision_0(); - break; - } + CHIP_ERROR TestMediaPlaybackNextCommand_5() + { + chip::Controller::MediaPlaybackClusterTest cluster; + cluster.Associate(mDevice, 3); - if (CHIP_NO_ERROR != err) - { - ChipLogError(chipTool, " ***** Test Failure: %s\n", chip::ErrorStr(err)); - SetCommandExitStatus(err); - } + return cluster.MediaNext(mOnSuccessCallback_5.Cancel(), mOnFailureCallback_5.Cancel()); } -private: - std::atomic_uint16_t mTestIndex; - const uint16_t mTestCount = 1; - - chip::Callback::Callback mOnFailureCallback_0{ OnFailureCallback_0, this }; - chip::Callback::Callback mOnSuccessCallback_0{ OnSuccessCallback_0, this }; + void OnFailureResponse_5(uint8_t status) { ThrowFailureResponse(); } - static void OnFailureCallback_0(void * context, uint8_t status) + void OnSuccessResponse_5(uint8_t mediaPlaybackStatus) { - (static_cast(context))->OnFailureResponse_0(status); + VerifyOrReturn(CheckValue("mediaPlaybackStatus", mediaPlaybackStatus, 0)); + NextTest(); } - static void OnSuccessCallback_0(void * context, uint16_t clusterRevision) + CHIP_ERROR TestMediaPlaybackRewindCommand_6() { - (static_cast(context))->OnSuccessResponse_0(clusterRevision); + chip::Controller::MediaPlaybackClusterTest cluster; + cluster.Associate(mDevice, 3); + + return cluster.MediaRewind(mOnSuccessCallback_6.Cancel(), mOnFailureCallback_6.Cancel()); } - // - // Tests methods - // + void OnFailureResponse_6(uint8_t status) { ThrowFailureResponse(); } - CHIP_ERROR TestWriteTheDefaultValuesToMandatoryGlobalAttributeClusterRevision_0() + void OnSuccessResponse_6(uint8_t mediaPlaybackStatus) { - chip::Controller::PumpConfigurationAndControlClusterTest cluster; - cluster.Associate(mDevice, 1); + VerifyOrReturn(CheckValue("mediaPlaybackStatus", mediaPlaybackStatus, 0)); + NextTest(); + } - uint16_t clusterRevisionArgument = 3U; + CHIP_ERROR TestMediaPlaybackFastForwardCommand_7() + { + chip::Controller::MediaPlaybackClusterTest cluster; + cluster.Associate(mDevice, 3); - return cluster.WriteAttributeClusterRevision(mOnSuccessCallback_0.Cancel(), mOnFailureCallback_0.Cancel(), - clusterRevisionArgument); + return cluster.MediaFastForward(mOnSuccessCallback_7.Cancel(), mOnFailureCallback_7.Cancel()); } - void OnFailureResponse_0(uint8_t status) { NextTest(); } - - void OnSuccessResponse_0(uint16_t clusterRevision) { ThrowSuccessResponse(); } -}; + void OnFailureResponse_7(uint8_t status) { ThrowFailureResponse(); } -class Test_TC_TSUIC_1_1 : public TestCommand -{ -public: - Test_TC_TSUIC_1_1() : TestCommand("Test_TC_TSUIC_1_1"), mTestIndex(0) {} + void OnSuccessResponse_7(uint8_t mediaPlaybackStatus) + { + VerifyOrReturn(CheckValue("mediaPlaybackStatus", mediaPlaybackStatus, 0)); + NextTest(); + } - /////////// TestCommand Interface ///////// - void NextTest() override + CHIP_ERROR TestMediaPlaybackSkipForwardCommand_8() { - CHIP_ERROR err = CHIP_NO_ERROR; + chip::Controller::MediaPlaybackClusterTest cluster; + cluster.Associate(mDevice, 3); - if (0 == mTestIndex) - { - ChipLogProgress(chipTool, " **** Test Start: Test_TC_TSUIC_1_1\n"); - } + uint64_t deltaPositionMillisecondsArgument = 100ULL; - if (mTestCount == mTestIndex) - { - ChipLogProgress(chipTool, " **** Test Complete: Test_TC_TSUIC_1_1\n"); - SetCommandExitStatus(CHIP_NO_ERROR); - return; - } + return cluster.MediaSkipForward(mOnSuccessCallback_8.Cancel(), mOnFailureCallback_8.Cancel(), + deltaPositionMillisecondsArgument); + } - // Ensure we increment mTestIndex before we start running the relevant - // command. That way if we lose the timeslice after we send the message - // but before our function call returns, we won't end up with an - // incorrect mTestIndex value observed when we get the response. - switch (mTestIndex++) - { - case 0: - ChipLogProgress(chipTool, - " ***** Test Step 0 : write the default values to mandatory global attribute: ClusterRevision\n"); - err = TestWriteTheDefaultValuesToMandatoryGlobalAttributeClusterRevision_0(); - break; - } + void OnFailureResponse_8(uint8_t status) { ThrowFailureResponse(); } - if (CHIP_NO_ERROR != err) - { - ChipLogError(chipTool, " ***** Test Failure: %s\n", chip::ErrorStr(err)); - SetCommandExitStatus(err); - } + void OnSuccessResponse_8(uint8_t mediaPlaybackStatus) + { + VerifyOrReturn(CheckValue("mediaPlaybackStatus", mediaPlaybackStatus, 0)); + NextTest(); } -private: - std::atomic_uint16_t mTestIndex; - const uint16_t mTestCount = 1; + CHIP_ERROR TestMediaPlaybackSkipBackwardCommand_9() + { + chip::Controller::MediaPlaybackClusterTest cluster; + cluster.Associate(mDevice, 3); - chip::Callback::Callback mOnFailureCallback_0{ OnFailureCallback_0, this }; - chip::Callback::Callback mOnSuccessCallback_0{ OnSuccessCallback_0, this }; + uint64_t deltaPositionMillisecondsArgument = 100ULL; - static void OnFailureCallback_0(void * context, uint8_t status) - { - (static_cast(context))->OnFailureResponse_0(status); + return cluster.MediaSkipBackward(mOnSuccessCallback_9.Cancel(), mOnFailureCallback_9.Cancel(), + deltaPositionMillisecondsArgument); } - static void OnSuccessCallback_0(void * context, uint16_t clusterRevision) + void OnFailureResponse_9(uint8_t status) { ThrowFailureResponse(); } + + void OnSuccessResponse_9(uint8_t mediaPlaybackStatus) { - (static_cast(context))->OnSuccessResponse_0(clusterRevision); + VerifyOrReturn(CheckValue("mediaPlaybackStatus", mediaPlaybackStatus, 0)); + NextTest(); } - // - // Tests methods - // - - CHIP_ERROR TestWriteTheDefaultValuesToMandatoryGlobalAttributeClusterRevision_0() + CHIP_ERROR TestMediaPlaybackSeekCommand_10() { - chip::Controller::ThermostatUserInterfaceConfigurationClusterTest cluster; - cluster.Associate(mDevice, 1); + chip::Controller::MediaPlaybackClusterTest cluster; + cluster.Associate(mDevice, 3); - uint16_t clusterRevisionArgument = 2U; + uint64_t positionArgument = 100ULL; - return cluster.WriteAttributeClusterRevision(mOnSuccessCallback_0.Cancel(), mOnFailureCallback_0.Cancel(), - clusterRevisionArgument); + return cluster.MediaSeek(mOnSuccessCallback_10.Cancel(), mOnFailureCallback_10.Cancel(), positionArgument); } - void OnFailureResponse_0(uint8_t status) { NextTest(); } + void OnFailureResponse_10(uint8_t status) { ThrowFailureResponse(); } - void OnSuccessResponse_0(uint16_t clusterRevision) { ThrowSuccessResponse(); } + void OnSuccessResponse_10(uint8_t mediaPlaybackStatus) + { + VerifyOrReturn(CheckValue("mediaPlaybackStatus", mediaPlaybackStatus, 0)); + NextTest(); + } }; -class Test_TC_DIAGTH_1_1 : public TestCommand +class TV_TvChannelCluster : public TestCommand { public: - Test_TC_DIAGTH_1_1() : TestCommand("Test_TC_DIAGTH_1_1"), mTestIndex(0) {} + TV_TvChannelCluster() : TestCommand("TV_TvChannelCluster"), mTestIndex(0) {} /////////// TestCommand Interface ///////// void NextTest() override @@ -10216,12 +10587,12 @@ class Test_TC_DIAGTH_1_1 : public TestCommand if (0 == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Start: Test_TC_DIAGTH_1_1\n"); + ChipLogProgress(chipTool, " **** Test Start: TV_TvChannelCluster\n"); } if (mTestCount == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Complete: Test_TC_DIAGTH_1_1\n"); + ChipLogProgress(chipTool, " **** Test Complete: TV_TvChannelCluster\n"); SetCommandExitStatus(CHIP_NO_ERROR); return; } @@ -10233,17 +10604,16 @@ class Test_TC_DIAGTH_1_1 : public TestCommand switch (mTestIndex++) { case 0: - ChipLogProgress(chipTool, " ***** Test Step 0 : read the global attribute: ClusterRevision\n"); - err = TestReadTheGlobalAttributeClusterRevision_0(); + ChipLogProgress(chipTool, " ***** Test Step 0 : Read attribute TV Channel list\n"); + err = TestReadAttributeTvChannelList_0(); break; case 1: - ChipLogProgress(chipTool, - " ***** Test Step 1 : write the default values to mandatory global attribute: ClusterRevision\n"); - err = TestWriteTheDefaultValuesToMandatoryGlobalAttributeClusterRevision_1(); + ChipLogProgress(chipTool, " ***** Test Step 1 : Change Channel By Number Command\n"); + err = TestChangeChannelByNumberCommand_1(); break; case 2: - ChipLogProgress(chipTool, " ***** Test Step 2 : reads back global attribute: ClusterRevision\n"); - err = TestReadsBackGlobalAttributeClusterRevision_2(); + ChipLogProgress(chipTool, " ***** Test Step 2 : Skip Channel Command\n"); + err = TestSkipChannelCommand_2(); break; } @@ -10259,98 +10629,93 @@ class Test_TC_DIAGTH_1_1 : public TestCommand const uint16_t mTestCount = 3; chip::Callback::Callback mOnFailureCallback_0{ OnFailureCallback_0, this }; - chip::Callback::Callback mOnSuccessCallback_0{ OnSuccessCallback_0, this }; + chip::Callback::Callback mOnSuccessCallback_0{ + OnSuccessCallback_0, this + }; chip::Callback::Callback mOnFailureCallback_1{ OnFailureCallback_1, this }; - chip::Callback::Callback mOnSuccessCallback_1{ OnSuccessCallback_1, this }; + chip::Callback::Callback mOnSuccessCallback_1{ OnSuccessCallback_1, this }; chip::Callback::Callback mOnFailureCallback_2{ OnFailureCallback_2, this }; - chip::Callback::Callback mOnSuccessCallback_2{ OnSuccessCallback_2, this }; + chip::Callback::Callback mOnSuccessCallback_2{ OnSuccessCallback_2, this }; static void OnFailureCallback_0(void * context, uint8_t status) { - (static_cast(context))->OnFailureResponse_0(status); + (static_cast(context))->OnFailureResponse_0(status); } - static void OnSuccessCallback_0(void * context, uint16_t clusterRevision) + static void OnSuccessCallback_0(void * context, uint16_t count, _TvChannelInfo * tvChannelList) { - (static_cast(context))->OnSuccessResponse_0(clusterRevision); + (static_cast(context))->OnSuccessResponse_0(count, tvChannelList); } static void OnFailureCallback_1(void * context, uint8_t status) { - (static_cast(context))->OnFailureResponse_1(status); - } - - static void OnSuccessCallback_1(void * context, uint16_t clusterRevision) - { - (static_cast(context))->OnSuccessResponse_1(clusterRevision); + (static_cast(context))->OnFailureResponse_1(status); } - static void OnFailureCallback_2(void * context, uint8_t status) - { - (static_cast(context))->OnFailureResponse_2(status); - } + static void OnSuccessCallback_1(void * context) { (static_cast(context))->OnSuccessResponse_1(); } - static void OnSuccessCallback_2(void * context, uint16_t clusterRevision) + static void OnFailureCallback_2(void * context, uint8_t status) { - (static_cast(context))->OnSuccessResponse_2(clusterRevision); + (static_cast(context))->OnFailureResponse_2(status); } + static void OnSuccessCallback_2(void * context) { (static_cast(context))->OnSuccessResponse_2(); } + // // Tests methods // - CHIP_ERROR TestReadTheGlobalAttributeClusterRevision_0() + CHIP_ERROR TestReadAttributeTvChannelList_0() { - chip::Controller::ThreadNetworkDiagnosticsClusterTest cluster; - cluster.Associate(mDevice, 0); + chip::Controller::TvChannelClusterTest cluster; + cluster.Associate(mDevice, 1); - return cluster.ReadAttributeClusterRevision(mOnSuccessCallback_0.Cancel(), mOnFailureCallback_0.Cancel()); + return cluster.ReadAttributeTvChannelList(mOnSuccessCallback_0.Cancel(), mOnFailureCallback_0.Cancel()); } void OnFailureResponse_0(uint8_t status) { ThrowFailureResponse(); } - void OnSuccessResponse_0(uint16_t clusterRevision) + void OnSuccessResponse_0(uint16_t count, _TvChannelInfo * tvChannelList) { - VerifyOrReturn(CheckValue("clusterRevision", clusterRevision, 1U)); + VerifyOrReturn(CheckValueAsList("tvChannelList", count, 2)); NextTest(); } - CHIP_ERROR TestWriteTheDefaultValuesToMandatoryGlobalAttributeClusterRevision_1() + CHIP_ERROR TestChangeChannelByNumberCommand_1() { - chip::Controller::ThreadNetworkDiagnosticsClusterTest cluster; - cluster.Associate(mDevice, 0); + chip::Controller::TvChannelClusterTest cluster; + cluster.Associate(mDevice, 1); - uint16_t clusterRevisionArgument = 1U; + uint16_t majorNumberArgument = 1U; + uint16_t minorNumberArgument = 2U; - return cluster.WriteAttributeClusterRevision(mOnSuccessCallback_1.Cancel(), mOnFailureCallback_1.Cancel(), - clusterRevisionArgument); + return cluster.ChangeChannelByNumber(mOnSuccessCallback_1.Cancel(), mOnFailureCallback_1.Cancel(), majorNumberArgument, + minorNumberArgument); } - void OnFailureResponse_1(uint8_t status) { NextTest(); } + void OnFailureResponse_1(uint8_t status) { ThrowFailureResponse(); } - void OnSuccessResponse_1(uint16_t clusterRevision) { ThrowSuccessResponse(); } + void OnSuccessResponse_1() { NextTest(); } - CHIP_ERROR TestReadsBackGlobalAttributeClusterRevision_2() + CHIP_ERROR TestSkipChannelCommand_2() { - chip::Controller::ThreadNetworkDiagnosticsClusterTest cluster; - cluster.Associate(mDevice, 0); + chip::Controller::TvChannelClusterTest cluster; + cluster.Associate(mDevice, 1); - return cluster.ReadAttributeClusterRevision(mOnSuccessCallback_2.Cancel(), mOnFailureCallback_2.Cancel()); + uint16_t countArgument = 1U; + + return cluster.SkipChannel(mOnSuccessCallback_2.Cancel(), mOnFailureCallback_2.Cancel(), countArgument); } void OnFailureResponse_2(uint8_t status) { ThrowFailureResponse(); } - void OnSuccessResponse_2(uint16_t clusterRevision) - { - VerifyOrReturn(CheckValue("clusterRevision", clusterRevision, 1U)); - NextTest(); - } + void OnSuccessResponse_2() { NextTest(); } }; -class Test_TC_TM_2_1 : public TestCommand +class TV_LowPowerCluster : public TestCommand { public: - Test_TC_TM_2_1() : TestCommand("Test_TC_TM_2_1"), mTestIndex(0) {} + TV_LowPowerCluster() : TestCommand("TV_LowPowerCluster"), mTestIndex(0) {} /////////// TestCommand Interface ///////// void NextTest() override @@ -10359,12 +10724,12 @@ class Test_TC_TM_2_1 : public TestCommand if (0 == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Start: Test_TC_TM_2_1\n"); + ChipLogProgress(chipTool, " **** Test Start: TV_LowPowerCluster\n"); } if (mTestCount == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Complete: Test_TC_TM_2_1\n"); + ChipLogProgress(chipTool, " **** Test Complete: TV_LowPowerCluster\n"); SetCommandExitStatus(CHIP_NO_ERROR); return; } @@ -10376,8 +10741,8 @@ class Test_TC_TM_2_1 : public TestCommand switch (mTestIndex++) { case 0: - ChipLogProgress(chipTool, " ***** Test Step 0 : read the mandatory attribute: MeasuredValue\n"); - err = TestReadTheMandatoryAttributeMeasuredValue_0(); + ChipLogProgress(chipTool, " ***** Test Step 0 : Sleep Input Status Command\n"); + err = TestSleepInputStatusCommand_0(); break; } @@ -10393,43 +10758,36 @@ class Test_TC_TM_2_1 : public TestCommand const uint16_t mTestCount = 1; chip::Callback::Callback mOnFailureCallback_0{ OnFailureCallback_0, this }; - chip::Callback::Callback mOnSuccessCallback_0{ OnSuccessCallback_0, this }; + chip::Callback::Callback mOnSuccessCallback_0{ OnSuccessCallback_0, this }; static void OnFailureCallback_0(void * context, uint8_t status) { - (static_cast(context))->OnFailureResponse_0(status); + (static_cast(context))->OnFailureResponse_0(status); } - static void OnSuccessCallback_0(void * context, int16_t measuredValue) - { - (static_cast(context))->OnSuccessResponse_0(measuredValue); - } + static void OnSuccessCallback_0(void * context) { (static_cast(context))->OnSuccessResponse_0(); } // // Tests methods // - CHIP_ERROR TestReadTheMandatoryAttributeMeasuredValue_0() + CHIP_ERROR TestSleepInputStatusCommand_0() { - chip::Controller::TemperatureMeasurementClusterTest cluster; + chip::Controller::LowPowerClusterTest cluster; cluster.Associate(mDevice, 1); - return cluster.ReadAttributeMeasuredValue(mOnSuccessCallback_0.Cancel(), mOnFailureCallback_0.Cancel()); + return cluster.Sleep(mOnSuccessCallback_0.Cancel(), mOnFailureCallback_0.Cancel()); } void OnFailureResponse_0(uint8_t status) { ThrowFailureResponse(); } - void OnSuccessResponse_0(int16_t measuredValue) - { - VerifyOrReturn(CheckConstraintType("measuredValue", "", "int16")); - NextTest(); - } + void OnSuccessResponse_0() { NextTest(); } }; -class Test_TC_TSUIC_2_1 : public TestCommand +class TV_MediaInputCluster : public TestCommand { public: - Test_TC_TSUIC_2_1() : TestCommand("Test_TC_TSUIC_2_1"), mTestIndex(0) {} + TV_MediaInputCluster() : TestCommand("TV_MediaInputCluster"), mTestIndex(0) {} /////////// TestCommand Interface ///////// void NextTest() override @@ -10438,12 +10796,12 @@ class Test_TC_TSUIC_2_1 : public TestCommand if (0 == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Start: Test_TC_TSUIC_2_1\n"); + ChipLogProgress(chipTool, " **** Test Start: TV_MediaInputCluster\n"); } if (mTestCount == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Complete: Test_TC_TSUIC_2_1\n"); + ChipLogProgress(chipTool, " **** Test Complete: TV_MediaInputCluster\n"); SetCommandExitStatus(CHIP_NO_ERROR); return; } @@ -10455,64 +10813,28 @@ class Test_TC_TSUIC_2_1 : public TestCommand switch (mTestIndex++) { case 0: - ChipLogProgress(chipTool, " ***** Test Step 0 : read the mandatory attribute: TemperatureDisplayMode\n"); - err = TestReadTheMandatoryAttributeTemperatureDisplayMode_0(); + ChipLogProgress(chipTool, " ***** Test Step 0 : Read attribute media input list\n"); + err = TestReadAttributeMediaInputList_0(); break; case 1: - ChipLogProgress(chipTool, " ***** Test Step 1 : read the mandatory attribute: TemperatureDisplayMode\n"); - err = TestReadTheMandatoryAttributeTemperatureDisplayMode_1(); + ChipLogProgress(chipTool, " ***** Test Step 1 : Select Input Command\n"); + err = TestSelectInputCommand_1(); break; case 2: - ChipLogProgress(chipTool, " ***** Test Step 2 : write to the mandatory attribute: TemperatureDisplayMode\n"); - err = TestWriteToTheMandatoryAttributeTemperatureDisplayMode_2(); + ChipLogProgress(chipTool, " ***** Test Step 2 : Read current input list\n"); + err = TestReadCurrentInputList_2(); break; case 3: - ChipLogProgress(chipTool, " ***** Test Step 3 : read the mandatory attribute: TemperatureDisplayMode\n"); - err = TestReadTheMandatoryAttributeTemperatureDisplayMode_3(); + ChipLogProgress(chipTool, " ***** Test Step 3 : Hide Input Status Command\n"); + err = TestHideInputStatusCommand_3(); break; case 4: - ChipLogProgress(chipTool, " ***** Test Step 4 : read the mandatory attribute: TemperatureDisplayMode\n"); - err = TestReadTheMandatoryAttributeTemperatureDisplayMode_4(); + ChipLogProgress(chipTool, " ***** Test Step 4 : Show Input Status Command\n"); + err = TestShowInputStatusCommand_4(); break; case 5: - ChipLogProgress(chipTool, " ***** Test Step 5 : read the mandatory attribute: KeypadLockout\n"); - err = TestReadTheMandatoryAttributeKeypadLockout_5(); - break; - case 6: - ChipLogProgress(chipTool, " ***** Test Step 6 : read the mandatory attribute: KeypadLockout\n"); - err = TestReadTheMandatoryAttributeKeypadLockout_6(); - break; - case 7: - ChipLogProgress(chipTool, " ***** Test Step 7 : write to the mandatory attribute: KeypadLockout\n"); - err = TestWriteToTheMandatoryAttributeKeypadLockout_7(); - break; - case 8: - ChipLogProgress(chipTool, " ***** Test Step 8 : read the mandatory attribute: KeypadLockout\n"); - err = TestReadTheMandatoryAttributeKeypadLockout_8(); - break; - case 9: - ChipLogProgress(chipTool, " ***** Test Step 9 : read the mandatory attribute: KeypadLockout\n"); - err = TestReadTheMandatoryAttributeKeypadLockout_9(); - break; - case 10: - ChipLogProgress(chipTool, " ***** Test Step 10 : read the optional attribute: ScheduleProgrammingVisibility\n"); - err = TestReadTheOptionalAttributeScheduleProgrammingVisibility_10(); - break; - case 11: - ChipLogProgress(chipTool, " ***** Test Step 11 : read the optional attribute: ScheduleProgrammingVisibility\n"); - err = TestReadTheOptionalAttributeScheduleProgrammingVisibility_11(); - break; - case 12: - ChipLogProgress(chipTool, " ***** Test Step 12 : write to the mandatory attribute: ScheduleProgrammingVisibility\n"); - err = TestWriteToTheMandatoryAttributeScheduleProgrammingVisibility_12(); - break; - case 13: - ChipLogProgress(chipTool, " ***** Test Step 13 : read the optional attribute: ScheduleProgrammingVisibility\n"); - err = TestReadTheOptionalAttributeScheduleProgrammingVisibility_13(); - break; - case 14: - ChipLogProgress(chipTool, " ***** Test Step 14 : read the optional attribute: ScheduleProgrammingVisibility\n"); - err = TestReadTheOptionalAttributeScheduleProgrammingVisibility_14(); + ChipLogProgress(chipTool, " ***** Test Step 5 : Rename Input Command\n"); + err = TestRenameInputCommand_5(); break; } @@ -10525,450 +10847,435 @@ class Test_TC_TSUIC_2_1 : public TestCommand private: std::atomic_uint16_t mTestIndex; - const uint16_t mTestCount = 15; + const uint16_t mTestCount = 6; chip::Callback::Callback mOnFailureCallback_0{ OnFailureCallback_0, this }; - chip::Callback::Callback mOnSuccessCallback_0{ OnSuccessCallback_0, - this }; + chip::Callback::Callback mOnSuccessCallback_0{ + OnSuccessCallback_0, this + }; chip::Callback::Callback mOnFailureCallback_1{ OnFailureCallback_1, this }; - chip::Callback::Callback mOnSuccessCallback_1{ OnSuccessCallback_1, - this }; + chip::Callback::Callback mOnSuccessCallback_1{ OnSuccessCallback_1, this }; chip::Callback::Callback mOnFailureCallback_2{ OnFailureCallback_2, this }; - chip::Callback::Callback mOnSuccessCallback_2{ OnSuccessCallback_2, - this }; + chip::Callback::Callback mOnSuccessCallback_2{ OnSuccessCallback_2, this }; chip::Callback::Callback mOnFailureCallback_3{ OnFailureCallback_3, this }; - chip::Callback::Callback mOnSuccessCallback_3{ OnSuccessCallback_3, - this }; + chip::Callback::Callback mOnSuccessCallback_3{ OnSuccessCallback_3, this }; chip::Callback::Callback mOnFailureCallback_4{ OnFailureCallback_4, this }; - chip::Callback::Callback mOnSuccessCallback_4{ OnSuccessCallback_4, - this }; - chip::Callback::Callback mOnFailureCallback_5{ OnFailureCallback_5, this }; - chip::Callback::Callback mOnSuccessCallback_5{ OnSuccessCallback_5, this }; - chip::Callback::Callback mOnFailureCallback_6{ OnFailureCallback_6, this }; - chip::Callback::Callback mOnSuccessCallback_6{ OnSuccessCallback_6, this }; - chip::Callback::Callback mOnFailureCallback_7{ OnFailureCallback_7, this }; - chip::Callback::Callback mOnSuccessCallback_7{ OnSuccessCallback_7, this }; - chip::Callback::Callback mOnFailureCallback_8{ OnFailureCallback_8, this }; - chip::Callback::Callback mOnSuccessCallback_8{ OnSuccessCallback_8, this }; - chip::Callback::Callback mOnFailureCallback_9{ OnFailureCallback_9, this }; - chip::Callback::Callback mOnSuccessCallback_9{ OnSuccessCallback_9, this }; - chip::Callback::Callback mOnFailureCallback_10{ OnFailureCallback_10, this }; - chip::Callback::Callback mOnSuccessCallback_10{ - OnSuccessCallback_10, this - }; - chip::Callback::Callback mOnFailureCallback_11{ OnFailureCallback_11, this }; - chip::Callback::Callback mOnSuccessCallback_11{ - OnSuccessCallback_11, this - }; - chip::Callback::Callback mOnFailureCallback_12{ OnFailureCallback_12, this }; - chip::Callback::Callback mOnSuccessCallback_12{ - OnSuccessCallback_12, this - }; - chip::Callback::Callback mOnFailureCallback_13{ OnFailureCallback_13, this }; - chip::Callback::Callback mOnSuccessCallback_13{ - OnSuccessCallback_13, this - }; - chip::Callback::Callback mOnFailureCallback_14{ OnFailureCallback_14, this }; - chip::Callback::Callback mOnSuccessCallback_14{ - OnSuccessCallback_14, this - }; - - static void OnFailureCallback_0(void * context, uint8_t status) - { - (static_cast(context))->OnFailureResponse_0(status); - } - - static void OnSuccessCallback_0(void * context, uint8_t temperatureDisplayMode) - { - (static_cast(context))->OnSuccessResponse_0(temperatureDisplayMode); - } - - static void OnFailureCallback_1(void * context, uint8_t status) - { - (static_cast(context))->OnFailureResponse_1(status); - } - - static void OnSuccessCallback_1(void * context, uint8_t temperatureDisplayMode) - { - (static_cast(context))->OnSuccessResponse_1(temperatureDisplayMode); - } - - static void OnFailureCallback_2(void * context, uint8_t status) - { - (static_cast(context))->OnFailureResponse_2(status); - } - - static void OnSuccessCallback_2(void * context, uint8_t temperatureDisplayMode) - { - (static_cast(context))->OnSuccessResponse_2(temperatureDisplayMode); - } - - static void OnFailureCallback_3(void * context, uint8_t status) - { - (static_cast(context))->OnFailureResponse_3(status); - } - - static void OnSuccessCallback_3(void * context, uint8_t temperatureDisplayMode) - { - (static_cast(context))->OnSuccessResponse_3(temperatureDisplayMode); - } - - static void OnFailureCallback_4(void * context, uint8_t status) - { - (static_cast(context))->OnFailureResponse_4(status); - } - - static void OnSuccessCallback_4(void * context, uint8_t temperatureDisplayMode) - { - (static_cast(context))->OnSuccessResponse_4(temperatureDisplayMode); - } - - static void OnFailureCallback_5(void * context, uint8_t status) - { - (static_cast(context))->OnFailureResponse_5(status); - } + chip::Callback::Callback mOnSuccessCallback_4{ OnSuccessCallback_4, this }; + chip::Callback::Callback mOnFailureCallback_5{ OnFailureCallback_5, this }; + chip::Callback::Callback mOnSuccessCallback_5{ OnSuccessCallback_5, this }; - static void OnSuccessCallback_5(void * context, uint8_t keypadLockout) + static void OnFailureCallback_0(void * context, uint8_t status) { - (static_cast(context))->OnSuccessResponse_5(keypadLockout); + (static_cast(context))->OnFailureResponse_0(status); } - static void OnFailureCallback_6(void * context, uint8_t status) + static void OnSuccessCallback_0(void * context, uint16_t count, _MediaInputInfo * mediaInputList) { - (static_cast(context))->OnFailureResponse_6(status); + (static_cast(context))->OnSuccessResponse_0(count, mediaInputList); } - static void OnSuccessCallback_6(void * context, uint8_t keypadLockout) + static void OnFailureCallback_1(void * context, uint8_t status) { - (static_cast(context))->OnSuccessResponse_6(keypadLockout); + (static_cast(context))->OnFailureResponse_1(status); } - static void OnFailureCallback_7(void * context, uint8_t status) - { - (static_cast(context))->OnFailureResponse_7(status); - } + static void OnSuccessCallback_1(void * context) { (static_cast(context))->OnSuccessResponse_1(); } - static void OnSuccessCallback_7(void * context, uint8_t keypadLockout) + static void OnFailureCallback_2(void * context, uint8_t status) { - (static_cast(context))->OnSuccessResponse_7(keypadLockout); + (static_cast(context))->OnFailureResponse_2(status); } - static void OnFailureCallback_8(void * context, uint8_t status) + static void OnSuccessCallback_2(void * context, uint8_t currentMediaInput) { - (static_cast(context))->OnFailureResponse_8(status); + (static_cast(context))->OnSuccessResponse_2(currentMediaInput); } - static void OnSuccessCallback_8(void * context, uint8_t keypadLockout) + static void OnFailureCallback_3(void * context, uint8_t status) { - (static_cast(context))->OnSuccessResponse_8(keypadLockout); + (static_cast(context))->OnFailureResponse_3(status); } - static void OnFailureCallback_9(void * context, uint8_t status) - { - (static_cast(context))->OnFailureResponse_9(status); - } + static void OnSuccessCallback_3(void * context) { (static_cast(context))->OnSuccessResponse_3(); } - static void OnSuccessCallback_9(void * context, uint8_t keypadLockout) + static void OnFailureCallback_4(void * context, uint8_t status) { - (static_cast(context))->OnSuccessResponse_9(keypadLockout); + (static_cast(context))->OnFailureResponse_4(status); } - static void OnFailureCallback_10(void * context, uint8_t status) - { - (static_cast(context))->OnFailureResponse_10(status); - } + static void OnSuccessCallback_4(void * context) { (static_cast(context))->OnSuccessResponse_4(); } - static void OnSuccessCallback_10(void * context, uint8_t scheduleProgrammingVisibility) + static void OnFailureCallback_5(void * context, uint8_t status) { - (static_cast(context))->OnSuccessResponse_10(scheduleProgrammingVisibility); + (static_cast(context))->OnFailureResponse_5(status); } - static void OnFailureCallback_11(void * context, uint8_t status) - { - (static_cast(context))->OnFailureResponse_11(status); - } + static void OnSuccessCallback_5(void * context) { (static_cast(context))->OnSuccessResponse_5(); } - static void OnSuccessCallback_11(void * context, uint8_t scheduleProgrammingVisibility) - { - (static_cast(context))->OnSuccessResponse_11(scheduleProgrammingVisibility); - } + // + // Tests methods + // - static void OnFailureCallback_12(void * context, uint8_t status) + CHIP_ERROR TestReadAttributeMediaInputList_0() { - (static_cast(context))->OnFailureResponse_12(status); - } + chip::Controller::MediaInputClusterTest cluster; + cluster.Associate(mDevice, 1); - static void OnSuccessCallback_12(void * context, uint8_t scheduleProgrammingVisibility) - { - (static_cast(context))->OnSuccessResponse_12(scheduleProgrammingVisibility); + return cluster.ReadAttributeMediaInputList(mOnSuccessCallback_0.Cancel(), mOnFailureCallback_0.Cancel()); } - static void OnFailureCallback_13(void * context, uint8_t status) - { - (static_cast(context))->OnFailureResponse_13(status); - } + void OnFailureResponse_0(uint8_t status) { ThrowFailureResponse(); } - static void OnSuccessCallback_13(void * context, uint8_t scheduleProgrammingVisibility) + void OnSuccessResponse_0(uint16_t count, _MediaInputInfo * mediaInputList) { - (static_cast(context))->OnSuccessResponse_13(scheduleProgrammingVisibility); + VerifyOrReturn(CheckValueAsList("mediaInputList", count, 2)); + NextTest(); } - static void OnFailureCallback_14(void * context, uint8_t status) + CHIP_ERROR TestSelectInputCommand_1() { - (static_cast(context))->OnFailureResponse_14(status); - } + chip::Controller::MediaInputClusterTest cluster; + cluster.Associate(mDevice, 1); - static void OnSuccessCallback_14(void * context, uint8_t scheduleProgrammingVisibility) - { - (static_cast(context))->OnSuccessResponse_14(scheduleProgrammingVisibility); + uint8_t indexArgument = 1; + + return cluster.SelectInput(mOnSuccessCallback_1.Cancel(), mOnFailureCallback_1.Cancel(), indexArgument); } - // - // Tests methods - // + void OnFailureResponse_1(uint8_t status) { ThrowFailureResponse(); } - CHIP_ERROR TestReadTheMandatoryAttributeTemperatureDisplayMode_0() + void OnSuccessResponse_1() { NextTest(); } + + CHIP_ERROR TestReadCurrentInputList_2() { - chip::Controller::ThermostatUserInterfaceConfigurationClusterTest cluster; + chip::Controller::MediaInputClusterTest cluster; cluster.Associate(mDevice, 1); - return cluster.ReadAttributeTemperatureDisplayMode(mOnSuccessCallback_0.Cancel(), mOnFailureCallback_0.Cancel()); + return cluster.ReadAttributeCurrentMediaInput(mOnSuccessCallback_2.Cancel(), mOnFailureCallback_2.Cancel()); } - void OnFailureResponse_0(uint8_t status) { ThrowFailureResponse(); } + void OnFailureResponse_2(uint8_t status) { ThrowFailureResponse(); } - void OnSuccessResponse_0(uint8_t temperatureDisplayMode) + void OnSuccessResponse_2(uint8_t currentMediaInput) { - VerifyOrReturn(CheckValue("temperatureDisplayMode", temperatureDisplayMode, 0)); + VerifyOrReturn(CheckValue("currentMediaInput", currentMediaInput, 1)); NextTest(); } - CHIP_ERROR TestReadTheMandatoryAttributeTemperatureDisplayMode_1() + CHIP_ERROR TestHideInputStatusCommand_3() { - chip::Controller::ThermostatUserInterfaceConfigurationClusterTest cluster; + chip::Controller::MediaInputClusterTest cluster; cluster.Associate(mDevice, 1); - return cluster.ReadAttributeTemperatureDisplayMode(mOnSuccessCallback_1.Cancel(), mOnFailureCallback_1.Cancel()); + return cluster.HideInputStatus(mOnSuccessCallback_3.Cancel(), mOnFailureCallback_3.Cancel()); } - void OnFailureResponse_1(uint8_t status) { ThrowFailureResponse(); } + void OnFailureResponse_3(uint8_t status) { ThrowFailureResponse(); } - void OnSuccessResponse_1(uint8_t temperatureDisplayMode) + void OnSuccessResponse_3() { NextTest(); } + + CHIP_ERROR TestShowInputStatusCommand_4() { - VerifyOrReturn(CheckConstraintType("temperatureDisplayMode", "", "enum8")); - NextTest(); + chip::Controller::MediaInputClusterTest cluster; + cluster.Associate(mDevice, 1); + + return cluster.ShowInputStatus(mOnSuccessCallback_4.Cancel(), mOnFailureCallback_4.Cancel()); } - CHIP_ERROR TestWriteToTheMandatoryAttributeTemperatureDisplayMode_2() + void OnFailureResponse_4(uint8_t status) { ThrowFailureResponse(); } + + void OnSuccessResponse_4() { NextTest(); } + + CHIP_ERROR TestRenameInputCommand_5() { - chip::Controller::ThermostatUserInterfaceConfigurationClusterTest cluster; + chip::Controller::MediaInputClusterTest cluster; cluster.Associate(mDevice, 1); - uint8_t temperatureDisplayModeArgument = 0; + uint8_t indexArgument = 1; + chip::ByteSpan nameArgument = chip::ByteSpan(chip::Uint8::from_const_char("newName"), strlen("newName")); - return cluster.WriteAttributeTemperatureDisplayMode(mOnSuccessCallback_2.Cancel(), mOnFailureCallback_2.Cancel(), - temperatureDisplayModeArgument); + return cluster.RenameInput(mOnSuccessCallback_5.Cancel(), mOnFailureCallback_5.Cancel(), indexArgument, nameArgument); } - void OnFailureResponse_2(uint8_t status) { ThrowFailureResponse(); } + void OnFailureResponse_5(uint8_t status) { ThrowFailureResponse(); } - void OnSuccessResponse_2(uint8_t temperatureDisplayMode) { NextTest(); } + void OnSuccessResponse_5() { NextTest(); } +}; - CHIP_ERROR TestReadTheMandatoryAttributeTemperatureDisplayMode_3() +class TestSubscribe_OnOff : public TestCommand +{ +public: + TestSubscribe_OnOff() : TestCommand("TestSubscribe_OnOff"), mTestIndex(0) {} + + /////////// TestCommand Interface ///////// + void NextTest() override { - chip::Controller::ThermostatUserInterfaceConfigurationClusterTest cluster; - cluster.Associate(mDevice, 1); + CHIP_ERROR err = CHIP_NO_ERROR; - return cluster.ReadAttributeTemperatureDisplayMode(mOnSuccessCallback_3.Cancel(), mOnFailureCallback_3.Cancel()); + if (0 == mTestIndex) + { + ChipLogProgress(chipTool, " **** Test Start: TestSubscribe_OnOff\n"); + } + + if (mTestCount == mTestIndex) + { + ChipLogProgress(chipTool, " **** Test Complete: TestSubscribe_OnOff\n"); + SetCommandExitStatus(CHIP_NO_ERROR); + return; + } + + // Ensure we increment mTestIndex before we start running the relevant + // command. That way if we lose the timeslice after we send the message + // but before our function call returns, we won't end up with an + // incorrect mTestIndex value observed when we get the response. + switch (mTestIndex++) + { + case 0: + ChipLogProgress(chipTool, " ***** Test Step 0 : Set OnOff Attribute to false\n"); + err = TestSetOnOffAttributeToFalse_0(); + break; + case 1: + ChipLogProgress(chipTool, " ***** Test Step 1 : Report: Subscribe OnOff Attribute\n"); + err = TestReportSubscribeOnOffAttribute_1(); + break; + case 2: + ChipLogProgress(chipTool, " ***** Test Step 2 : Subscribe OnOff Attribute\n"); + err = TestSubscribeOnOffAttribute_2(); + break; + case 3: + ChipLogProgress(chipTool, " ***** Test Step 3 : Turn On the light to see attribute change\n"); + err = TestTurnOnTheLightToSeeAttributeChange_3(); + break; + case 4: + ChipLogProgress(chipTool, " ***** Test Step 4 : Check for attribute report\n"); + err = TestCheckForAttributeReport_4(); + break; + case 5: + ChipLogProgress(chipTool, " ***** Test Step 5 : Turn Off the light to see attribute change\n"); + err = TestTurnOffTheLightToSeeAttributeChange_5(); + break; + case 6: + ChipLogProgress(chipTool, " ***** Test Step 6 : Check for attribute report\n"); + err = TestCheckForAttributeReport_6(); + break; + } + + if (CHIP_NO_ERROR != err) + { + ChipLogError(chipTool, " ***** Test Failure: %s\n", chip::ErrorStr(err)); + SetCommandExitStatus(err); + } } - void OnFailureResponse_3(uint8_t status) { ThrowFailureResponse(); } +private: + std::atomic_uint16_t mTestIndex; + const uint16_t mTestCount = 7; - void OnSuccessResponse_3(uint8_t temperatureDisplayMode) + chip::Callback::Callback mOnFailureCallback_0{ OnFailureCallback_0, this }; + chip::Callback::Callback mOnSuccessCallback_0{ OnSuccessCallback_0, this }; + chip::Callback::Callback mOnFailureCallback_1{ OnFailureCallback_1, this }; + chip::Callback::Callback mOnSuccessCallback_1{ OnSuccessCallback_1, this }; + chip::Callback::Callback mOnFailureCallback_2{ OnFailureCallback_2, this }; + chip::Callback::Callback mOnSuccessCallback_2{ OnSuccessCallback_2, this }; + chip::Callback::Callback mOnFailureCallback_3{ OnFailureCallback_3, this }; + chip::Callback::Callback mOnSuccessCallback_3{ OnSuccessCallback_3, this }; + chip::Callback::Callback mOnFailureCallback_4{ OnFailureCallback_4, this }; + chip::Callback::Callback mOnSuccessCallback_4{ OnSuccessCallback_4, this }; + chip::Callback::Callback mOnFailureCallback_5{ OnFailureCallback_5, this }; + chip::Callback::Callback mOnSuccessCallback_5{ OnSuccessCallback_5, this }; + chip::Callback::Callback mOnFailureCallback_6{ OnFailureCallback_6, this }; + chip::Callback::Callback mOnSuccessCallback_6{ OnSuccessCallback_6, this }; + + static void OnFailureCallback_0(void * context, uint8_t status) { - VerifyOrReturn(CheckValue("temperatureDisplayMode", temperatureDisplayMode, 0)); - NextTest(); + (static_cast(context))->OnFailureResponse_0(status); } - CHIP_ERROR TestReadTheMandatoryAttributeTemperatureDisplayMode_4() + static void OnSuccessCallback_0(void * context) { (static_cast(context))->OnSuccessResponse_0(); } + + static void OnFailureCallback_1(void * context, uint8_t status) { - chip::Controller::ThermostatUserInterfaceConfigurationClusterTest cluster; - cluster.Associate(mDevice, 1); + (static_cast(context))->OnFailureResponse_1(status); + } - return cluster.ReadAttributeTemperatureDisplayMode(mOnSuccessCallback_4.Cancel(), mOnFailureCallback_4.Cancel()); + static void OnSuccessCallback_1(void * context, bool onOff) + { + (static_cast(context))->OnSuccessResponse_1(onOff); + } + + bool mReceivedReport_1 = false; + + static void OnFailureCallback_2(void * context, uint8_t status) + { + (static_cast(context))->OnFailureResponse_2(status); } - void OnFailureResponse_4(uint8_t status) { ThrowFailureResponse(); } - - void OnSuccessResponse_4(uint8_t temperatureDisplayMode) + static void OnSuccessCallback_2(void * context, bool onOff) { - VerifyOrReturn(CheckConstraintType("temperatureDisplayMode", "", "enum8")); - NextTest(); + (static_cast(context))->OnSuccessResponse_2(onOff); } - CHIP_ERROR TestReadTheMandatoryAttributeKeypadLockout_5() + static void OnFailureCallback_3(void * context, uint8_t status) { - chip::Controller::ThermostatUserInterfaceConfigurationClusterTest cluster; - cluster.Associate(mDevice, 1); - - return cluster.ReadAttributeKeypadLockout(mOnSuccessCallback_5.Cancel(), mOnFailureCallback_5.Cancel()); + (static_cast(context))->OnFailureResponse_3(status); } - void OnFailureResponse_5(uint8_t status) { ThrowFailureResponse(); } + static void OnSuccessCallback_3(void * context) { (static_cast(context))->OnSuccessResponse_3(); } - void OnSuccessResponse_5(uint8_t keypadLockout) + static void OnFailureCallback_4(void * context, uint8_t status) { - VerifyOrReturn(CheckValue("keypadLockout", keypadLockout, 0)); - NextTest(); + (static_cast(context))->OnFailureResponse_4(status); } - CHIP_ERROR TestReadTheMandatoryAttributeKeypadLockout_6() + static void OnSuccessCallback_4(void * context, bool onOff) { - chip::Controller::ThermostatUserInterfaceConfigurationClusterTest cluster; - cluster.Associate(mDevice, 1); - - return cluster.ReadAttributeKeypadLockout(mOnSuccessCallback_6.Cancel(), mOnFailureCallback_6.Cancel()); + (static_cast(context))->OnSuccessResponse_4(onOff); } - void OnFailureResponse_6(uint8_t status) { ThrowFailureResponse(); } + bool mReceivedReport_4 = false; - void OnSuccessResponse_6(uint8_t keypadLockout) + static void OnFailureCallback_5(void * context, uint8_t status) { - VerifyOrReturn(CheckConstraintType("keypadLockout", "", "enum8")); - NextTest(); + (static_cast(context))->OnFailureResponse_5(status); } - CHIP_ERROR TestWriteToTheMandatoryAttributeKeypadLockout_7() - { - chip::Controller::ThermostatUserInterfaceConfigurationClusterTest cluster; - cluster.Associate(mDevice, 1); + static void OnSuccessCallback_5(void * context) { (static_cast(context))->OnSuccessResponse_5(); } - uint8_t keypadLockoutArgument = 0; + static void OnFailureCallback_6(void * context, uint8_t status) + { + (static_cast(context))->OnFailureResponse_6(status); + } - return cluster.WriteAttributeKeypadLockout(mOnSuccessCallback_7.Cancel(), mOnFailureCallback_7.Cancel(), - keypadLockoutArgument); + static void OnSuccessCallback_6(void * context, bool onOff) + { + (static_cast(context))->OnSuccessResponse_6(onOff); } - void OnFailureResponse_7(uint8_t status) { ThrowFailureResponse(); } + bool mReceivedReport_6 = false; - void OnSuccessResponse_7(uint8_t keypadLockout) { NextTest(); } + // + // Tests methods + // - CHIP_ERROR TestReadTheMandatoryAttributeKeypadLockout_8() + CHIP_ERROR TestSetOnOffAttributeToFalse_0() { - chip::Controller::ThermostatUserInterfaceConfigurationClusterTest cluster; + chip::Controller::OnOffClusterTest cluster; cluster.Associate(mDevice, 1); - return cluster.ReadAttributeKeypadLockout(mOnSuccessCallback_8.Cancel(), mOnFailureCallback_8.Cancel()); + return cluster.Off(mOnSuccessCallback_0.Cancel(), mOnFailureCallback_0.Cancel()); } - void OnFailureResponse_8(uint8_t status) { ThrowFailureResponse(); } + void OnFailureResponse_0(uint8_t status) { ThrowFailureResponse(); } - void OnSuccessResponse_8(uint8_t keypadLockout) - { - VerifyOrReturn(CheckValue("keypadLockout", keypadLockout, 0)); - NextTest(); - } + void OnSuccessResponse_0() { NextTest(); } - CHIP_ERROR TestReadTheMandatoryAttributeKeypadLockout_9() + CHIP_ERROR TestReportSubscribeOnOffAttribute_1() { - chip::Controller::ThermostatUserInterfaceConfigurationClusterTest cluster; + chip::Controller::OnOffClusterTest cluster; cluster.Associate(mDevice, 1); - return cluster.ReadAttributeKeypadLockout(mOnSuccessCallback_9.Cancel(), mOnFailureCallback_9.Cancel()); + ReturnErrorOnFailure(cluster.ReportAttributeOnOff(mOnSuccessCallback_1.Cancel())); + return WaitForMs(0); } - void OnFailureResponse_9(uint8_t status) { ThrowFailureResponse(); } + void OnFailureResponse_1(uint8_t status) { ThrowFailureResponse(); } - void OnSuccessResponse_9(uint8_t keypadLockout) + void OnSuccessResponse_1(bool onOff) { - VerifyOrReturn(CheckConstraintType("keypadLockout", "", "enum8")); - NextTest(); + VerifyOrReturn(mReceivedReport_1 == false, ChipLogError(chipTool, "Not Fatal: on report called more than once.")); + mReceivedReport_1 = true; + + VerifyOrReturn(CheckValue("onOff", onOff, false)); } - CHIP_ERROR TestReadTheOptionalAttributeScheduleProgrammingVisibility_10() + CHIP_ERROR TestSubscribeOnOffAttribute_2() { - chip::Controller::ThermostatUserInterfaceConfigurationClusterTest cluster; + chip::Controller::OnOffClusterTest cluster; cluster.Associate(mDevice, 1); - return cluster.ReadAttributeScheduleProgrammingVisibility(mOnSuccessCallback_10.Cancel(), mOnFailureCallback_10.Cancel()); + uint16_t minIntervalArgument = 2U; + uint16_t maxIntervalArgument = 10U; + + return cluster.SubscribeAttributeOnOff(mOnSuccessCallback_2.Cancel(), mOnFailureCallback_2.Cancel(), minIntervalArgument, + maxIntervalArgument); } - void OnFailureResponse_10(uint8_t status) { ThrowFailureResponse(); } + void OnFailureResponse_2(uint8_t status) { ThrowFailureResponse(); } - void OnSuccessResponse_10(uint8_t scheduleProgrammingVisibility) + void OnSuccessResponse_2(bool onOff) { - VerifyOrReturn(CheckValue("scheduleProgrammingVisibility", scheduleProgrammingVisibility, 0)); + VerifyOrReturn(mReceivedReport_1, Exit("Initial report not received!")); + NextTest(); } - CHIP_ERROR TestReadTheOptionalAttributeScheduleProgrammingVisibility_11() + CHIP_ERROR TestTurnOnTheLightToSeeAttributeChange_3() { - chip::Controller::ThermostatUserInterfaceConfigurationClusterTest cluster; + chip::Controller::OnOffClusterTest cluster; cluster.Associate(mDevice, 1); - return cluster.ReadAttributeScheduleProgrammingVisibility(mOnSuccessCallback_11.Cancel(), mOnFailureCallback_11.Cancel()); + return cluster.On(mOnSuccessCallback_3.Cancel(), mOnFailureCallback_3.Cancel()); } - void OnFailureResponse_11(uint8_t status) { ThrowFailureResponse(); } + void OnFailureResponse_3(uint8_t status) { ThrowFailureResponse(); } - void OnSuccessResponse_11(uint8_t scheduleProgrammingVisibility) - { - VerifyOrReturn(CheckConstraintType("scheduleProgrammingVisibility", "", "enum8")); - NextTest(); - } + void OnSuccessResponse_3() { NextTest(); } - CHIP_ERROR TestWriteToTheMandatoryAttributeScheduleProgrammingVisibility_12() + CHIP_ERROR TestCheckForAttributeReport_4() { - chip::Controller::ThermostatUserInterfaceConfigurationClusterTest cluster; + chip::Controller::OnOffClusterTest cluster; cluster.Associate(mDevice, 1); - uint8_t scheduleProgrammingVisibilityArgument = 0; - - return cluster.WriteAttributeScheduleProgrammingVisibility(mOnSuccessCallback_12.Cancel(), mOnFailureCallback_12.Cancel(), - scheduleProgrammingVisibilityArgument); + return cluster.ReportAttributeOnOff(mOnSuccessCallback_4.Cancel()); } - void OnFailureResponse_12(uint8_t status) { ThrowFailureResponse(); } + void OnFailureResponse_4(uint8_t status) { ThrowFailureResponse(); } - void OnSuccessResponse_12(uint8_t scheduleProgrammingVisibility) { NextTest(); } + void OnSuccessResponse_4(bool onOff) + { + VerifyOrReturn(mReceivedReport_4 == false, ChipLogError(chipTool, "Not Fatal: on report called more than once.")); + mReceivedReport_4 = true; - CHIP_ERROR TestReadTheOptionalAttributeScheduleProgrammingVisibility_13() + VerifyOrReturn(CheckValue("onOff", onOff, true)); + NextTest(); + } + + CHIP_ERROR TestTurnOffTheLightToSeeAttributeChange_5() { - chip::Controller::ThermostatUserInterfaceConfigurationClusterTest cluster; + chip::Controller::OnOffClusterTest cluster; cluster.Associate(mDevice, 1); - return cluster.ReadAttributeScheduleProgrammingVisibility(mOnSuccessCallback_13.Cancel(), mOnFailureCallback_13.Cancel()); + return cluster.Off(mOnSuccessCallback_5.Cancel(), mOnFailureCallback_5.Cancel()); } - void OnFailureResponse_13(uint8_t status) { ThrowFailureResponse(); } + void OnFailureResponse_5(uint8_t status) { ThrowFailureResponse(); } - void OnSuccessResponse_13(uint8_t scheduleProgrammingVisibility) - { - VerifyOrReturn(CheckValue("scheduleProgrammingVisibility", scheduleProgrammingVisibility, 0)); - NextTest(); - } + void OnSuccessResponse_5() { NextTest(); } - CHIP_ERROR TestReadTheOptionalAttributeScheduleProgrammingVisibility_14() + CHIP_ERROR TestCheckForAttributeReport_6() { - chip::Controller::ThermostatUserInterfaceConfigurationClusterTest cluster; + chip::Controller::OnOffClusterTest cluster; cluster.Associate(mDevice, 1); - return cluster.ReadAttributeScheduleProgrammingVisibility(mOnSuccessCallback_14.Cancel(), mOnFailureCallback_14.Cancel()); + return cluster.ReportAttributeOnOff(mOnSuccessCallback_6.Cancel()); } - void OnFailureResponse_14(uint8_t status) { ThrowFailureResponse(); } + void OnFailureResponse_6(uint8_t status) { ThrowFailureResponse(); } - void OnSuccessResponse_14(uint8_t scheduleProgrammingVisibility) + void OnSuccessResponse_6(bool onOff) { - VerifyOrReturn(CheckConstraintType("scheduleProgrammingVisibility", "", "enum8")); + VerifyOrReturn(mReceivedReport_6 == false, ChipLogError(chipTool, "Not Fatal: on report called more than once.")); + mReceivedReport_6 = true; + + VerifyOrReturn(CheckValue("onOff", onOff, false)); NextTest(); } }; -class Test_TC_PCC_2_1 : public TestCommand +class TestCluster : public TestCommand { public: - Test_TC_PCC_2_1() : TestCommand("Test_TC_PCC_2_1"), mTestIndex(0) {} + TestCluster() : TestCommand("TestCluster"), mTestIndex(0) {} /////////// TestCommand Interface ///////// void NextTest() override @@ -10977,12 +11284,12 @@ class Test_TC_PCC_2_1 : public TestCommand if (0 == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Start: Test_TC_PCC_2_1\n"); + ChipLogProgress(chipTool, " **** Test Start: TestCluster\n"); } if (mTestCount == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Complete: Test_TC_PCC_2_1\n"); + ChipLogProgress(chipTool, " **** Test Complete: TestCluster\n"); SetCommandExitStatus(CHIP_NO_ERROR); return; } @@ -10994,4145 +11301,3878 @@ class Test_TC_PCC_2_1 : public TestCommand switch (mTestIndex++) { case 0: - ChipLogProgress(chipTool, " ***** Test Step 0 : read the mandatory attribute: MaxPressure\n"); - err = TestReadTheMandatoryAttributeMaxPressure_0(); + ChipLogProgress(chipTool, " ***** Test Step 0 : Send Test Command\n"); + err = TestSendTestCommand_0(); + break; + case 1: + ChipLogProgress(chipTool, " ***** Test Step 1 : Send Test Not Handled Command\n"); + err = TestSendTestNotHandledCommand_1(); + break; + case 2: + ChipLogProgress(chipTool, " ***** Test Step 2 : Send Test Specific Command\n"); + err = TestSendTestSpecificCommand_2(); + break; + case 3: + ChipLogProgress(chipTool, " ***** Test Step 3 : Send Test Add Arguments Command\n"); + err = TestSendTestAddArgumentsCommand_3(); + break; + case 4: + ChipLogProgress(chipTool, " ***** Test Step 4 : Send failing Test Add Arguments Command\n"); + err = TestSendFailingTestAddArgumentsCommand_4(); + break; + case 5: + ChipLogProgress(chipTool, " ***** Test Step 5 : Read attribute BOOLEAN Default Value\n"); + err = TestReadAttributeBooleanDefaultValue_5(); + break; + case 6: + ChipLogProgress(chipTool, " ***** Test Step 6 : Write attribute BOOLEAN True\n"); + err = TestWriteAttributeBooleanTrue_6(); + break; + case 7: + ChipLogProgress(chipTool, " ***** Test Step 7 : Read attribute BOOLEAN True\n"); + err = TestReadAttributeBooleanTrue_7(); + break; + case 8: + ChipLogProgress(chipTool, " ***** Test Step 8 : Write attribute BOOLEAN False\n"); + err = TestWriteAttributeBooleanFalse_8(); + break; + case 9: + ChipLogProgress(chipTool, " ***** Test Step 9 : Read attribute BOOLEAN False\n"); + err = TestReadAttributeBooleanFalse_9(); + break; + case 10: + ChipLogProgress(chipTool, " ***** Test Step 10 : Read attribute BITMAP8 Default Value\n"); + err = TestReadAttributeBitmap8DefaultValue_10(); + break; + case 11: + ChipLogProgress(chipTool, " ***** Test Step 11 : Write attribute BITMAP8 Max Value\n"); + err = TestWriteAttributeBitmap8MaxValue_11(); + break; + case 12: + ChipLogProgress(chipTool, " ***** Test Step 12 : Read attribute BITMAP8 Max Value\n"); + err = TestReadAttributeBitmap8MaxValue_12(); + break; + case 13: + ChipLogProgress(chipTool, " ***** Test Step 13 : Write attribute BITMAP8 Min Value\n"); + err = TestWriteAttributeBitmap8MinValue_13(); + break; + case 14: + ChipLogProgress(chipTool, " ***** Test Step 14 : Read attribute BITMAP8 Min Value\n"); + err = TestReadAttributeBitmap8MinValue_14(); + break; + case 15: + ChipLogProgress(chipTool, " ***** Test Step 15 : Read attribute BITMAP16 Default Value\n"); + err = TestReadAttributeBitmap16DefaultValue_15(); + break; + case 16: + ChipLogProgress(chipTool, " ***** Test Step 16 : Write attribute BITMAP16 Max Value\n"); + err = TestWriteAttributeBitmap16MaxValue_16(); + break; + case 17: + ChipLogProgress(chipTool, " ***** Test Step 17 : Read attribute BITMAP16 Max Value\n"); + err = TestReadAttributeBitmap16MaxValue_17(); + break; + case 18: + ChipLogProgress(chipTool, " ***** Test Step 18 : Write attribute BITMAP16 Min Value\n"); + err = TestWriteAttributeBitmap16MinValue_18(); + break; + case 19: + ChipLogProgress(chipTool, " ***** Test Step 19 : Read attribute BITMAP16 Min Value\n"); + err = TestReadAttributeBitmap16MinValue_19(); + break; + case 20: + ChipLogProgress(chipTool, " ***** Test Step 20 : Read attribute BITMAP32 Default Value\n"); + err = TestReadAttributeBitmap32DefaultValue_20(); + break; + case 21: + ChipLogProgress(chipTool, " ***** Test Step 21 : Write attribute BITMAP32 Max Value\n"); + err = TestWriteAttributeBitmap32MaxValue_21(); + break; + case 22: + ChipLogProgress(chipTool, " ***** Test Step 22 : Read attribute BITMAP32 Max Value\n"); + err = TestReadAttributeBitmap32MaxValue_22(); + break; + case 23: + ChipLogProgress(chipTool, " ***** Test Step 23 : Write attribute BITMAP32 Min Value\n"); + err = TestWriteAttributeBitmap32MinValue_23(); + break; + case 24: + ChipLogProgress(chipTool, " ***** Test Step 24 : Read attribute BITMAP32 Min Value\n"); + err = TestReadAttributeBitmap32MinValue_24(); + break; + case 25: + ChipLogProgress(chipTool, " ***** Test Step 25 : Read attribute BITMAP64 Default Value\n"); + err = TestReadAttributeBitmap64DefaultValue_25(); + break; + case 26: + ChipLogProgress(chipTool, " ***** Test Step 26 : Write attribute BITMAP64 Max Value\n"); + err = TestWriteAttributeBitmap64MaxValue_26(); + break; + case 27: + ChipLogProgress(chipTool, " ***** Test Step 27 : Read attribute BITMAP64 Max Value\n"); + err = TestReadAttributeBitmap64MaxValue_27(); + break; + case 28: + ChipLogProgress(chipTool, " ***** Test Step 28 : Write attribute BITMAP64 Min Value\n"); + err = TestWriteAttributeBitmap64MinValue_28(); + break; + case 29: + ChipLogProgress(chipTool, " ***** Test Step 29 : Read attribute BITMAP64 Min Value\n"); + err = TestReadAttributeBitmap64MinValue_29(); + break; + case 30: + ChipLogProgress(chipTool, " ***** Test Step 30 : Read attribute INT8U Default Value\n"); + err = TestReadAttributeInt8uDefaultValue_30(); + break; + case 31: + ChipLogProgress(chipTool, " ***** Test Step 31 : Write attribute INT8U Max Value\n"); + err = TestWriteAttributeInt8uMaxValue_31(); + break; + case 32: + ChipLogProgress(chipTool, " ***** Test Step 32 : Read attribute INT8U Max Value\n"); + err = TestReadAttributeInt8uMaxValue_32(); + break; + case 33: + ChipLogProgress(chipTool, " ***** Test Step 33 : Write attribute INT8U Min Value\n"); + err = TestWriteAttributeInt8uMinValue_33(); + break; + case 34: + ChipLogProgress(chipTool, " ***** Test Step 34 : Read attribute INT8U Min Value\n"); + err = TestReadAttributeInt8uMinValue_34(); + break; + case 35: + ChipLogProgress(chipTool, " ***** Test Step 35 : Read attribute INT16U Default Value\n"); + err = TestReadAttributeInt16uDefaultValue_35(); + break; + case 36: + ChipLogProgress(chipTool, " ***** Test Step 36 : Write attribute INT16U Max Value\n"); + err = TestWriteAttributeInt16uMaxValue_36(); + break; + case 37: + ChipLogProgress(chipTool, " ***** Test Step 37 : Read attribute INT16U Max Value\n"); + err = TestReadAttributeInt16uMaxValue_37(); + break; + case 38: + ChipLogProgress(chipTool, " ***** Test Step 38 : Write attribute INT16U Min Value\n"); + err = TestWriteAttributeInt16uMinValue_38(); + break; + case 39: + ChipLogProgress(chipTool, " ***** Test Step 39 : Read attribute INT16U Min Value\n"); + err = TestReadAttributeInt16uMinValue_39(); + break; + case 40: + ChipLogProgress(chipTool, " ***** Test Step 40 : Read attribute INT32U Default Value\n"); + err = TestReadAttributeInt32uDefaultValue_40(); + break; + case 41: + ChipLogProgress(chipTool, " ***** Test Step 41 : Write attribute INT32U Max Value\n"); + err = TestWriteAttributeInt32uMaxValue_41(); + break; + case 42: + ChipLogProgress(chipTool, " ***** Test Step 42 : Read attribute INT32U Max Value\n"); + err = TestReadAttributeInt32uMaxValue_42(); + break; + case 43: + ChipLogProgress(chipTool, " ***** Test Step 43 : Write attribute INT32U Min Value\n"); + err = TestWriteAttributeInt32uMinValue_43(); + break; + case 44: + ChipLogProgress(chipTool, " ***** Test Step 44 : Read attribute INT32U Min Value\n"); + err = TestReadAttributeInt32uMinValue_44(); + break; + case 45: + ChipLogProgress(chipTool, " ***** Test Step 45 : Read attribute INT64U Default Value\n"); + err = TestReadAttributeInt64uDefaultValue_45(); + break; + case 46: + ChipLogProgress(chipTool, " ***** Test Step 46 : Write attribute INT64U Max Value\n"); + err = TestWriteAttributeInt64uMaxValue_46(); + break; + case 47: + ChipLogProgress(chipTool, " ***** Test Step 47 : Read attribute INT64U Max Value\n"); + err = TestReadAttributeInt64uMaxValue_47(); + break; + case 48: + ChipLogProgress(chipTool, " ***** Test Step 48 : Write attribute INT64U Min Value\n"); + err = TestWriteAttributeInt64uMinValue_48(); + break; + case 49: + ChipLogProgress(chipTool, " ***** Test Step 49 : Read attribute INT64U Min Value\n"); + err = TestReadAttributeInt64uMinValue_49(); + break; + case 50: + ChipLogProgress(chipTool, " ***** Test Step 50 : Read attribute INT8S Default Value\n"); + err = TestReadAttributeInt8sDefaultValue_50(); + break; + case 51: + ChipLogProgress(chipTool, " ***** Test Step 51 : Write attribute INT8S Max Value\n"); + err = TestWriteAttributeInt8sMaxValue_51(); + break; + case 52: + ChipLogProgress(chipTool, " ***** Test Step 52 : Read attribute INT8S Max Value\n"); + err = TestReadAttributeInt8sMaxValue_52(); + break; + case 53: + ChipLogProgress(chipTool, " ***** Test Step 53 : Write attribute INT8S Min Value\n"); + err = TestWriteAttributeInt8sMinValue_53(); + break; + case 54: + ChipLogProgress(chipTool, " ***** Test Step 54 : Read attribute INT8S Min Value\n"); + err = TestReadAttributeInt8sMinValue_54(); + break; + case 55: + ChipLogProgress(chipTool, " ***** Test Step 55 : Write attribute INT8S Default Value\n"); + err = TestWriteAttributeInt8sDefaultValue_55(); + break; + case 56: + ChipLogProgress(chipTool, " ***** Test Step 56 : Read attribute INT8S Default Value\n"); + err = TestReadAttributeInt8sDefaultValue_56(); + break; + case 57: + ChipLogProgress(chipTool, " ***** Test Step 57 : Read attribute INT16S Default Value\n"); + err = TestReadAttributeInt16sDefaultValue_57(); + break; + case 58: + ChipLogProgress(chipTool, " ***** Test Step 58 : Write attribute INT16S Max Value\n"); + err = TestWriteAttributeInt16sMaxValue_58(); + break; + case 59: + ChipLogProgress(chipTool, " ***** Test Step 59 : Read attribute INT16S Max Value\n"); + err = TestReadAttributeInt16sMaxValue_59(); + break; + case 60: + ChipLogProgress(chipTool, " ***** Test Step 60 : Write attribute INT16S Min Value\n"); + err = TestWriteAttributeInt16sMinValue_60(); + break; + case 61: + ChipLogProgress(chipTool, " ***** Test Step 61 : Read attribute INT16S Min Value\n"); + err = TestReadAttributeInt16sMinValue_61(); + break; + case 62: + ChipLogProgress(chipTool, " ***** Test Step 62 : Write attribute INT16S Default Value\n"); + err = TestWriteAttributeInt16sDefaultValue_62(); + break; + case 63: + ChipLogProgress(chipTool, " ***** Test Step 63 : Read attribute INT16S Default Value\n"); + err = TestReadAttributeInt16sDefaultValue_63(); + break; + case 64: + ChipLogProgress(chipTool, " ***** Test Step 64 : Read attribute INT32S Default Value\n"); + err = TestReadAttributeInt32sDefaultValue_64(); + break; + case 65: + ChipLogProgress(chipTool, " ***** Test Step 65 : Write attribute INT32S Max Value\n"); + err = TestWriteAttributeInt32sMaxValue_65(); + break; + case 66: + ChipLogProgress(chipTool, " ***** Test Step 66 : Read attribute INT32S Max Value\n"); + err = TestReadAttributeInt32sMaxValue_66(); + break; + case 67: + ChipLogProgress(chipTool, " ***** Test Step 67 : Write attribute INT32S Min Value\n"); + err = TestWriteAttributeInt32sMinValue_67(); + break; + case 68: + ChipLogProgress(chipTool, " ***** Test Step 68 : Read attribute INT32S Min Value\n"); + err = TestReadAttributeInt32sMinValue_68(); + break; + case 69: + ChipLogProgress(chipTool, " ***** Test Step 69 : Write attribute INT32S Default Value\n"); + err = TestWriteAttributeInt32sDefaultValue_69(); + break; + case 70: + ChipLogProgress(chipTool, " ***** Test Step 70 : Read attribute INT32S Default Value\n"); + err = TestReadAttributeInt32sDefaultValue_70(); + break; + case 71: + ChipLogProgress(chipTool, " ***** Test Step 71 : Read attribute INT64S Default Value\n"); + err = TestReadAttributeInt64sDefaultValue_71(); + break; + case 72: + ChipLogProgress(chipTool, " ***** Test Step 72 : Write attribute INT64S Max Value\n"); + err = TestWriteAttributeInt64sMaxValue_72(); + break; + case 73: + ChipLogProgress(chipTool, " ***** Test Step 73 : Read attribute INT64S Max Value\n"); + err = TestReadAttributeInt64sMaxValue_73(); + break; + case 74: + ChipLogProgress(chipTool, " ***** Test Step 74 : Write attribute INT64S Min Value\n"); + err = TestWriteAttributeInt64sMinValue_74(); + break; + case 75: + ChipLogProgress(chipTool, " ***** Test Step 75 : Read attribute INT64S Min Value\n"); + err = TestReadAttributeInt64sMinValue_75(); + break; + case 76: + ChipLogProgress(chipTool, " ***** Test Step 76 : Write attribute INT64S Default Value\n"); + err = TestWriteAttributeInt64sDefaultValue_76(); + break; + case 77: + ChipLogProgress(chipTool, " ***** Test Step 77 : Read attribute INT64S Default Value\n"); + err = TestReadAttributeInt64sDefaultValue_77(); + break; + case 78: + ChipLogProgress(chipTool, " ***** Test Step 78 : Read attribute ENUM8 Default Value\n"); + err = TestReadAttributeEnum8DefaultValue_78(); + break; + case 79: + ChipLogProgress(chipTool, " ***** Test Step 79 : Write attribute ENUM8 Max Value\n"); + err = TestWriteAttributeEnum8MaxValue_79(); + break; + case 80: + ChipLogProgress(chipTool, " ***** Test Step 80 : Read attribute ENUM8 Max Value\n"); + err = TestReadAttributeEnum8MaxValue_80(); + break; + case 81: + ChipLogProgress(chipTool, " ***** Test Step 81 : Write attribute ENUM8 Min Value\n"); + err = TestWriteAttributeEnum8MinValue_81(); + break; + case 82: + ChipLogProgress(chipTool, " ***** Test Step 82 : Read attribute ENUM8 Min Value\n"); + err = TestReadAttributeEnum8MinValue_82(); + break; + case 83: + ChipLogProgress(chipTool, " ***** Test Step 83 : Read attribute ENUM16 Default Value\n"); + err = TestReadAttributeEnum16DefaultValue_83(); + break; + case 84: + ChipLogProgress(chipTool, " ***** Test Step 84 : Write attribute ENUM16 Max Value\n"); + err = TestWriteAttributeEnum16MaxValue_84(); break; - case 1: - ChipLogProgress(chipTool, " ***** Test Step 1 : read the mandatory attribute: EffectiveOperationMode\n"); - err = TestReadTheMandatoryAttributeEffectiveOperationMode_1(); + case 85: + ChipLogProgress(chipTool, " ***** Test Step 85 : Read attribute ENUM16 Max Value\n"); + err = TestReadAttributeEnum16MaxValue_85(); break; - case 2: - ChipLogProgress(chipTool, " ***** Test Step 2 : read the mandatory attribute: EffectiveControlMode\n"); - err = TestReadTheMandatoryAttributeEffectiveControlMode_2(); + case 86: + ChipLogProgress(chipTool, " ***** Test Step 86 : Write attribute ENUM16 Min Value\n"); + err = TestWriteAttributeEnum16MinValue_86(); break; - case 3: - ChipLogProgress(chipTool, " ***** Test Step 3 : read the mandatory attribute: Capacity\n"); - err = TestReadTheMandatoryAttributeCapacity_3(); + case 87: + ChipLogProgress(chipTool, " ***** Test Step 87 : Read attribute ENUM16 Min Value\n"); + err = TestReadAttributeEnum16MinValue_87(); break; - case 4: - ChipLogProgress(chipTool, " ***** Test Step 4 : read the mandatory attribute: MaxPressure\n"); - err = TestReadTheMandatoryAttributeMaxPressure_4(); + case 88: + ChipLogProgress(chipTool, " ***** Test Step 88 : Read attribute OCTET_STRING Default Value\n"); + err = TestReadAttributeOctetStringDefaultValue_88(); break; - case 5: - ChipLogProgress(chipTool, " ***** Test Step 5 : read the mandatory attribute: EffectiveOperationMode\n"); - err = TestReadTheMandatoryAttributeEffectiveOperationMode_5(); + case 89: + ChipLogProgress(chipTool, " ***** Test Step 89 : Write attribute OCTET_STRING\n"); + err = TestWriteAttributeOctetString_89(); break; - case 6: - ChipLogProgress(chipTool, " ***** Test Step 6 : read the mandatory attribute: EffectiveControlMode\n"); - err = TestReadTheMandatoryAttributeEffectiveControlMode_6(); + case 90: + ChipLogProgress(chipTool, " ***** Test Step 90 : Read attribute OCTET_STRING\n"); + err = TestReadAttributeOctetString_90(); break; - case 7: - ChipLogProgress(chipTool, " ***** Test Step 7 : read the mandatory attribute: Capacity\n"); - err = TestReadTheMandatoryAttributeCapacity_7(); + case 91: + ChipLogProgress(chipTool, " ***** Test Step 91 : Write attribute OCTET_STRING\n"); + err = TestWriteAttributeOctetString_91(); break; - } - - if (CHIP_NO_ERROR != err) - { - ChipLogError(chipTool, " ***** Test Failure: %s\n", chip::ErrorStr(err)); - SetCommandExitStatus(err); - } - } - -private: - std::atomic_uint16_t mTestIndex; - const uint16_t mTestCount = 8; - - chip::Callback::Callback mOnFailureCallback_0{ OnFailureCallback_0, this }; - chip::Callback::Callback mOnSuccessCallback_0{ OnSuccessCallback_0, this }; - chip::Callback::Callback mOnFailureCallback_1{ OnFailureCallback_1, this }; - chip::Callback::Callback mOnSuccessCallback_1{ OnSuccessCallback_1, - this }; - chip::Callback::Callback mOnFailureCallback_2{ OnFailureCallback_2, this }; - chip::Callback::Callback mOnSuccessCallback_2{ OnSuccessCallback_2, - this }; - chip::Callback::Callback mOnFailureCallback_3{ OnFailureCallback_3, this }; - chip::Callback::Callback mOnSuccessCallback_3{ OnSuccessCallback_3, this }; - chip::Callback::Callback mOnFailureCallback_4{ OnFailureCallback_4, this }; - chip::Callback::Callback mOnSuccessCallback_4{ OnSuccessCallback_4, this }; - chip::Callback::Callback mOnFailureCallback_5{ OnFailureCallback_5, this }; - chip::Callback::Callback mOnSuccessCallback_5{ OnSuccessCallback_5, - this }; - chip::Callback::Callback mOnFailureCallback_6{ OnFailureCallback_6, this }; - chip::Callback::Callback mOnSuccessCallback_6{ OnSuccessCallback_6, - this }; - chip::Callback::Callback mOnFailureCallback_7{ OnFailureCallback_7, this }; - chip::Callback::Callback mOnSuccessCallback_7{ OnSuccessCallback_7, this }; - - static void OnFailureCallback_0(void * context, uint8_t status) - { - (static_cast(context))->OnFailureResponse_0(status); - } - - static void OnSuccessCallback_0(void * context, int16_t maxPressure) - { - (static_cast(context))->OnSuccessResponse_0(maxPressure); - } - - static void OnFailureCallback_1(void * context, uint8_t status) - { - (static_cast(context))->OnFailureResponse_1(status); - } - - static void OnSuccessCallback_1(void * context, uint8_t effectiveOperationMode) - { - (static_cast(context))->OnSuccessResponse_1(effectiveOperationMode); - } - - static void OnFailureCallback_2(void * context, uint8_t status) - { - (static_cast(context))->OnFailureResponse_2(status); - } - - static void OnSuccessCallback_2(void * context, uint8_t effectiveControlMode) - { - (static_cast(context))->OnSuccessResponse_2(effectiveControlMode); - } - - static void OnFailureCallback_3(void * context, uint8_t status) - { - (static_cast(context))->OnFailureResponse_3(status); - } - - static void OnSuccessCallback_3(void * context, int16_t capacity) - { - (static_cast(context))->OnSuccessResponse_3(capacity); - } - - static void OnFailureCallback_4(void * context, uint8_t status) - { - (static_cast(context))->OnFailureResponse_4(status); - } - - static void OnSuccessCallback_4(void * context, int16_t maxPressure) - { - (static_cast(context))->OnSuccessResponse_4(maxPressure); - } - - static void OnFailureCallback_5(void * context, uint8_t status) - { - (static_cast(context))->OnFailureResponse_5(status); - } - - static void OnSuccessCallback_5(void * context, uint8_t effectiveOperationMode) - { - (static_cast(context))->OnSuccessResponse_5(effectiveOperationMode); - } + case 92: + ChipLogProgress(chipTool, " ***** Test Step 92 : Read attribute OCTET_STRING\n"); + err = TestReadAttributeOctetString_92(); + break; + case 93: + ChipLogProgress(chipTool, " ***** Test Step 93 : Write attribute OCTET_STRING\n"); + err = TestWriteAttributeOctetString_93(); + break; + case 94: + ChipLogProgress(chipTool, " ***** Test Step 94 : Read attribute LONG_OCTET_STRING Default Value\n"); + err = TestReadAttributeLongOctetStringDefaultValue_94(); + break; + case 95: + ChipLogProgress(chipTool, " ***** Test Step 95 : Write attribute LONG_OCTET_STRING\n"); + err = TestWriteAttributeLongOctetString_95(); + break; + case 96: + ChipLogProgress(chipTool, " ***** Test Step 96 : Read attribute LONG_OCTET_STRING\n"); + err = TestReadAttributeLongOctetString_96(); + break; + case 97: + ChipLogProgress(chipTool, " ***** Test Step 97 : Write attribute LONG_OCTET_STRING\n"); + err = TestWriteAttributeLongOctetString_97(); + break; + case 98: + ChipLogProgress(chipTool, " ***** Test Step 98 : Read attribute CHAR_STRING Default Value\n"); + err = TestReadAttributeCharStringDefaultValue_98(); + break; + case 99: + ChipLogProgress(chipTool, " ***** Test Step 99 : Write attribute CHAR_STRING\n"); + err = TestWriteAttributeCharString_99(); + break; + case 100: + ChipLogProgress(chipTool, " ***** Test Step 100 : Write attribute CHAR_STRING - Value too long\n"); + err = TestWriteAttributeCharStringValueTooLong_100(); + break; + case 101: + ChipLogProgress(chipTool, " ***** Test Step 101 : Write attribute CHAR_STRING - Empty\n"); + err = TestWriteAttributeCharStringEmpty_101(); + break; + case 102: + ChipLogProgress(chipTool, " ***** Test Step 102 : Read attribute LONG_CHAR_STRING Default Value\n"); + err = TestReadAttributeLongCharStringDefaultValue_102(); + break; + case 103: + ChipLogProgress(chipTool, " ***** Test Step 103 : Write attribute LONG_CHAR_STRING\n"); + err = TestWriteAttributeLongCharString_103(); + break; + case 104: + ChipLogProgress(chipTool, " ***** Test Step 104 : Read attribute LONG_CHAR_STRING\n"); + err = TestReadAttributeLongCharString_104(); + break; + case 105: + ChipLogProgress(chipTool, " ***** Test Step 105 : Write attribute LONG_CHAR_STRING\n"); + err = TestWriteAttributeLongCharString_105(); + break; + case 106: + ChipLogProgress(chipTool, " ***** Test Step 106 : Read attribute LIST\n"); + err = TestReadAttributeList_106(); + break; + case 107: + ChipLogProgress(chipTool, " ***** Test Step 107 : Read attribute LIST_OCTET_STRING\n"); + err = TestReadAttributeListOctetString_107(); + break; + case 108: + ChipLogProgress(chipTool, " ***** Test Step 108 : Read attribute LIST_STRUCT_OCTET_STRING\n"); + err = TestReadAttributeListStructOctetString_108(); + break; + case 109: + ChipLogProgress(chipTool, " ***** Test Step 109 : Read attribute EPOCH_US Default Value\n"); + err = TestReadAttributeEpochUsDefaultValue_109(); + break; + case 110: + ChipLogProgress(chipTool, " ***** Test Step 110 : Write attribute EPOCH_US Max Value\n"); + err = TestWriteAttributeEpochUsMaxValue_110(); + break; + case 111: + ChipLogProgress(chipTool, " ***** Test Step 111 : Read attribute EPOCH_US Max Value\n"); + err = TestReadAttributeEpochUsMaxValue_111(); + break; + case 112: + ChipLogProgress(chipTool, " ***** Test Step 112 : Write attribute EPOCH_US Min Value\n"); + err = TestWriteAttributeEpochUsMinValue_112(); + break; + case 113: + ChipLogProgress(chipTool, " ***** Test Step 113 : Read attribute EPOCH_US Min Value\n"); + err = TestReadAttributeEpochUsMinValue_113(); + break; + case 114: + ChipLogProgress(chipTool, " ***** Test Step 114 : Read attribute EPOCH_S Default Value\n"); + err = TestReadAttributeEpochSDefaultValue_114(); + break; + case 115: + ChipLogProgress(chipTool, " ***** Test Step 115 : Write attribute EPOCH_S Max Value\n"); + err = TestWriteAttributeEpochSMaxValue_115(); + break; + case 116: + ChipLogProgress(chipTool, " ***** Test Step 116 : Read attribute EPOCH_S Max Value\n"); + err = TestReadAttributeEpochSMaxValue_116(); + break; + case 117: + ChipLogProgress(chipTool, " ***** Test Step 117 : Write attribute EPOCH_S Min Value\n"); + err = TestWriteAttributeEpochSMinValue_117(); + break; + case 118: + ChipLogProgress(chipTool, " ***** Test Step 118 : Read attribute EPOCH_S Min Value\n"); + err = TestReadAttributeEpochSMinValue_118(); + break; + case 119: + ChipLogProgress(chipTool, " ***** Test Step 119 : Read attribute UNSUPPORTED\n"); + err = TestReadAttributeUnsupported_119(); + break; + case 120: + ChipLogProgress(chipTool, " ***** Test Step 120 : Writeattribute UNSUPPORTED\n"); + err = TestWriteattributeUnsupported_120(); + break; + case 121: + ChipLogProgress(chipTool, " ***** Test Step 121 : Send Test Command to unsupported endpoint\n"); + err = TestSendTestCommandToUnsupportedEndpoint_121(); + break; + } - static void OnFailureCallback_6(void * context, uint8_t status) - { - (static_cast(context))->OnFailureResponse_6(status); + if (CHIP_NO_ERROR != err) + { + ChipLogError(chipTool, " ***** Test Failure: %s\n", chip::ErrorStr(err)); + SetCommandExitStatus(err); + } } - static void OnSuccessCallback_6(void * context, uint8_t effectiveControlMode) - { - (static_cast(context))->OnSuccessResponse_6(effectiveControlMode); - } +private: + std::atomic_uint16_t mTestIndex; + const uint16_t mTestCount = 122; - static void OnFailureCallback_7(void * context, uint8_t status) - { - (static_cast(context))->OnFailureResponse_7(status); - } + chip::Callback::Callback mOnFailureCallback_0{ OnFailureCallback_0, this }; + chip::Callback::Callback mOnSuccessCallback_0{ OnSuccessCallback_0, this }; + chip::Callback::Callback mOnFailureCallback_1{ OnFailureCallback_1, this }; + chip::Callback::Callback mOnSuccessCallback_1{ OnSuccessCallback_1, this }; + chip::Callback::Callback mOnFailureCallback_2{ OnFailureCallback_2, this }; + chip::Callback::Callback mOnSuccessCallback_2{ OnSuccessCallback_2, this }; + chip::Callback::Callback mOnFailureCallback_3{ OnFailureCallback_3, this }; + chip::Callback::Callback mOnSuccessCallback_3{ OnSuccessCallback_3, this }; + chip::Callback::Callback mOnFailureCallback_4{ OnFailureCallback_4, this }; + chip::Callback::Callback mOnSuccessCallback_4{ OnSuccessCallback_4, this }; + chip::Callback::Callback mOnFailureCallback_5{ OnFailureCallback_5, this }; + chip::Callback::Callback mOnSuccessCallback_5{ OnSuccessCallback_5, this }; + chip::Callback::Callback mOnFailureCallback_6{ OnFailureCallback_6, this }; + chip::Callback::Callback mOnSuccessCallback_6{ OnSuccessCallback_6, this }; + chip::Callback::Callback mOnFailureCallback_7{ OnFailureCallback_7, this }; + chip::Callback::Callback mOnSuccessCallback_7{ OnSuccessCallback_7, this }; + chip::Callback::Callback mOnFailureCallback_8{ OnFailureCallback_8, this }; + chip::Callback::Callback mOnSuccessCallback_8{ OnSuccessCallback_8, this }; + chip::Callback::Callback mOnFailureCallback_9{ OnFailureCallback_9, this }; + chip::Callback::Callback mOnSuccessCallback_9{ OnSuccessCallback_9, this }; + chip::Callback::Callback mOnFailureCallback_10{ OnFailureCallback_10, this }; + chip::Callback::Callback mOnSuccessCallback_10{ OnSuccessCallback_10, this }; + chip::Callback::Callback mOnFailureCallback_11{ OnFailureCallback_11, this }; + chip::Callback::Callback mOnSuccessCallback_11{ OnSuccessCallback_11, this }; + chip::Callback::Callback mOnFailureCallback_12{ OnFailureCallback_12, this }; + chip::Callback::Callback mOnSuccessCallback_12{ OnSuccessCallback_12, this }; + chip::Callback::Callback mOnFailureCallback_13{ OnFailureCallback_13, this }; + chip::Callback::Callback mOnSuccessCallback_13{ OnSuccessCallback_13, this }; + chip::Callback::Callback mOnFailureCallback_14{ OnFailureCallback_14, this }; + chip::Callback::Callback mOnSuccessCallback_14{ OnSuccessCallback_14, this }; + chip::Callback::Callback mOnFailureCallback_15{ OnFailureCallback_15, this }; + chip::Callback::Callback mOnSuccessCallback_15{ OnSuccessCallback_15, this }; + chip::Callback::Callback mOnFailureCallback_16{ OnFailureCallback_16, this }; + chip::Callback::Callback mOnSuccessCallback_16{ OnSuccessCallback_16, this }; + chip::Callback::Callback mOnFailureCallback_17{ OnFailureCallback_17, this }; + chip::Callback::Callback mOnSuccessCallback_17{ OnSuccessCallback_17, this }; + chip::Callback::Callback mOnFailureCallback_18{ OnFailureCallback_18, this }; + chip::Callback::Callback mOnSuccessCallback_18{ OnSuccessCallback_18, this }; + chip::Callback::Callback mOnFailureCallback_19{ OnFailureCallback_19, this }; + chip::Callback::Callback mOnSuccessCallback_19{ OnSuccessCallback_19, this }; + chip::Callback::Callback mOnFailureCallback_20{ OnFailureCallback_20, this }; + chip::Callback::Callback mOnSuccessCallback_20{ OnSuccessCallback_20, this }; + chip::Callback::Callback mOnFailureCallback_21{ OnFailureCallback_21, this }; + chip::Callback::Callback mOnSuccessCallback_21{ OnSuccessCallback_21, this }; + chip::Callback::Callback mOnFailureCallback_22{ OnFailureCallback_22, this }; + chip::Callback::Callback mOnSuccessCallback_22{ OnSuccessCallback_22, this }; + chip::Callback::Callback mOnFailureCallback_23{ OnFailureCallback_23, this }; + chip::Callback::Callback mOnSuccessCallback_23{ OnSuccessCallback_23, this }; + chip::Callback::Callback mOnFailureCallback_24{ OnFailureCallback_24, this }; + chip::Callback::Callback mOnSuccessCallback_24{ OnSuccessCallback_24, this }; + chip::Callback::Callback mOnFailureCallback_25{ OnFailureCallback_25, this }; + chip::Callback::Callback mOnSuccessCallback_25{ OnSuccessCallback_25, this }; + chip::Callback::Callback mOnFailureCallback_26{ OnFailureCallback_26, this }; + chip::Callback::Callback mOnSuccessCallback_26{ OnSuccessCallback_26, this }; + chip::Callback::Callback mOnFailureCallback_27{ OnFailureCallback_27, this }; + chip::Callback::Callback mOnSuccessCallback_27{ OnSuccessCallback_27, this }; + chip::Callback::Callback mOnFailureCallback_28{ OnFailureCallback_28, this }; + chip::Callback::Callback mOnSuccessCallback_28{ OnSuccessCallback_28, this }; + chip::Callback::Callback mOnFailureCallback_29{ OnFailureCallback_29, this }; + chip::Callback::Callback mOnSuccessCallback_29{ OnSuccessCallback_29, this }; + chip::Callback::Callback mOnFailureCallback_30{ OnFailureCallback_30, this }; + chip::Callback::Callback mOnSuccessCallback_30{ OnSuccessCallback_30, this }; + chip::Callback::Callback mOnFailureCallback_31{ OnFailureCallback_31, this }; + chip::Callback::Callback mOnSuccessCallback_31{ OnSuccessCallback_31, this }; + chip::Callback::Callback mOnFailureCallback_32{ OnFailureCallback_32, this }; + chip::Callback::Callback mOnSuccessCallback_32{ OnSuccessCallback_32, this }; + chip::Callback::Callback mOnFailureCallback_33{ OnFailureCallback_33, this }; + chip::Callback::Callback mOnSuccessCallback_33{ OnSuccessCallback_33, this }; + chip::Callback::Callback mOnFailureCallback_34{ OnFailureCallback_34, this }; + chip::Callback::Callback mOnSuccessCallback_34{ OnSuccessCallback_34, this }; + chip::Callback::Callback mOnFailureCallback_35{ OnFailureCallback_35, this }; + chip::Callback::Callback mOnSuccessCallback_35{ OnSuccessCallback_35, this }; + chip::Callback::Callback mOnFailureCallback_36{ OnFailureCallback_36, this }; + chip::Callback::Callback mOnSuccessCallback_36{ OnSuccessCallback_36, this }; + chip::Callback::Callback mOnFailureCallback_37{ OnFailureCallback_37, this }; + chip::Callback::Callback mOnSuccessCallback_37{ OnSuccessCallback_37, this }; + chip::Callback::Callback mOnFailureCallback_38{ OnFailureCallback_38, this }; + chip::Callback::Callback mOnSuccessCallback_38{ OnSuccessCallback_38, this }; + chip::Callback::Callback mOnFailureCallback_39{ OnFailureCallback_39, this }; + chip::Callback::Callback mOnSuccessCallback_39{ OnSuccessCallback_39, this }; + chip::Callback::Callback mOnFailureCallback_40{ OnFailureCallback_40, this }; + chip::Callback::Callback mOnSuccessCallback_40{ OnSuccessCallback_40, this }; + chip::Callback::Callback mOnFailureCallback_41{ OnFailureCallback_41, this }; + chip::Callback::Callback mOnSuccessCallback_41{ OnSuccessCallback_41, this }; + chip::Callback::Callback mOnFailureCallback_42{ OnFailureCallback_42, this }; + chip::Callback::Callback mOnSuccessCallback_42{ OnSuccessCallback_42, this }; + chip::Callback::Callback mOnFailureCallback_43{ OnFailureCallback_43, this }; + chip::Callback::Callback mOnSuccessCallback_43{ OnSuccessCallback_43, this }; + chip::Callback::Callback mOnFailureCallback_44{ OnFailureCallback_44, this }; + chip::Callback::Callback mOnSuccessCallback_44{ OnSuccessCallback_44, this }; + chip::Callback::Callback mOnFailureCallback_45{ OnFailureCallback_45, this }; + chip::Callback::Callback mOnSuccessCallback_45{ OnSuccessCallback_45, this }; + chip::Callback::Callback mOnFailureCallback_46{ OnFailureCallback_46, this }; + chip::Callback::Callback mOnSuccessCallback_46{ OnSuccessCallback_46, this }; + chip::Callback::Callback mOnFailureCallback_47{ OnFailureCallback_47, this }; + chip::Callback::Callback mOnSuccessCallback_47{ OnSuccessCallback_47, this }; + chip::Callback::Callback mOnFailureCallback_48{ OnFailureCallback_48, this }; + chip::Callback::Callback mOnSuccessCallback_48{ OnSuccessCallback_48, this }; + chip::Callback::Callback mOnFailureCallback_49{ OnFailureCallback_49, this }; + chip::Callback::Callback mOnSuccessCallback_49{ OnSuccessCallback_49, this }; + chip::Callback::Callback mOnFailureCallback_50{ OnFailureCallback_50, this }; + chip::Callback::Callback mOnSuccessCallback_50{ OnSuccessCallback_50, this }; + chip::Callback::Callback mOnFailureCallback_51{ OnFailureCallback_51, this }; + chip::Callback::Callback mOnSuccessCallback_51{ OnSuccessCallback_51, this }; + chip::Callback::Callback mOnFailureCallback_52{ OnFailureCallback_52, this }; + chip::Callback::Callback mOnSuccessCallback_52{ OnSuccessCallback_52, this }; + chip::Callback::Callback mOnFailureCallback_53{ OnFailureCallback_53, this }; + chip::Callback::Callback mOnSuccessCallback_53{ OnSuccessCallback_53, this }; + chip::Callback::Callback mOnFailureCallback_54{ OnFailureCallback_54, this }; + chip::Callback::Callback mOnSuccessCallback_54{ OnSuccessCallback_54, this }; + chip::Callback::Callback mOnFailureCallback_55{ OnFailureCallback_55, this }; + chip::Callback::Callback mOnSuccessCallback_55{ OnSuccessCallback_55, this }; + chip::Callback::Callback mOnFailureCallback_56{ OnFailureCallback_56, this }; + chip::Callback::Callback mOnSuccessCallback_56{ OnSuccessCallback_56, this }; + chip::Callback::Callback mOnFailureCallback_57{ OnFailureCallback_57, this }; + chip::Callback::Callback mOnSuccessCallback_57{ OnSuccessCallback_57, this }; + chip::Callback::Callback mOnFailureCallback_58{ OnFailureCallback_58, this }; + chip::Callback::Callback mOnSuccessCallback_58{ OnSuccessCallback_58, this }; + chip::Callback::Callback mOnFailureCallback_59{ OnFailureCallback_59, this }; + chip::Callback::Callback mOnSuccessCallback_59{ OnSuccessCallback_59, this }; + chip::Callback::Callback mOnFailureCallback_60{ OnFailureCallback_60, this }; + chip::Callback::Callback mOnSuccessCallback_60{ OnSuccessCallback_60, this }; + chip::Callback::Callback mOnFailureCallback_61{ OnFailureCallback_61, this }; + chip::Callback::Callback mOnSuccessCallback_61{ OnSuccessCallback_61, this }; + chip::Callback::Callback mOnFailureCallback_62{ OnFailureCallback_62, this }; + chip::Callback::Callback mOnSuccessCallback_62{ OnSuccessCallback_62, this }; + chip::Callback::Callback mOnFailureCallback_63{ OnFailureCallback_63, this }; + chip::Callback::Callback mOnSuccessCallback_63{ OnSuccessCallback_63, this }; + chip::Callback::Callback mOnFailureCallback_64{ OnFailureCallback_64, this }; + chip::Callback::Callback mOnSuccessCallback_64{ OnSuccessCallback_64, this }; + chip::Callback::Callback mOnFailureCallback_65{ OnFailureCallback_65, this }; + chip::Callback::Callback mOnSuccessCallback_65{ OnSuccessCallback_65, this }; + chip::Callback::Callback mOnFailureCallback_66{ OnFailureCallback_66, this }; + chip::Callback::Callback mOnSuccessCallback_66{ OnSuccessCallback_66, this }; + chip::Callback::Callback mOnFailureCallback_67{ OnFailureCallback_67, this }; + chip::Callback::Callback mOnSuccessCallback_67{ OnSuccessCallback_67, this }; + chip::Callback::Callback mOnFailureCallback_68{ OnFailureCallback_68, this }; + chip::Callback::Callback mOnSuccessCallback_68{ OnSuccessCallback_68, this }; + chip::Callback::Callback mOnFailureCallback_69{ OnFailureCallback_69, this }; + chip::Callback::Callback mOnSuccessCallback_69{ OnSuccessCallback_69, this }; + chip::Callback::Callback mOnFailureCallback_70{ OnFailureCallback_70, this }; + chip::Callback::Callback mOnSuccessCallback_70{ OnSuccessCallback_70, this }; + chip::Callback::Callback mOnFailureCallback_71{ OnFailureCallback_71, this }; + chip::Callback::Callback mOnSuccessCallback_71{ OnSuccessCallback_71, this }; + chip::Callback::Callback mOnFailureCallback_72{ OnFailureCallback_72, this }; + chip::Callback::Callback mOnSuccessCallback_72{ OnSuccessCallback_72, this }; + chip::Callback::Callback mOnFailureCallback_73{ OnFailureCallback_73, this }; + chip::Callback::Callback mOnSuccessCallback_73{ OnSuccessCallback_73, this }; + chip::Callback::Callback mOnFailureCallback_74{ OnFailureCallback_74, this }; + chip::Callback::Callback mOnSuccessCallback_74{ OnSuccessCallback_74, this }; + chip::Callback::Callback mOnFailureCallback_75{ OnFailureCallback_75, this }; + chip::Callback::Callback mOnSuccessCallback_75{ OnSuccessCallback_75, this }; + chip::Callback::Callback mOnFailureCallback_76{ OnFailureCallback_76, this }; + chip::Callback::Callback mOnSuccessCallback_76{ OnSuccessCallback_76, this }; + chip::Callback::Callback mOnFailureCallback_77{ OnFailureCallback_77, this }; + chip::Callback::Callback mOnSuccessCallback_77{ OnSuccessCallback_77, this }; + chip::Callback::Callback mOnFailureCallback_78{ OnFailureCallback_78, this }; + chip::Callback::Callback mOnSuccessCallback_78{ OnSuccessCallback_78, this }; + chip::Callback::Callback mOnFailureCallback_79{ OnFailureCallback_79, this }; + chip::Callback::Callback mOnSuccessCallback_79{ OnSuccessCallback_79, this }; + chip::Callback::Callback mOnFailureCallback_80{ OnFailureCallback_80, this }; + chip::Callback::Callback mOnSuccessCallback_80{ OnSuccessCallback_80, this }; + chip::Callback::Callback mOnFailureCallback_81{ OnFailureCallback_81, this }; + chip::Callback::Callback mOnSuccessCallback_81{ OnSuccessCallback_81, this }; + chip::Callback::Callback mOnFailureCallback_82{ OnFailureCallback_82, this }; + chip::Callback::Callback mOnSuccessCallback_82{ OnSuccessCallback_82, this }; + chip::Callback::Callback mOnFailureCallback_83{ OnFailureCallback_83, this }; + chip::Callback::Callback mOnSuccessCallback_83{ OnSuccessCallback_83, this }; + chip::Callback::Callback mOnFailureCallback_84{ OnFailureCallback_84, this }; + chip::Callback::Callback mOnSuccessCallback_84{ OnSuccessCallback_84, this }; + chip::Callback::Callback mOnFailureCallback_85{ OnFailureCallback_85, this }; + chip::Callback::Callback mOnSuccessCallback_85{ OnSuccessCallback_85, this }; + chip::Callback::Callback mOnFailureCallback_86{ OnFailureCallback_86, this }; + chip::Callback::Callback mOnSuccessCallback_86{ OnSuccessCallback_86, this }; + chip::Callback::Callback mOnFailureCallback_87{ OnFailureCallback_87, this }; + chip::Callback::Callback mOnSuccessCallback_87{ OnSuccessCallback_87, this }; + chip::Callback::Callback mOnFailureCallback_88{ OnFailureCallback_88, this }; + chip::Callback::Callback mOnSuccessCallback_88{ OnSuccessCallback_88, + this }; + chip::Callback::Callback mOnFailureCallback_89{ OnFailureCallback_89, this }; + chip::Callback::Callback mOnSuccessCallback_89{ OnSuccessCallback_89, + this }; + chip::Callback::Callback mOnFailureCallback_90{ OnFailureCallback_90, this }; + chip::Callback::Callback mOnSuccessCallback_90{ OnSuccessCallback_90, + this }; + chip::Callback::Callback mOnFailureCallback_91{ OnFailureCallback_91, this }; + chip::Callback::Callback mOnSuccessCallback_91{ OnSuccessCallback_91, + this }; + chip::Callback::Callback mOnFailureCallback_92{ OnFailureCallback_92, this }; + chip::Callback::Callback mOnSuccessCallback_92{ OnSuccessCallback_92, + this }; + chip::Callback::Callback mOnFailureCallback_93{ OnFailureCallback_93, this }; + chip::Callback::Callback mOnSuccessCallback_93{ OnSuccessCallback_93, + this }; + chip::Callback::Callback mOnFailureCallback_94{ OnFailureCallback_94, this }; + chip::Callback::Callback mOnSuccessCallback_94{ OnSuccessCallback_94, + this }; + chip::Callback::Callback mOnFailureCallback_95{ OnFailureCallback_95, this }; + chip::Callback::Callback mOnSuccessCallback_95{ OnSuccessCallback_95, + this }; + chip::Callback::Callback mOnFailureCallback_96{ OnFailureCallback_96, this }; + chip::Callback::Callback mOnSuccessCallback_96{ OnSuccessCallback_96, + this }; + chip::Callback::Callback mOnFailureCallback_97{ OnFailureCallback_97, this }; + chip::Callback::Callback mOnSuccessCallback_97{ OnSuccessCallback_97, + this }; + chip::Callback::Callback mOnFailureCallback_98{ OnFailureCallback_98, this }; + chip::Callback::Callback mOnSuccessCallback_98{ OnSuccessCallback_98, + this }; + chip::Callback::Callback mOnFailureCallback_99{ OnFailureCallback_99, this }; + chip::Callback::Callback mOnSuccessCallback_99{ OnSuccessCallback_99, + this }; + chip::Callback::Callback mOnFailureCallback_100{ OnFailureCallback_100, this }; + chip::Callback::Callback mOnSuccessCallback_100{ OnSuccessCallback_100, + this }; + chip::Callback::Callback mOnFailureCallback_101{ OnFailureCallback_101, this }; + chip::Callback::Callback mOnSuccessCallback_101{ OnSuccessCallback_101, + this }; + chip::Callback::Callback mOnFailureCallback_102{ OnFailureCallback_102, this }; + chip::Callback::Callback mOnSuccessCallback_102{ OnSuccessCallback_102, + this }; + chip::Callback::Callback mOnFailureCallback_103{ OnFailureCallback_103, this }; + chip::Callback::Callback mOnSuccessCallback_103{ OnSuccessCallback_103, + this }; + chip::Callback::Callback mOnFailureCallback_104{ OnFailureCallback_104, this }; + chip::Callback::Callback mOnSuccessCallback_104{ OnSuccessCallback_104, + this }; + chip::Callback::Callback mOnFailureCallback_105{ OnFailureCallback_105, this }; + chip::Callback::Callback mOnSuccessCallback_105{ OnSuccessCallback_105, + this }; + chip::Callback::Callback mOnFailureCallback_106{ OnFailureCallback_106, this }; + chip::Callback::Callback mOnSuccessCallback_106{ + OnSuccessCallback_106, this + }; + chip::Callback::Callback mOnFailureCallback_107{ OnFailureCallback_107, this }; + chip::Callback::Callback mOnSuccessCallback_107{ + OnSuccessCallback_107, this + }; + chip::Callback::Callback mOnFailureCallback_108{ OnFailureCallback_108, this }; + chip::Callback::Callback + mOnSuccessCallback_108{ OnSuccessCallback_108, this }; + chip::Callback::Callback mOnFailureCallback_109{ OnFailureCallback_109, this }; + chip::Callback::Callback mOnSuccessCallback_109{ OnSuccessCallback_109, this }; + chip::Callback::Callback mOnFailureCallback_110{ OnFailureCallback_110, this }; + chip::Callback::Callback mOnSuccessCallback_110{ OnSuccessCallback_110, this }; + chip::Callback::Callback mOnFailureCallback_111{ OnFailureCallback_111, this }; + chip::Callback::Callback mOnSuccessCallback_111{ OnSuccessCallback_111, this }; + chip::Callback::Callback mOnFailureCallback_112{ OnFailureCallback_112, this }; + chip::Callback::Callback mOnSuccessCallback_112{ OnSuccessCallback_112, this }; + chip::Callback::Callback mOnFailureCallback_113{ OnFailureCallback_113, this }; + chip::Callback::Callback mOnSuccessCallback_113{ OnSuccessCallback_113, this }; + chip::Callback::Callback mOnFailureCallback_114{ OnFailureCallback_114, this }; + chip::Callback::Callback mOnSuccessCallback_114{ OnSuccessCallback_114, this }; + chip::Callback::Callback mOnFailureCallback_115{ OnFailureCallback_115, this }; + chip::Callback::Callback mOnSuccessCallback_115{ OnSuccessCallback_115, this }; + chip::Callback::Callback mOnFailureCallback_116{ OnFailureCallback_116, this }; + chip::Callback::Callback mOnSuccessCallback_116{ OnSuccessCallback_116, this }; + chip::Callback::Callback mOnFailureCallback_117{ OnFailureCallback_117, this }; + chip::Callback::Callback mOnSuccessCallback_117{ OnSuccessCallback_117, this }; + chip::Callback::Callback mOnFailureCallback_118{ OnFailureCallback_118, this }; + chip::Callback::Callback mOnSuccessCallback_118{ OnSuccessCallback_118, this }; + chip::Callback::Callback mOnFailureCallback_119{ OnFailureCallback_119, this }; + chip::Callback::Callback mOnSuccessCallback_119{ OnSuccessCallback_119, this }; + chip::Callback::Callback mOnFailureCallback_120{ OnFailureCallback_120, this }; + chip::Callback::Callback mOnSuccessCallback_120{ OnSuccessCallback_120, this }; + chip::Callback::Callback mOnFailureCallback_121{ OnFailureCallback_121, this }; + chip::Callback::Callback mOnSuccessCallback_121{ OnSuccessCallback_121, this }; - static void OnSuccessCallback_7(void * context, int16_t capacity) + static void OnFailureCallback_0(void * context, uint8_t status) { - (static_cast(context))->OnSuccessResponse_7(capacity); + (static_cast(context))->OnFailureResponse_0(status); } - // - // Tests methods - // + static void OnSuccessCallback_0(void * context) { (static_cast(context))->OnSuccessResponse_0(); } - CHIP_ERROR TestReadTheMandatoryAttributeMaxPressure_0() + static void OnFailureCallback_1(void * context, uint8_t status) { - chip::Controller::PumpConfigurationAndControlClusterTest cluster; - cluster.Associate(mDevice, 1); - - return cluster.ReadAttributeMaxPressure(mOnSuccessCallback_0.Cancel(), mOnFailureCallback_0.Cancel()); + (static_cast(context))->OnFailureResponse_1(status); } - void OnFailureResponse_0(uint8_t status) { ThrowFailureResponse(); } - - void OnSuccessResponse_0(int16_t maxPressure) - { - VerifyOrReturn(CheckConstraintType("maxPressure", "", "int16")); - NextTest(); - } + static void OnSuccessCallback_1(void * context) { (static_cast(context))->OnSuccessResponse_1(); } - CHIP_ERROR TestReadTheMandatoryAttributeEffectiveOperationMode_1() + static void OnFailureCallback_2(void * context, uint8_t status) { - chip::Controller::PumpConfigurationAndControlClusterTest cluster; - cluster.Associate(mDevice, 1); - - return cluster.ReadAttributeEffectiveOperationMode(mOnSuccessCallback_1.Cancel(), mOnFailureCallback_1.Cancel()); + (static_cast(context))->OnFailureResponse_2(status); } - void OnFailureResponse_1(uint8_t status) { ThrowFailureResponse(); } - - void OnSuccessResponse_1(uint8_t effectiveOperationMode) + static void OnSuccessCallback_2(void * context, uint8_t returnValue) { - VerifyOrReturn(CheckConstraintType("effectiveOperationMode", "", "enum8")); - NextTest(); + (static_cast(context))->OnSuccessResponse_2(returnValue); } - CHIP_ERROR TestReadTheMandatoryAttributeEffectiveControlMode_2() + static void OnFailureCallback_3(void * context, uint8_t status) { - chip::Controller::PumpConfigurationAndControlClusterTest cluster; - cluster.Associate(mDevice, 1); - - return cluster.ReadAttributeEffectiveControlMode(mOnSuccessCallback_2.Cancel(), mOnFailureCallback_2.Cancel()); + (static_cast(context))->OnFailureResponse_3(status); } - void OnFailureResponse_2(uint8_t status) { ThrowFailureResponse(); } - - void OnSuccessResponse_2(uint8_t effectiveControlMode) + static void OnSuccessCallback_3(void * context, uint8_t returnValue) { - VerifyOrReturn(CheckConstraintType("effectiveControlMode", "", "enum8")); - NextTest(); + (static_cast(context))->OnSuccessResponse_3(returnValue); } - CHIP_ERROR TestReadTheMandatoryAttributeCapacity_3() + static void OnFailureCallback_4(void * context, uint8_t status) { - chip::Controller::PumpConfigurationAndControlClusterTest cluster; - cluster.Associate(mDevice, 1); - - return cluster.ReadAttributeCapacity(mOnSuccessCallback_3.Cancel(), mOnFailureCallback_3.Cancel()); + (static_cast(context))->OnFailureResponse_4(status); } - void OnFailureResponse_3(uint8_t status) { ThrowFailureResponse(); } - - void OnSuccessResponse_3(int16_t capacity) + static void OnSuccessCallback_4(void * context, uint8_t returnValue) { - VerifyOrReturn(CheckConstraintType("capacity", "", "int16")); - NextTest(); + (static_cast(context))->OnSuccessResponse_4(returnValue); } - CHIP_ERROR TestReadTheMandatoryAttributeMaxPressure_4() + static void OnFailureCallback_5(void * context, uint8_t status) { - chip::Controller::PumpConfigurationAndControlClusterTest cluster; - cluster.Associate(mDevice, 1); - - return cluster.ReadAttributeMaxPressure(mOnSuccessCallback_4.Cancel(), mOnFailureCallback_4.Cancel()); + (static_cast(context))->OnFailureResponse_5(status); } - void OnFailureResponse_4(uint8_t status) { ThrowFailureResponse(); } - - void OnSuccessResponse_4(int16_t maxPressure) + static void OnSuccessCallback_5(void * context, bool boolean) { - VerifyOrReturn(CheckConstraintType("maxPressure", "", "int16")); - NextTest(); + (static_cast(context))->OnSuccessResponse_5(boolean); } - CHIP_ERROR TestReadTheMandatoryAttributeEffectiveOperationMode_5() + static void OnFailureCallback_6(void * context, uint8_t status) { - chip::Controller::PumpConfigurationAndControlClusterTest cluster; - cluster.Associate(mDevice, 1); - - return cluster.ReadAttributeEffectiveOperationMode(mOnSuccessCallback_5.Cancel(), mOnFailureCallback_5.Cancel()); + (static_cast(context))->OnFailureResponse_6(status); } - void OnFailureResponse_5(uint8_t status) { ThrowFailureResponse(); } - - void OnSuccessResponse_5(uint8_t effectiveOperationMode) + static void OnSuccessCallback_6(void * context, bool boolean) { - VerifyOrReturn(CheckConstraintType("effectiveOperationMode", "", "enum8")); - NextTest(); + (static_cast(context))->OnSuccessResponse_6(boolean); } - CHIP_ERROR TestReadTheMandatoryAttributeEffectiveControlMode_6() + static void OnFailureCallback_7(void * context, uint8_t status) { - chip::Controller::PumpConfigurationAndControlClusterTest cluster; - cluster.Associate(mDevice, 1); - - return cluster.ReadAttributeEffectiveControlMode(mOnSuccessCallback_6.Cancel(), mOnFailureCallback_6.Cancel()); + (static_cast(context))->OnFailureResponse_7(status); } - void OnFailureResponse_6(uint8_t status) { ThrowFailureResponse(); } - - void OnSuccessResponse_6(uint8_t effectiveControlMode) + static void OnSuccessCallback_7(void * context, bool boolean) { - VerifyOrReturn(CheckConstraintType("effectiveControlMode", "", "enum8")); - NextTest(); + (static_cast(context))->OnSuccessResponse_7(boolean); } - CHIP_ERROR TestReadTheMandatoryAttributeCapacity_7() + static void OnFailureCallback_8(void * context, uint8_t status) { - chip::Controller::PumpConfigurationAndControlClusterTest cluster; - cluster.Associate(mDevice, 1); - - return cluster.ReadAttributeCapacity(mOnSuccessCallback_7.Cancel(), mOnFailureCallback_7.Cancel()); + (static_cast(context))->OnFailureResponse_8(status); } - void OnFailureResponse_7(uint8_t status) { ThrowFailureResponse(); } - - void OnSuccessResponse_7(int16_t capacity) + static void OnSuccessCallback_8(void * context, bool boolean) { - VerifyOrReturn(CheckConstraintType("capacity", "", "int16")); - NextTest(); + (static_cast(context))->OnSuccessResponse_8(boolean); } -}; - -class Test_TC_CC_3_1 : public TestCommand -{ -public: - Test_TC_CC_3_1() : TestCommand("Test_TC_CC_3_1"), mTestIndex(0) {} - /////////// TestCommand Interface ///////// - void NextTest() override + static void OnFailureCallback_9(void * context, uint8_t status) { - CHIP_ERROR err = CHIP_NO_ERROR; - - if (0 == mTestIndex) - { - ChipLogProgress(chipTool, " **** Test Start: Test_TC_CC_3_1\n"); - } - - if (mTestCount == mTestIndex) - { - ChipLogProgress(chipTool, " **** Test Complete: Test_TC_CC_3_1\n"); - SetCommandExitStatus(CHIP_NO_ERROR); - return; - } - - // Ensure we increment mTestIndex before we start running the relevant - // command. That way if we lose the timeslice after we send the message - // but before our function call returns, we won't end up with an - // incorrect mTestIndex value observed when we get the response. - switch (mTestIndex++) - { - case 0: - ChipLogProgress(chipTool, " ***** Test Step 0 : Turn on light for color control tests\n"); - err = TestTurnOnLightForColorControlTests_0(); - break; - case 1: - ChipLogProgress(chipTool, " ***** Test Step 1 : Check on/off attribute value is true after on command\n"); - err = TestCheckOnOffAttributeValueIsTrueAfterOnCommand_1(); - break; - case 2: - ChipLogProgress(chipTool, " ***** Test Step 2 : Move to hue shortest distance command\n"); - err = TestMoveToHueShortestDistanceCommand_2(); - break; - case 3: - ChipLogProgress(chipTool, " ***** Test Step 3 : Move to hue longest distance command\n"); - err = TestMoveToHueLongestDistanceCommand_3(); - break; - case 4: - ChipLogProgress(chipTool, " ***** Test Step 4 : Move to hue up command\n"); - err = TestMoveToHueUpCommand_4(); - break; - case 5: - ChipLogProgress(chipTool, " ***** Test Step 5 : Move to hue down command\n"); - err = TestMoveToHueDownCommand_5(); - break; - case 6: - ChipLogProgress(chipTool, " ***** Test Step 6 : Turn off light that we turned on\n"); - err = TestTurnOffLightThatWeTurnedOn_6(); - break; - case 7: - ChipLogProgress(chipTool, " ***** Test Step 7 : Check on/off attribute value is false after off command\n"); - err = TestCheckOnOffAttributeValueIsFalseAfterOffCommand_7(); - break; - } - - if (CHIP_NO_ERROR != err) - { - ChipLogError(chipTool, " ***** Test Failure: %s\n", chip::ErrorStr(err)); - SetCommandExitStatus(err); - } + (static_cast(context))->OnFailureResponse_9(status); } -private: - std::atomic_uint16_t mTestIndex; - const uint16_t mTestCount = 8; - - chip::Callback::Callback mOnFailureCallback_0{ OnFailureCallback_0, this }; - chip::Callback::Callback mOnSuccessCallback_0{ OnSuccessCallback_0, this }; - chip::Callback::Callback mOnFailureCallback_1{ OnFailureCallback_1, this }; - chip::Callback::Callback mOnSuccessCallback_1{ OnSuccessCallback_1, this }; - chip::Callback::Callback mOnFailureCallback_2{ OnFailureCallback_2, this }; - chip::Callback::Callback mOnSuccessCallback_2{ OnSuccessCallback_2, this }; - chip::Callback::Callback mOnFailureCallback_3{ OnFailureCallback_3, this }; - chip::Callback::Callback mOnSuccessCallback_3{ OnSuccessCallback_3, this }; - chip::Callback::Callback mOnFailureCallback_4{ OnFailureCallback_4, this }; - chip::Callback::Callback mOnSuccessCallback_4{ OnSuccessCallback_4, this }; - chip::Callback::Callback mOnFailureCallback_5{ OnFailureCallback_5, this }; - chip::Callback::Callback mOnSuccessCallback_5{ OnSuccessCallback_5, this }; - chip::Callback::Callback mOnFailureCallback_6{ OnFailureCallback_6, this }; - chip::Callback::Callback mOnSuccessCallback_6{ OnSuccessCallback_6, this }; - chip::Callback::Callback mOnFailureCallback_7{ OnFailureCallback_7, this }; - chip::Callback::Callback mOnSuccessCallback_7{ OnSuccessCallback_7, this }; - - static void OnFailureCallback_0(void * context, uint8_t status) + static void OnSuccessCallback_9(void * context, bool boolean) { - (static_cast(context))->OnFailureResponse_0(status); + (static_cast(context))->OnSuccessResponse_9(boolean); } - static void OnSuccessCallback_0(void * context) { (static_cast(context))->OnSuccessResponse_0(); } - - static void OnFailureCallback_1(void * context, uint8_t status) + static void OnFailureCallback_10(void * context, uint8_t status) { - (static_cast(context))->OnFailureResponse_1(status); + (static_cast(context))->OnFailureResponse_10(status); } - static void OnSuccessCallback_1(void * context, bool onOff) + static void OnSuccessCallback_10(void * context, uint8_t bitmap8) { - (static_cast(context))->OnSuccessResponse_1(onOff); + (static_cast(context))->OnSuccessResponse_10(bitmap8); } - static void OnFailureCallback_2(void * context, uint8_t status) + static void OnFailureCallback_11(void * context, uint8_t status) { - (static_cast(context))->OnFailureResponse_2(status); + (static_cast(context))->OnFailureResponse_11(status); } - static void OnSuccessCallback_2(void * context) { (static_cast(context))->OnSuccessResponse_2(); } - - static void OnFailureCallback_3(void * context, uint8_t status) + static void OnSuccessCallback_11(void * context, uint8_t bitmap8) { - (static_cast(context))->OnFailureResponse_3(status); + (static_cast(context))->OnSuccessResponse_11(bitmap8); } - static void OnSuccessCallback_3(void * context) { (static_cast(context))->OnSuccessResponse_3(); } - - static void OnFailureCallback_4(void * context, uint8_t status) + static void OnFailureCallback_12(void * context, uint8_t status) { - (static_cast(context))->OnFailureResponse_4(status); + (static_cast(context))->OnFailureResponse_12(status); } - static void OnSuccessCallback_4(void * context) { (static_cast(context))->OnSuccessResponse_4(); } - - static void OnFailureCallback_5(void * context, uint8_t status) + static void OnSuccessCallback_12(void * context, uint8_t bitmap8) { - (static_cast(context))->OnFailureResponse_5(status); + (static_cast(context))->OnSuccessResponse_12(bitmap8); } - static void OnSuccessCallback_5(void * context) { (static_cast(context))->OnSuccessResponse_5(); } - - static void OnFailureCallback_6(void * context, uint8_t status) + static void OnFailureCallback_13(void * context, uint8_t status) { - (static_cast(context))->OnFailureResponse_6(status); + (static_cast(context))->OnFailureResponse_13(status); } - static void OnSuccessCallback_6(void * context) { (static_cast(context))->OnSuccessResponse_6(); } - - static void OnFailureCallback_7(void * context, uint8_t status) + static void OnSuccessCallback_13(void * context, uint8_t bitmap8) { - (static_cast(context))->OnFailureResponse_7(status); + (static_cast(context))->OnSuccessResponse_13(bitmap8); } - static void OnSuccessCallback_7(void * context, bool onOff) + static void OnFailureCallback_14(void * context, uint8_t status) { - (static_cast(context))->OnSuccessResponse_7(onOff); + (static_cast(context))->OnFailureResponse_14(status); } - // - // Tests methods - // - - CHIP_ERROR TestTurnOnLightForColorControlTests_0() + static void OnSuccessCallback_14(void * context, uint8_t bitmap8) { - chip::Controller::OnOffClusterTest cluster; - cluster.Associate(mDevice, 1); - - return cluster.On(mOnSuccessCallback_0.Cancel(), mOnFailureCallback_0.Cancel()); + (static_cast(context))->OnSuccessResponse_14(bitmap8); } - void OnFailureResponse_0(uint8_t status) { ThrowFailureResponse(); } - - void OnSuccessResponse_0() { NextTest(); } - - CHIP_ERROR TestCheckOnOffAttributeValueIsTrueAfterOnCommand_1() + static void OnFailureCallback_15(void * context, uint8_t status) { - chip::Controller::OnOffClusterTest cluster; - cluster.Associate(mDevice, 1); - - return cluster.ReadAttributeOnOff(mOnSuccessCallback_1.Cancel(), mOnFailureCallback_1.Cancel()); + (static_cast(context))->OnFailureResponse_15(status); } - void OnFailureResponse_1(uint8_t status) { ThrowFailureResponse(); } - - void OnSuccessResponse_1(bool onOff) + static void OnSuccessCallback_15(void * context, uint16_t bitmap16) { - VerifyOrReturn(CheckValue("onOff", onOff, 1)); - NextTest(); + (static_cast(context))->OnSuccessResponse_15(bitmap16); } - CHIP_ERROR TestMoveToHueShortestDistanceCommand_2() + static void OnFailureCallback_16(void * context, uint8_t status) { - chip::Controller::ColorControlClusterTest cluster; - cluster.Associate(mDevice, 1); - - uint8_t hueArgument = 150; - uint8_t directionArgument = 0; - uint16_t transitionTimeArgument = 100U; - uint8_t optionsMaskArgument = 0; - uint8_t optionsOverrideArgument = 0; - - return cluster.MoveToHue(mOnSuccessCallback_2.Cancel(), mOnFailureCallback_2.Cancel(), hueArgument, directionArgument, - transitionTimeArgument, optionsMaskArgument, optionsOverrideArgument); + (static_cast(context))->OnFailureResponse_16(status); } - void OnFailureResponse_2(uint8_t status) { ThrowFailureResponse(); } - - void OnSuccessResponse_2() { NextTest(); } - - CHIP_ERROR TestMoveToHueLongestDistanceCommand_3() + static void OnSuccessCallback_16(void * context, uint16_t bitmap16) { - chip::Controller::ColorControlClusterTest cluster; - cluster.Associate(mDevice, 1); - - uint8_t hueArgument = 200; - uint8_t directionArgument = 1; - uint16_t transitionTimeArgument = 100U; - uint8_t optionsMaskArgument = 0; - uint8_t optionsOverrideArgument = 0; - - return cluster.MoveToHue(mOnSuccessCallback_3.Cancel(), mOnFailureCallback_3.Cancel(), hueArgument, directionArgument, - transitionTimeArgument, optionsMaskArgument, optionsOverrideArgument); + (static_cast(context))->OnSuccessResponse_16(bitmap16); } - void OnFailureResponse_3(uint8_t status) { ThrowFailureResponse(); } - - void OnSuccessResponse_3() { NextTest(); } - - CHIP_ERROR TestMoveToHueUpCommand_4() + static void OnFailureCallback_17(void * context, uint8_t status) { - chip::Controller::ColorControlClusterTest cluster; - cluster.Associate(mDevice, 1); - - uint8_t hueArgument = 250; - uint8_t directionArgument = 2; - uint16_t transitionTimeArgument = 100U; - uint8_t optionsMaskArgument = 0; - uint8_t optionsOverrideArgument = 0; - - return cluster.MoveToHue(mOnSuccessCallback_4.Cancel(), mOnFailureCallback_4.Cancel(), hueArgument, directionArgument, - transitionTimeArgument, optionsMaskArgument, optionsOverrideArgument); + (static_cast(context))->OnFailureResponse_17(status); } - void OnFailureResponse_4(uint8_t status) { ThrowFailureResponse(); } - - void OnSuccessResponse_4() { NextTest(); } - - CHIP_ERROR TestMoveToHueDownCommand_5() + static void OnSuccessCallback_17(void * context, uint16_t bitmap16) { - chip::Controller::ColorControlClusterTest cluster; - cluster.Associate(mDevice, 1); - - uint8_t hueArgument = 225; - uint8_t directionArgument = 3; - uint16_t transitionTimeArgument = 100U; - uint8_t optionsMaskArgument = 0; - uint8_t optionsOverrideArgument = 0; - - return cluster.MoveToHue(mOnSuccessCallback_5.Cancel(), mOnFailureCallback_5.Cancel(), hueArgument, directionArgument, - transitionTimeArgument, optionsMaskArgument, optionsOverrideArgument); + (static_cast(context))->OnSuccessResponse_17(bitmap16); } - void OnFailureResponse_5(uint8_t status) { ThrowFailureResponse(); } - - void OnSuccessResponse_5() { NextTest(); } - - CHIP_ERROR TestTurnOffLightThatWeTurnedOn_6() + static void OnFailureCallback_18(void * context, uint8_t status) { - chip::Controller::OnOffClusterTest cluster; - cluster.Associate(mDevice, 1); - - return cluster.Off(mOnSuccessCallback_6.Cancel(), mOnFailureCallback_6.Cancel()); + (static_cast(context))->OnFailureResponse_18(status); } - void OnFailureResponse_6(uint8_t status) { ThrowFailureResponse(); } - - void OnSuccessResponse_6() { NextTest(); } - - CHIP_ERROR TestCheckOnOffAttributeValueIsFalseAfterOffCommand_7() + static void OnSuccessCallback_18(void * context, uint16_t bitmap16) { - chip::Controller::OnOffClusterTest cluster; - cluster.Associate(mDevice, 1); - - return cluster.ReadAttributeOnOff(mOnSuccessCallback_7.Cancel(), mOnFailureCallback_7.Cancel()); + (static_cast(context))->OnSuccessResponse_18(bitmap16); } - void OnFailureResponse_7(uint8_t status) { ThrowFailureResponse(); } - - void OnSuccessResponse_7(bool onOff) + static void OnFailureCallback_19(void * context, uint8_t status) { - VerifyOrReturn(CheckValue("onOff", onOff, 0)); - NextTest(); + (static_cast(context))->OnFailureResponse_19(status); } -}; - -class Test_TC_CC_3_2 : public TestCommand -{ -public: - Test_TC_CC_3_2() : TestCommand("Test_TC_CC_3_2"), mTestIndex(0) {} - /////////// TestCommand Interface ///////// - void NextTest() override + static void OnSuccessCallback_19(void * context, uint16_t bitmap16) { - CHIP_ERROR err = CHIP_NO_ERROR; - - if (0 == mTestIndex) - { - ChipLogProgress(chipTool, " **** Test Start: Test_TC_CC_3_2\n"); - } - - if (mTestCount == mTestIndex) - { - ChipLogProgress(chipTool, " **** Test Complete: Test_TC_CC_3_2\n"); - SetCommandExitStatus(CHIP_NO_ERROR); - return; - } - - // Ensure we increment mTestIndex before we start running the relevant - // command. That way if we lose the timeslice after we send the message - // but before our function call returns, we won't end up with an - // incorrect mTestIndex value observed when we get the response. - switch (mTestIndex++) - { - case 0: - ChipLogProgress(chipTool, " ***** Test Step 0 : Turn on light for color control tests\n"); - err = TestTurnOnLightForColorControlTests_0(); - break; - case 1: - ChipLogProgress(chipTool, " ***** Test Step 1 : Check on/off attribute value is true after on command\n"); - err = TestCheckOnOffAttributeValueIsTrueAfterOnCommand_1(); - break; - case 2: - ChipLogProgress(chipTool, " ***** Test Step 2 : Move hue up command\n"); - err = TestMoveHueUpCommand_2(); - break; - case 3: - ChipLogProgress(chipTool, " ***** Test Step 3 : Move hue stop command\n"); - err = TestMoveHueStopCommand_3(); - break; - case 4: - ChipLogProgress(chipTool, " ***** Test Step 4 : Move hue down command\n"); - err = TestMoveHueDownCommand_4(); - break; - case 5: - ChipLogProgress(chipTool, " ***** Test Step 5 : Move hue stop command\n"); - err = TestMoveHueStopCommand_5(); - break; - case 6: - ChipLogProgress(chipTool, " ***** Test Step 6 : Turn off light that we turned on\n"); - err = TestTurnOffLightThatWeTurnedOn_6(); - break; - case 7: - ChipLogProgress(chipTool, " ***** Test Step 7 : Check on/off attribute value is false after off command\n"); - err = TestCheckOnOffAttributeValueIsFalseAfterOffCommand_7(); - break; - } - - if (CHIP_NO_ERROR != err) - { - ChipLogError(chipTool, " ***** Test Failure: %s\n", chip::ErrorStr(err)); - SetCommandExitStatus(err); - } + (static_cast(context))->OnSuccessResponse_19(bitmap16); } -private: - std::atomic_uint16_t mTestIndex; - const uint16_t mTestCount = 8; - - chip::Callback::Callback mOnFailureCallback_0{ OnFailureCallback_0, this }; - chip::Callback::Callback mOnSuccessCallback_0{ OnSuccessCallback_0, this }; - chip::Callback::Callback mOnFailureCallback_1{ OnFailureCallback_1, this }; - chip::Callback::Callback mOnSuccessCallback_1{ OnSuccessCallback_1, this }; - chip::Callback::Callback mOnFailureCallback_2{ OnFailureCallback_2, this }; - chip::Callback::Callback mOnSuccessCallback_2{ OnSuccessCallback_2, this }; - chip::Callback::Callback mOnFailureCallback_3{ OnFailureCallback_3, this }; - chip::Callback::Callback mOnSuccessCallback_3{ OnSuccessCallback_3, this }; - chip::Callback::Callback mOnFailureCallback_4{ OnFailureCallback_4, this }; - chip::Callback::Callback mOnSuccessCallback_4{ OnSuccessCallback_4, this }; - chip::Callback::Callback mOnFailureCallback_5{ OnFailureCallback_5, this }; - chip::Callback::Callback mOnSuccessCallback_5{ OnSuccessCallback_5, this }; - chip::Callback::Callback mOnFailureCallback_6{ OnFailureCallback_6, this }; - chip::Callback::Callback mOnSuccessCallback_6{ OnSuccessCallback_6, this }; - chip::Callback::Callback mOnFailureCallback_7{ OnFailureCallback_7, this }; - chip::Callback::Callback mOnSuccessCallback_7{ OnSuccessCallback_7, this }; - - static void OnFailureCallback_0(void * context, uint8_t status) + static void OnFailureCallback_20(void * context, uint8_t status) { - (static_cast(context))->OnFailureResponse_0(status); + (static_cast(context))->OnFailureResponse_20(status); } - static void OnSuccessCallback_0(void * context) { (static_cast(context))->OnSuccessResponse_0(); } - - static void OnFailureCallback_1(void * context, uint8_t status) + static void OnSuccessCallback_20(void * context, uint32_t bitmap32) { - (static_cast(context))->OnFailureResponse_1(status); + (static_cast(context))->OnSuccessResponse_20(bitmap32); } - static void OnSuccessCallback_1(void * context, bool onOff) + static void OnFailureCallback_21(void * context, uint8_t status) { - (static_cast(context))->OnSuccessResponse_1(onOff); + (static_cast(context))->OnFailureResponse_21(status); } - static void OnFailureCallback_2(void * context, uint8_t status) + static void OnSuccessCallback_21(void * context, uint32_t bitmap32) { - (static_cast(context))->OnFailureResponse_2(status); + (static_cast(context))->OnSuccessResponse_21(bitmap32); } - static void OnSuccessCallback_2(void * context) { (static_cast(context))->OnSuccessResponse_2(); } - - static void OnFailureCallback_3(void * context, uint8_t status) + static void OnFailureCallback_22(void * context, uint8_t status) { - (static_cast(context))->OnFailureResponse_3(status); + (static_cast(context))->OnFailureResponse_22(status); } - static void OnSuccessCallback_3(void * context) { (static_cast(context))->OnSuccessResponse_3(); } - - static void OnFailureCallback_4(void * context, uint8_t status) + static void OnSuccessCallback_22(void * context, uint32_t bitmap32) { - (static_cast(context))->OnFailureResponse_4(status); + (static_cast(context))->OnSuccessResponse_22(bitmap32); } - static void OnSuccessCallback_4(void * context) { (static_cast(context))->OnSuccessResponse_4(); } - - static void OnFailureCallback_5(void * context, uint8_t status) + static void OnFailureCallback_23(void * context, uint8_t status) { - (static_cast(context))->OnFailureResponse_5(status); + (static_cast(context))->OnFailureResponse_23(status); } - static void OnSuccessCallback_5(void * context) { (static_cast(context))->OnSuccessResponse_5(); } - - static void OnFailureCallback_6(void * context, uint8_t status) + static void OnSuccessCallback_23(void * context, uint32_t bitmap32) { - (static_cast(context))->OnFailureResponse_6(status); + (static_cast(context))->OnSuccessResponse_23(bitmap32); } - static void OnSuccessCallback_6(void * context) { (static_cast(context))->OnSuccessResponse_6(); } - - static void OnFailureCallback_7(void * context, uint8_t status) + static void OnFailureCallback_24(void * context, uint8_t status) { - (static_cast(context))->OnFailureResponse_7(status); + (static_cast(context))->OnFailureResponse_24(status); } - static void OnSuccessCallback_7(void * context, bool onOff) + static void OnSuccessCallback_24(void * context, uint32_t bitmap32) { - (static_cast(context))->OnSuccessResponse_7(onOff); + (static_cast(context))->OnSuccessResponse_24(bitmap32); } - // - // Tests methods - // - - CHIP_ERROR TestTurnOnLightForColorControlTests_0() + static void OnFailureCallback_25(void * context, uint8_t status) { - chip::Controller::OnOffClusterTest cluster; - cluster.Associate(mDevice, 1); - - return cluster.On(mOnSuccessCallback_0.Cancel(), mOnFailureCallback_0.Cancel()); + (static_cast(context))->OnFailureResponse_25(status); } - void OnFailureResponse_0(uint8_t status) { ThrowFailureResponse(); } - - void OnSuccessResponse_0() { NextTest(); } - - CHIP_ERROR TestCheckOnOffAttributeValueIsTrueAfterOnCommand_1() + static void OnSuccessCallback_25(void * context, uint64_t bitmap64) { - chip::Controller::OnOffClusterTest cluster; - cluster.Associate(mDevice, 1); - - return cluster.ReadAttributeOnOff(mOnSuccessCallback_1.Cancel(), mOnFailureCallback_1.Cancel()); + (static_cast(context))->OnSuccessResponse_25(bitmap64); } - void OnFailureResponse_1(uint8_t status) { ThrowFailureResponse(); } - - void OnSuccessResponse_1(bool onOff) + static void OnFailureCallback_26(void * context, uint8_t status) { - VerifyOrReturn(CheckValue("onOff", onOff, 1)); - NextTest(); + (static_cast(context))->OnFailureResponse_26(status); } - CHIP_ERROR TestMoveHueUpCommand_2() + static void OnSuccessCallback_26(void * context, uint64_t bitmap64) { - chip::Controller::ColorControlClusterTest cluster; - cluster.Associate(mDevice, 1); - - uint8_t moveModeArgument = 1; - uint8_t rateArgument = 50; - uint8_t optionsMaskArgument = 0; - uint8_t optionsOverrideArgument = 0; - - return cluster.MoveHue(mOnSuccessCallback_2.Cancel(), mOnFailureCallback_2.Cancel(), moveModeArgument, rateArgument, - optionsMaskArgument, optionsOverrideArgument); + (static_cast(context))->OnSuccessResponse_26(bitmap64); } - void OnFailureResponse_2(uint8_t status) { ThrowFailureResponse(); } - - void OnSuccessResponse_2() { NextTest(); } - - CHIP_ERROR TestMoveHueStopCommand_3() + static void OnFailureCallback_27(void * context, uint8_t status) { - chip::Controller::ColorControlClusterTest cluster; - cluster.Associate(mDevice, 1); - - uint8_t moveModeArgument = 0; - uint8_t rateArgument = 50; - uint8_t optionsMaskArgument = 0; - uint8_t optionsOverrideArgument = 0; - - return cluster.MoveHue(mOnSuccessCallback_3.Cancel(), mOnFailureCallback_3.Cancel(), moveModeArgument, rateArgument, - optionsMaskArgument, optionsOverrideArgument); + (static_cast(context))->OnFailureResponse_27(status); } - void OnFailureResponse_3(uint8_t status) { ThrowFailureResponse(); } - - void OnSuccessResponse_3() { NextTest(); } - - CHIP_ERROR TestMoveHueDownCommand_4() + static void OnSuccessCallback_27(void * context, uint64_t bitmap64) { - chip::Controller::ColorControlClusterTest cluster; - cluster.Associate(mDevice, 1); - - uint8_t moveModeArgument = 3; - uint8_t rateArgument = 50; - uint8_t optionsMaskArgument = 0; - uint8_t optionsOverrideArgument = 0; - - return cluster.MoveHue(mOnSuccessCallback_4.Cancel(), mOnFailureCallback_4.Cancel(), moveModeArgument, rateArgument, - optionsMaskArgument, optionsOverrideArgument); + (static_cast(context))->OnSuccessResponse_27(bitmap64); } - void OnFailureResponse_4(uint8_t status) { ThrowFailureResponse(); } - - void OnSuccessResponse_4() { NextTest(); } - - CHIP_ERROR TestMoveHueStopCommand_5() + static void OnFailureCallback_28(void * context, uint8_t status) { - chip::Controller::ColorControlClusterTest cluster; - cluster.Associate(mDevice, 1); - - uint8_t moveModeArgument = 0; - uint8_t rateArgument = 50; - uint8_t optionsMaskArgument = 0; - uint8_t optionsOverrideArgument = 0; - - return cluster.MoveHue(mOnSuccessCallback_5.Cancel(), mOnFailureCallback_5.Cancel(), moveModeArgument, rateArgument, - optionsMaskArgument, optionsOverrideArgument); + (static_cast(context))->OnFailureResponse_28(status); } - void OnFailureResponse_5(uint8_t status) { ThrowFailureResponse(); } - - void OnSuccessResponse_5() { NextTest(); } - - CHIP_ERROR TestTurnOffLightThatWeTurnedOn_6() + static void OnSuccessCallback_28(void * context, uint64_t bitmap64) { - chip::Controller::OnOffClusterTest cluster; - cluster.Associate(mDevice, 1); - - return cluster.Off(mOnSuccessCallback_6.Cancel(), mOnFailureCallback_6.Cancel()); + (static_cast(context))->OnSuccessResponse_28(bitmap64); } - void OnFailureResponse_6(uint8_t status) { ThrowFailureResponse(); } - - void OnSuccessResponse_6() { NextTest(); } - - CHIP_ERROR TestCheckOnOffAttributeValueIsFalseAfterOffCommand_7() + static void OnFailureCallback_29(void * context, uint8_t status) { - chip::Controller::OnOffClusterTest cluster; - cluster.Associate(mDevice, 1); - - return cluster.ReadAttributeOnOff(mOnSuccessCallback_7.Cancel(), mOnFailureCallback_7.Cancel()); + (static_cast(context))->OnFailureResponse_29(status); } - void OnFailureResponse_7(uint8_t status) { ThrowFailureResponse(); } - - void OnSuccessResponse_7(bool onOff) + static void OnSuccessCallback_29(void * context, uint64_t bitmap64) { - VerifyOrReturn(CheckValue("onOff", onOff, 0)); - NextTest(); + (static_cast(context))->OnSuccessResponse_29(bitmap64); } -}; - -class Test_TC_CC_3_3 : public TestCommand -{ -public: - Test_TC_CC_3_3() : TestCommand("Test_TC_CC_3_3"), mTestIndex(0) {} - /////////// TestCommand Interface ///////// - void NextTest() override + static void OnFailureCallback_30(void * context, uint8_t status) { - CHIP_ERROR err = CHIP_NO_ERROR; - - if (0 == mTestIndex) - { - ChipLogProgress(chipTool, " **** Test Start: Test_TC_CC_3_3\n"); - } - - if (mTestCount == mTestIndex) - { - ChipLogProgress(chipTool, " **** Test Complete: Test_TC_CC_3_3\n"); - SetCommandExitStatus(CHIP_NO_ERROR); - return; - } - - // Ensure we increment mTestIndex before we start running the relevant - // command. That way if we lose the timeslice after we send the message - // but before our function call returns, we won't end up with an - // incorrect mTestIndex value observed when we get the response. - switch (mTestIndex++) - { - case 0: - ChipLogProgress(chipTool, " ***** Test Step 0 : Turn on light for color control tests\n"); - err = TestTurnOnLightForColorControlTests_0(); - break; - case 1: - ChipLogProgress(chipTool, " ***** Test Step 1 : Check on/off attribute value is true after on command\n"); - err = TestCheckOnOffAttributeValueIsTrueAfterOnCommand_1(); - break; - case 2: - ChipLogProgress(chipTool, " ***** Test Step 2 : Step hue up command\n"); - err = TestStepHueUpCommand_2(); - break; - case 3: - ChipLogProgress(chipTool, " ***** Test Step 3 : Step hue down command\n"); - err = TestStepHueDownCommand_3(); - break; - case 4: - ChipLogProgress(chipTool, " ***** Test Step 4 : Turn off light that we turned on\n"); - err = TestTurnOffLightThatWeTurnedOn_4(); - break; - case 5: - ChipLogProgress(chipTool, " ***** Test Step 5 : Check on/off attribute value is false after off command\n"); - err = TestCheckOnOffAttributeValueIsFalseAfterOffCommand_5(); - break; - } - - if (CHIP_NO_ERROR != err) - { - ChipLogError(chipTool, " ***** Test Failure: %s\n", chip::ErrorStr(err)); - SetCommandExitStatus(err); - } + (static_cast(context))->OnFailureResponse_30(status); } -private: - std::atomic_uint16_t mTestIndex; - const uint16_t mTestCount = 6; - - chip::Callback::Callback mOnFailureCallback_0{ OnFailureCallback_0, this }; - chip::Callback::Callback mOnSuccessCallback_0{ OnSuccessCallback_0, this }; - chip::Callback::Callback mOnFailureCallback_1{ OnFailureCallback_1, this }; - chip::Callback::Callback mOnSuccessCallback_1{ OnSuccessCallback_1, this }; - chip::Callback::Callback mOnFailureCallback_2{ OnFailureCallback_2, this }; - chip::Callback::Callback mOnSuccessCallback_2{ OnSuccessCallback_2, this }; - chip::Callback::Callback mOnFailureCallback_3{ OnFailureCallback_3, this }; - chip::Callback::Callback mOnSuccessCallback_3{ OnSuccessCallback_3, this }; - chip::Callback::Callback mOnFailureCallback_4{ OnFailureCallback_4, this }; - chip::Callback::Callback mOnSuccessCallback_4{ OnSuccessCallback_4, this }; - chip::Callback::Callback mOnFailureCallback_5{ OnFailureCallback_5, this }; - chip::Callback::Callback mOnSuccessCallback_5{ OnSuccessCallback_5, this }; - - static void OnFailureCallback_0(void * context, uint8_t status) + static void OnSuccessCallback_30(void * context, uint8_t int8u) { - (static_cast(context))->OnFailureResponse_0(status); + (static_cast(context))->OnSuccessResponse_30(int8u); } - static void OnSuccessCallback_0(void * context) { (static_cast(context))->OnSuccessResponse_0(); } - - static void OnFailureCallback_1(void * context, uint8_t status) + static void OnFailureCallback_31(void * context, uint8_t status) { - (static_cast(context))->OnFailureResponse_1(status); + (static_cast(context))->OnFailureResponse_31(status); } - static void OnSuccessCallback_1(void * context, bool onOff) + static void OnSuccessCallback_31(void * context, uint8_t int8u) { - (static_cast(context))->OnSuccessResponse_1(onOff); + (static_cast(context))->OnSuccessResponse_31(int8u); } - static void OnFailureCallback_2(void * context, uint8_t status) + static void OnFailureCallback_32(void * context, uint8_t status) { - (static_cast(context))->OnFailureResponse_2(status); + (static_cast(context))->OnFailureResponse_32(status); } - static void OnSuccessCallback_2(void * context) { (static_cast(context))->OnSuccessResponse_2(); } - - static void OnFailureCallback_3(void * context, uint8_t status) + static void OnSuccessCallback_32(void * context, uint8_t int8u) { - (static_cast(context))->OnFailureResponse_3(status); + (static_cast(context))->OnSuccessResponse_32(int8u); } - static void OnSuccessCallback_3(void * context) { (static_cast(context))->OnSuccessResponse_3(); } - - static void OnFailureCallback_4(void * context, uint8_t status) + static void OnFailureCallback_33(void * context, uint8_t status) { - (static_cast(context))->OnFailureResponse_4(status); + (static_cast(context))->OnFailureResponse_33(status); } - static void OnSuccessCallback_4(void * context) { (static_cast(context))->OnSuccessResponse_4(); } - - static void OnFailureCallback_5(void * context, uint8_t status) + static void OnSuccessCallback_33(void * context, uint8_t int8u) { - (static_cast(context))->OnFailureResponse_5(status); + (static_cast(context))->OnSuccessResponse_33(int8u); } - static void OnSuccessCallback_5(void * context, bool onOff) + static void OnFailureCallback_34(void * context, uint8_t status) { - (static_cast(context))->OnSuccessResponse_5(onOff); + (static_cast(context))->OnFailureResponse_34(status); } - // - // Tests methods - // - - CHIP_ERROR TestTurnOnLightForColorControlTests_0() + static void OnSuccessCallback_34(void * context, uint8_t int8u) { - chip::Controller::OnOffClusterTest cluster; - cluster.Associate(mDevice, 1); - - return cluster.On(mOnSuccessCallback_0.Cancel(), mOnFailureCallback_0.Cancel()); + (static_cast(context))->OnSuccessResponse_34(int8u); } - void OnFailureResponse_0(uint8_t status) { ThrowFailureResponse(); } - - void OnSuccessResponse_0() { NextTest(); } - - CHIP_ERROR TestCheckOnOffAttributeValueIsTrueAfterOnCommand_1() + static void OnFailureCallback_35(void * context, uint8_t status) { - chip::Controller::OnOffClusterTest cluster; - cluster.Associate(mDevice, 1); - - return cluster.ReadAttributeOnOff(mOnSuccessCallback_1.Cancel(), mOnFailureCallback_1.Cancel()); + (static_cast(context))->OnFailureResponse_35(status); } - void OnFailureResponse_1(uint8_t status) { ThrowFailureResponse(); } - - void OnSuccessResponse_1(bool onOff) + static void OnSuccessCallback_35(void * context, uint16_t int16u) { - VerifyOrReturn(CheckValue("onOff", onOff, 1)); - NextTest(); + (static_cast(context))->OnSuccessResponse_35(int16u); } - CHIP_ERROR TestStepHueUpCommand_2() + static void OnFailureCallback_36(void * context, uint8_t status) { - chip::Controller::ColorControlClusterTest cluster; - cluster.Associate(mDevice, 1); - - uint8_t stepModeArgument = 1; - uint8_t stepSizeArgument = 5; - uint8_t transitionTimeArgument = 25; - uint8_t optionsMaskArgument = 0; - uint8_t optionsOverrideArgument = 0; - - return cluster.StepHue(mOnSuccessCallback_2.Cancel(), mOnFailureCallback_2.Cancel(), stepModeArgument, stepSizeArgument, - transitionTimeArgument, optionsMaskArgument, optionsOverrideArgument); + (static_cast(context))->OnFailureResponse_36(status); } - void OnFailureResponse_2(uint8_t status) { ThrowFailureResponse(); } + static void OnSuccessCallback_36(void * context, uint16_t int16u) + { + (static_cast(context))->OnSuccessResponse_36(int16u); + } - void OnSuccessResponse_2() { NextTest(); } + static void OnFailureCallback_37(void * context, uint8_t status) + { + (static_cast(context))->OnFailureResponse_37(status); + } - CHIP_ERROR TestStepHueDownCommand_3() + static void OnSuccessCallback_37(void * context, uint16_t int16u) { - chip::Controller::ColorControlClusterTest cluster; - cluster.Associate(mDevice, 1); + (static_cast(context))->OnSuccessResponse_37(int16u); + } - uint8_t stepModeArgument = 3; - uint8_t stepSizeArgument = 5; - uint8_t transitionTimeArgument = 25; - uint8_t optionsMaskArgument = 0; - uint8_t optionsOverrideArgument = 0; + static void OnFailureCallback_38(void * context, uint8_t status) + { + (static_cast(context))->OnFailureResponse_38(status); + } - return cluster.StepHue(mOnSuccessCallback_3.Cancel(), mOnFailureCallback_3.Cancel(), stepModeArgument, stepSizeArgument, - transitionTimeArgument, optionsMaskArgument, optionsOverrideArgument); + static void OnSuccessCallback_38(void * context, uint16_t int16u) + { + (static_cast(context))->OnSuccessResponse_38(int16u); } - void OnFailureResponse_3(uint8_t status) { ThrowFailureResponse(); } + static void OnFailureCallback_39(void * context, uint8_t status) + { + (static_cast(context))->OnFailureResponse_39(status); + } - void OnSuccessResponse_3() { NextTest(); } + static void OnSuccessCallback_39(void * context, uint16_t int16u) + { + (static_cast(context))->OnSuccessResponse_39(int16u); + } - CHIP_ERROR TestTurnOffLightThatWeTurnedOn_4() + static void OnFailureCallback_40(void * context, uint8_t status) { - chip::Controller::OnOffClusterTest cluster; - cluster.Associate(mDevice, 1); + (static_cast(context))->OnFailureResponse_40(status); + } - return cluster.Off(mOnSuccessCallback_4.Cancel(), mOnFailureCallback_4.Cancel()); + static void OnSuccessCallback_40(void * context, uint32_t int32u) + { + (static_cast(context))->OnSuccessResponse_40(int32u); } - void OnFailureResponse_4(uint8_t status) { ThrowFailureResponse(); } + static void OnFailureCallback_41(void * context, uint8_t status) + { + (static_cast(context))->OnFailureResponse_41(status); + } - void OnSuccessResponse_4() { NextTest(); } + static void OnSuccessCallback_41(void * context, uint32_t int32u) + { + (static_cast(context))->OnSuccessResponse_41(int32u); + } - CHIP_ERROR TestCheckOnOffAttributeValueIsFalseAfterOffCommand_5() + static void OnFailureCallback_42(void * context, uint8_t status) { - chip::Controller::OnOffClusterTest cluster; - cluster.Associate(mDevice, 1); + (static_cast(context))->OnFailureResponse_42(status); + } - return cluster.ReadAttributeOnOff(mOnSuccessCallback_5.Cancel(), mOnFailureCallback_5.Cancel()); + static void OnSuccessCallback_42(void * context, uint32_t int32u) + { + (static_cast(context))->OnSuccessResponse_42(int32u); } - void OnFailureResponse_5(uint8_t status) { ThrowFailureResponse(); } + static void OnFailureCallback_43(void * context, uint8_t status) + { + (static_cast(context))->OnFailureResponse_43(status); + } - void OnSuccessResponse_5(bool onOff) + static void OnSuccessCallback_43(void * context, uint32_t int32u) { - VerifyOrReturn(CheckValue("onOff", onOff, 0)); - NextTest(); + (static_cast(context))->OnSuccessResponse_43(int32u); } -}; -class Test_TC_CC_4_1 : public TestCommand -{ -public: - Test_TC_CC_4_1() : TestCommand("Test_TC_CC_4_1"), mTestIndex(0) {} + static void OnFailureCallback_44(void * context, uint8_t status) + { + (static_cast(context))->OnFailureResponse_44(status); + } - /////////// TestCommand Interface ///////// - void NextTest() override + static void OnSuccessCallback_44(void * context, uint32_t int32u) { - CHIP_ERROR err = CHIP_NO_ERROR; + (static_cast(context))->OnSuccessResponse_44(int32u); + } - if (0 == mTestIndex) - { - ChipLogProgress(chipTool, " **** Test Start: Test_TC_CC_4_1\n"); - } + static void OnFailureCallback_45(void * context, uint8_t status) + { + (static_cast(context))->OnFailureResponse_45(status); + } - if (mTestCount == mTestIndex) - { - ChipLogProgress(chipTool, " **** Test Complete: Test_TC_CC_4_1\n"); - SetCommandExitStatus(CHIP_NO_ERROR); - return; - } + static void OnSuccessCallback_45(void * context, uint64_t int64u) + { + (static_cast(context))->OnSuccessResponse_45(int64u); + } - // Ensure we increment mTestIndex before we start running the relevant - // command. That way if we lose the timeslice after we send the message - // but before our function call returns, we won't end up with an - // incorrect mTestIndex value observed when we get the response. - switch (mTestIndex++) - { - case 0: - ChipLogProgress(chipTool, " ***** Test Step 0 : Turn on light for color control tests\n"); - err = TestTurnOnLightForColorControlTests_0(); - break; - case 1: - ChipLogProgress(chipTool, " ***** Test Step 1 : Check on/off attribute value is true after on command\n"); - err = TestCheckOnOffAttributeValueIsTrueAfterOnCommand_1(); - break; - case 2: - ChipLogProgress(chipTool, " ***** Test Step 2 : Move to saturation command\n"); - err = TestMoveToSaturationCommand_2(); - break; - case 3: - ChipLogProgress(chipTool, " ***** Test Step 3 : Turn off light that we turned on\n"); - err = TestTurnOffLightThatWeTurnedOn_3(); - break; - case 4: - ChipLogProgress(chipTool, " ***** Test Step 4 : Check on/off attribute value is false after off command\n"); - err = TestCheckOnOffAttributeValueIsFalseAfterOffCommand_4(); - break; - } + static void OnFailureCallback_46(void * context, uint8_t status) + { + (static_cast(context))->OnFailureResponse_46(status); + } - if (CHIP_NO_ERROR != err) - { - ChipLogError(chipTool, " ***** Test Failure: %s\n", chip::ErrorStr(err)); - SetCommandExitStatus(err); - } + static void OnSuccessCallback_46(void * context, uint64_t int64u) + { + (static_cast(context))->OnSuccessResponse_46(int64u); } -private: - std::atomic_uint16_t mTestIndex; - const uint16_t mTestCount = 5; + static void OnFailureCallback_47(void * context, uint8_t status) + { + (static_cast(context))->OnFailureResponse_47(status); + } - chip::Callback::Callback mOnFailureCallback_0{ OnFailureCallback_0, this }; - chip::Callback::Callback mOnSuccessCallback_0{ OnSuccessCallback_0, this }; - chip::Callback::Callback mOnFailureCallback_1{ OnFailureCallback_1, this }; - chip::Callback::Callback mOnSuccessCallback_1{ OnSuccessCallback_1, this }; - chip::Callback::Callback mOnFailureCallback_2{ OnFailureCallback_2, this }; - chip::Callback::Callback mOnSuccessCallback_2{ OnSuccessCallback_2, this }; - chip::Callback::Callback mOnFailureCallback_3{ OnFailureCallback_3, this }; - chip::Callback::Callback mOnSuccessCallback_3{ OnSuccessCallback_3, this }; - chip::Callback::Callback mOnFailureCallback_4{ OnFailureCallback_4, this }; - chip::Callback::Callback mOnSuccessCallback_4{ OnSuccessCallback_4, this }; + static void OnSuccessCallback_47(void * context, uint64_t int64u) + { + (static_cast(context))->OnSuccessResponse_47(int64u); + } - static void OnFailureCallback_0(void * context, uint8_t status) + static void OnFailureCallback_48(void * context, uint8_t status) { - (static_cast(context))->OnFailureResponse_0(status); + (static_cast(context))->OnFailureResponse_48(status); } - static void OnSuccessCallback_0(void * context) { (static_cast(context))->OnSuccessResponse_0(); } + static void OnSuccessCallback_48(void * context, uint64_t int64u) + { + (static_cast(context))->OnSuccessResponse_48(int64u); + } - static void OnFailureCallback_1(void * context, uint8_t status) + static void OnFailureCallback_49(void * context, uint8_t status) { - (static_cast(context))->OnFailureResponse_1(status); + (static_cast(context))->OnFailureResponse_49(status); } - static void OnSuccessCallback_1(void * context, bool onOff) + static void OnSuccessCallback_49(void * context, uint64_t int64u) { - (static_cast(context))->OnSuccessResponse_1(onOff); + (static_cast(context))->OnSuccessResponse_49(int64u); } - static void OnFailureCallback_2(void * context, uint8_t status) + static void OnFailureCallback_50(void * context, uint8_t status) { - (static_cast(context))->OnFailureResponse_2(status); + (static_cast(context))->OnFailureResponse_50(status); } - static void OnSuccessCallback_2(void * context) { (static_cast(context))->OnSuccessResponse_2(); } + static void OnSuccessCallback_50(void * context, int8_t int8s) + { + (static_cast(context))->OnSuccessResponse_50(int8s); + } - static void OnFailureCallback_3(void * context, uint8_t status) + static void OnFailureCallback_51(void * context, uint8_t status) { - (static_cast(context))->OnFailureResponse_3(status); + (static_cast(context))->OnFailureResponse_51(status); } - static void OnSuccessCallback_3(void * context) { (static_cast(context))->OnSuccessResponse_3(); } + static void OnSuccessCallback_51(void * context, int8_t int8s) + { + (static_cast(context))->OnSuccessResponse_51(int8s); + } - static void OnFailureCallback_4(void * context, uint8_t status) + static void OnFailureCallback_52(void * context, uint8_t status) { - (static_cast(context))->OnFailureResponse_4(status); + (static_cast(context))->OnFailureResponse_52(status); } - static void OnSuccessCallback_4(void * context, bool onOff) + static void OnSuccessCallback_52(void * context, int8_t int8s) { - (static_cast(context))->OnSuccessResponse_4(onOff); + (static_cast(context))->OnSuccessResponse_52(int8s); } - // - // Tests methods - // + static void OnFailureCallback_53(void * context, uint8_t status) + { + (static_cast(context))->OnFailureResponse_53(status); + } - CHIP_ERROR TestTurnOnLightForColorControlTests_0() + static void OnSuccessCallback_53(void * context, int8_t int8s) { - chip::Controller::OnOffClusterTest cluster; - cluster.Associate(mDevice, 1); + (static_cast(context))->OnSuccessResponse_53(int8s); + } - return cluster.On(mOnSuccessCallback_0.Cancel(), mOnFailureCallback_0.Cancel()); + static void OnFailureCallback_54(void * context, uint8_t status) + { + (static_cast(context))->OnFailureResponse_54(status); } - void OnFailureResponse_0(uint8_t status) { ThrowFailureResponse(); } + static void OnSuccessCallback_54(void * context, int8_t int8s) + { + (static_cast(context))->OnSuccessResponse_54(int8s); + } - void OnSuccessResponse_0() { NextTest(); } + static void OnFailureCallback_55(void * context, uint8_t status) + { + (static_cast(context))->OnFailureResponse_55(status); + } - CHIP_ERROR TestCheckOnOffAttributeValueIsTrueAfterOnCommand_1() + static void OnSuccessCallback_55(void * context, int8_t int8s) { - chip::Controller::OnOffClusterTest cluster; - cluster.Associate(mDevice, 1); + (static_cast(context))->OnSuccessResponse_55(int8s); + } - return cluster.ReadAttributeOnOff(mOnSuccessCallback_1.Cancel(), mOnFailureCallback_1.Cancel()); + static void OnFailureCallback_56(void * context, uint8_t status) + { + (static_cast(context))->OnFailureResponse_56(status); } - void OnFailureResponse_1(uint8_t status) { ThrowFailureResponse(); } + static void OnSuccessCallback_56(void * context, int8_t int8s) + { + (static_cast(context))->OnSuccessResponse_56(int8s); + } - void OnSuccessResponse_1(bool onOff) + static void OnFailureCallback_57(void * context, uint8_t status) { - VerifyOrReturn(CheckValue("onOff", onOff, 1)); - NextTest(); + (static_cast(context))->OnFailureResponse_57(status); } - CHIP_ERROR TestMoveToSaturationCommand_2() + static void OnSuccessCallback_57(void * context, int16_t int16s) { - chip::Controller::ColorControlClusterTest cluster; - cluster.Associate(mDevice, 1); + (static_cast(context))->OnSuccessResponse_57(int16s); + } - uint8_t saturationArgument = 90; - uint16_t transitionTimeArgument = 10U; - uint8_t optionsMaskArgument = 0; - uint8_t optionsOverrideArgument = 0; + static void OnFailureCallback_58(void * context, uint8_t status) + { + (static_cast(context))->OnFailureResponse_58(status); + } - return cluster.MoveToSaturation(mOnSuccessCallback_2.Cancel(), mOnFailureCallback_2.Cancel(), saturationArgument, - transitionTimeArgument, optionsMaskArgument, optionsOverrideArgument); + static void OnSuccessCallback_58(void * context, int16_t int16s) + { + (static_cast(context))->OnSuccessResponse_58(int16s); } - void OnFailureResponse_2(uint8_t status) { ThrowFailureResponse(); } + static void OnFailureCallback_59(void * context, uint8_t status) + { + (static_cast(context))->OnFailureResponse_59(status); + } - void OnSuccessResponse_2() { NextTest(); } + static void OnSuccessCallback_59(void * context, int16_t int16s) + { + (static_cast(context))->OnSuccessResponse_59(int16s); + } - CHIP_ERROR TestTurnOffLightThatWeTurnedOn_3() + static void OnFailureCallback_60(void * context, uint8_t status) { - chip::Controller::OnOffClusterTest cluster; - cluster.Associate(mDevice, 1); + (static_cast(context))->OnFailureResponse_60(status); + } - return cluster.Off(mOnSuccessCallback_3.Cancel(), mOnFailureCallback_3.Cancel()); + static void OnSuccessCallback_60(void * context, int16_t int16s) + { + (static_cast(context))->OnSuccessResponse_60(int16s); } - void OnFailureResponse_3(uint8_t status) { ThrowFailureResponse(); } + static void OnFailureCallback_61(void * context, uint8_t status) + { + (static_cast(context))->OnFailureResponse_61(status); + } - void OnSuccessResponse_3() { NextTest(); } + static void OnSuccessCallback_61(void * context, int16_t int16s) + { + (static_cast(context))->OnSuccessResponse_61(int16s); + } - CHIP_ERROR TestCheckOnOffAttributeValueIsFalseAfterOffCommand_4() + static void OnFailureCallback_62(void * context, uint8_t status) { - chip::Controller::OnOffClusterTest cluster; - cluster.Associate(mDevice, 1); + (static_cast(context))->OnFailureResponse_62(status); + } - return cluster.ReadAttributeOnOff(mOnSuccessCallback_4.Cancel(), mOnFailureCallback_4.Cancel()); + static void OnSuccessCallback_62(void * context, int16_t int16s) + { + (static_cast(context))->OnSuccessResponse_62(int16s); } - void OnFailureResponse_4(uint8_t status) { ThrowFailureResponse(); } + static void OnFailureCallback_63(void * context, uint8_t status) + { + (static_cast(context))->OnFailureResponse_63(status); + } - void OnSuccessResponse_4(bool onOff) + static void OnSuccessCallback_63(void * context, int16_t int16s) { - VerifyOrReturn(CheckValue("onOff", onOff, 0)); - NextTest(); + (static_cast(context))->OnSuccessResponse_63(int16s); } -}; -class Test_TC_CC_4_2 : public TestCommand -{ -public: - Test_TC_CC_4_2() : TestCommand("Test_TC_CC_4_2"), mTestIndex(0) {} + static void OnFailureCallback_64(void * context, uint8_t status) + { + (static_cast(context))->OnFailureResponse_64(status); + } - /////////// TestCommand Interface ///////// - void NextTest() override + static void OnSuccessCallback_64(void * context, int32_t int32s) { - CHIP_ERROR err = CHIP_NO_ERROR; + (static_cast(context))->OnSuccessResponse_64(int32s); + } - if (0 == mTestIndex) - { - ChipLogProgress(chipTool, " **** Test Start: Test_TC_CC_4_2\n"); - } + static void OnFailureCallback_65(void * context, uint8_t status) + { + (static_cast(context))->OnFailureResponse_65(status); + } - if (mTestCount == mTestIndex) - { - ChipLogProgress(chipTool, " **** Test Complete: Test_TC_CC_4_2\n"); - SetCommandExitStatus(CHIP_NO_ERROR); - return; - } + static void OnSuccessCallback_65(void * context, int32_t int32s) + { + (static_cast(context))->OnSuccessResponse_65(int32s); + } - // Ensure we increment mTestIndex before we start running the relevant - // command. That way if we lose the timeslice after we send the message - // but before our function call returns, we won't end up with an - // incorrect mTestIndex value observed when we get the response. - switch (mTestIndex++) - { - case 0: - ChipLogProgress(chipTool, " ***** Test Step 0 : Turn on light for color control tests\n"); - err = TestTurnOnLightForColorControlTests_0(); - break; - case 1: - ChipLogProgress(chipTool, " ***** Test Step 1 : Check on/off attribute value is true after on command\n"); - err = TestCheckOnOffAttributeValueIsTrueAfterOnCommand_1(); - break; - case 2: - ChipLogProgress(chipTool, " ***** Test Step 2 : Move saturation up command\n"); - err = TestMoveSaturationUpCommand_2(); - break; - case 3: - ChipLogProgress(chipTool, " ***** Test Step 3 : Move saturation down command\n"); - err = TestMoveSaturationDownCommand_3(); - break; - case 4: - ChipLogProgress(chipTool, " ***** Test Step 4 : Turn off light that we turned on\n"); - err = TestTurnOffLightThatWeTurnedOn_4(); - break; - case 5: - ChipLogProgress(chipTool, " ***** Test Step 5 : Check on/off attribute value is false after off command\n"); - err = TestCheckOnOffAttributeValueIsFalseAfterOffCommand_5(); - break; - } + static void OnFailureCallback_66(void * context, uint8_t status) + { + (static_cast(context))->OnFailureResponse_66(status); + } - if (CHIP_NO_ERROR != err) - { - ChipLogError(chipTool, " ***** Test Failure: %s\n", chip::ErrorStr(err)); - SetCommandExitStatus(err); - } + static void OnSuccessCallback_66(void * context, int32_t int32s) + { + (static_cast(context))->OnSuccessResponse_66(int32s); } -private: - std::atomic_uint16_t mTestIndex; - const uint16_t mTestCount = 6; + static void OnFailureCallback_67(void * context, uint8_t status) + { + (static_cast(context))->OnFailureResponse_67(status); + } - chip::Callback::Callback mOnFailureCallback_0{ OnFailureCallback_0, this }; - chip::Callback::Callback mOnSuccessCallback_0{ OnSuccessCallback_0, this }; - chip::Callback::Callback mOnFailureCallback_1{ OnFailureCallback_1, this }; - chip::Callback::Callback mOnSuccessCallback_1{ OnSuccessCallback_1, this }; - chip::Callback::Callback mOnFailureCallback_2{ OnFailureCallback_2, this }; - chip::Callback::Callback mOnSuccessCallback_2{ OnSuccessCallback_2, this }; - chip::Callback::Callback mOnFailureCallback_3{ OnFailureCallback_3, this }; - chip::Callback::Callback mOnSuccessCallback_3{ OnSuccessCallback_3, this }; - chip::Callback::Callback mOnFailureCallback_4{ OnFailureCallback_4, this }; - chip::Callback::Callback mOnSuccessCallback_4{ OnSuccessCallback_4, this }; - chip::Callback::Callback mOnFailureCallback_5{ OnFailureCallback_5, this }; - chip::Callback::Callback mOnSuccessCallback_5{ OnSuccessCallback_5, this }; + static void OnSuccessCallback_67(void * context, int32_t int32s) + { + (static_cast(context))->OnSuccessResponse_67(int32s); + } - static void OnFailureCallback_0(void * context, uint8_t status) + static void OnFailureCallback_68(void * context, uint8_t status) { - (static_cast(context))->OnFailureResponse_0(status); + (static_cast(context))->OnFailureResponse_68(status); } - static void OnSuccessCallback_0(void * context) { (static_cast(context))->OnSuccessResponse_0(); } - - static void OnFailureCallback_1(void * context, uint8_t status) + static void OnSuccessCallback_68(void * context, int32_t int32s) { - (static_cast(context))->OnFailureResponse_1(status); + (static_cast(context))->OnSuccessResponse_68(int32s); } - static void OnSuccessCallback_1(void * context, bool onOff) + static void OnFailureCallback_69(void * context, uint8_t status) { - (static_cast(context))->OnSuccessResponse_1(onOff); + (static_cast(context))->OnFailureResponse_69(status); } - static void OnFailureCallback_2(void * context, uint8_t status) + static void OnSuccessCallback_69(void * context, int32_t int32s) { - (static_cast(context))->OnFailureResponse_2(status); + (static_cast(context))->OnSuccessResponse_69(int32s); } - static void OnSuccessCallback_2(void * context) { (static_cast(context))->OnSuccessResponse_2(); } - - static void OnFailureCallback_3(void * context, uint8_t status) + static void OnFailureCallback_70(void * context, uint8_t status) { - (static_cast(context))->OnFailureResponse_3(status); + (static_cast(context))->OnFailureResponse_70(status); } - static void OnSuccessCallback_3(void * context) { (static_cast(context))->OnSuccessResponse_3(); } + static void OnSuccessCallback_70(void * context, int32_t int32s) + { + (static_cast(context))->OnSuccessResponse_70(int32s); + } - static void OnFailureCallback_4(void * context, uint8_t status) + static void OnFailureCallback_71(void * context, uint8_t status) { - (static_cast(context))->OnFailureResponse_4(status); + (static_cast(context))->OnFailureResponse_71(status); } - static void OnSuccessCallback_4(void * context) { (static_cast(context))->OnSuccessResponse_4(); } + static void OnSuccessCallback_71(void * context, int64_t int64s) + { + (static_cast(context))->OnSuccessResponse_71(int64s); + } - static void OnFailureCallback_5(void * context, uint8_t status) + static void OnFailureCallback_72(void * context, uint8_t status) { - (static_cast(context))->OnFailureResponse_5(status); + (static_cast(context))->OnFailureResponse_72(status); } - static void OnSuccessCallback_5(void * context, bool onOff) + static void OnSuccessCallback_72(void * context, int64_t int64s) { - (static_cast(context))->OnSuccessResponse_5(onOff); + (static_cast(context))->OnSuccessResponse_72(int64s); } - // - // Tests methods - // + static void OnFailureCallback_73(void * context, uint8_t status) + { + (static_cast(context))->OnFailureResponse_73(status); + } - CHIP_ERROR TestTurnOnLightForColorControlTests_0() + static void OnSuccessCallback_73(void * context, int64_t int64s) { - chip::Controller::OnOffClusterTest cluster; - cluster.Associate(mDevice, 1); + (static_cast(context))->OnSuccessResponse_73(int64s); + } - return cluster.On(mOnSuccessCallback_0.Cancel(), mOnFailureCallback_0.Cancel()); + static void OnFailureCallback_74(void * context, uint8_t status) + { + (static_cast(context))->OnFailureResponse_74(status); } - void OnFailureResponse_0(uint8_t status) { ThrowFailureResponse(); } + static void OnSuccessCallback_74(void * context, int64_t int64s) + { + (static_cast(context))->OnSuccessResponse_74(int64s); + } - void OnSuccessResponse_0() { NextTest(); } + static void OnFailureCallback_75(void * context, uint8_t status) + { + (static_cast(context))->OnFailureResponse_75(status); + } - CHIP_ERROR TestCheckOnOffAttributeValueIsTrueAfterOnCommand_1() + static void OnSuccessCallback_75(void * context, int64_t int64s) { - chip::Controller::OnOffClusterTest cluster; - cluster.Associate(mDevice, 1); + (static_cast(context))->OnSuccessResponse_75(int64s); + } - return cluster.ReadAttributeOnOff(mOnSuccessCallback_1.Cancel(), mOnFailureCallback_1.Cancel()); + static void OnFailureCallback_76(void * context, uint8_t status) + { + (static_cast(context))->OnFailureResponse_76(status); } - void OnFailureResponse_1(uint8_t status) { ThrowFailureResponse(); } + static void OnSuccessCallback_76(void * context, int64_t int64s) + { + (static_cast(context))->OnSuccessResponse_76(int64s); + } - void OnSuccessResponse_1(bool onOff) + static void OnFailureCallback_77(void * context, uint8_t status) { - VerifyOrReturn(CheckValue("onOff", onOff, 1)); - NextTest(); + (static_cast(context))->OnFailureResponse_77(status); } - CHIP_ERROR TestMoveSaturationUpCommand_2() + static void OnSuccessCallback_77(void * context, int64_t int64s) { - chip::Controller::ColorControlClusterTest cluster; - cluster.Associate(mDevice, 1); + (static_cast(context))->OnSuccessResponse_77(int64s); + } - uint8_t moveModeArgument = 1; - uint8_t rateArgument = 5; - uint8_t optionsMaskArgument = 0; - uint8_t optionsOverrideArgument = 0; + static void OnFailureCallback_78(void * context, uint8_t status) + { + (static_cast(context))->OnFailureResponse_78(status); + } - return cluster.MoveSaturation(mOnSuccessCallback_2.Cancel(), mOnFailureCallback_2.Cancel(), moveModeArgument, rateArgument, - optionsMaskArgument, optionsOverrideArgument); + static void OnSuccessCallback_78(void * context, uint8_t enum8) + { + (static_cast(context))->OnSuccessResponse_78(enum8); } - void OnFailureResponse_2(uint8_t status) { ThrowFailureResponse(); } + static void OnFailureCallback_79(void * context, uint8_t status) + { + (static_cast(context))->OnFailureResponse_79(status); + } - void OnSuccessResponse_2() { NextTest(); } + static void OnSuccessCallback_79(void * context, uint8_t enum8) + { + (static_cast(context))->OnSuccessResponse_79(enum8); + } - CHIP_ERROR TestMoveSaturationDownCommand_3() + static void OnFailureCallback_80(void * context, uint8_t status) { - chip::Controller::ColorControlClusterTest cluster; - cluster.Associate(mDevice, 1); + (static_cast(context))->OnFailureResponse_80(status); + } - uint8_t moveModeArgument = 3; - uint8_t rateArgument = 5; - uint8_t optionsMaskArgument = 0; - uint8_t optionsOverrideArgument = 0; + static void OnSuccessCallback_80(void * context, uint8_t enum8) + { + (static_cast(context))->OnSuccessResponse_80(enum8); + } - return cluster.MoveSaturation(mOnSuccessCallback_3.Cancel(), mOnFailureCallback_3.Cancel(), moveModeArgument, rateArgument, - optionsMaskArgument, optionsOverrideArgument); + static void OnFailureCallback_81(void * context, uint8_t status) + { + (static_cast(context))->OnFailureResponse_81(status); } - void OnFailureResponse_3(uint8_t status) { ThrowFailureResponse(); } + static void OnSuccessCallback_81(void * context, uint8_t enum8) + { + (static_cast(context))->OnSuccessResponse_81(enum8); + } - void OnSuccessResponse_3() { NextTest(); } + static void OnFailureCallback_82(void * context, uint8_t status) + { + (static_cast(context))->OnFailureResponse_82(status); + } - CHIP_ERROR TestTurnOffLightThatWeTurnedOn_4() + static void OnSuccessCallback_82(void * context, uint8_t enum8) { - chip::Controller::OnOffClusterTest cluster; - cluster.Associate(mDevice, 1); + (static_cast(context))->OnSuccessResponse_82(enum8); + } - return cluster.Off(mOnSuccessCallback_4.Cancel(), mOnFailureCallback_4.Cancel()); + static void OnFailureCallback_83(void * context, uint8_t status) + { + (static_cast(context))->OnFailureResponse_83(status); } - void OnFailureResponse_4(uint8_t status) { ThrowFailureResponse(); } + static void OnSuccessCallback_83(void * context, uint16_t enum16) + { + (static_cast(context))->OnSuccessResponse_83(enum16); + } - void OnSuccessResponse_4() { NextTest(); } + static void OnFailureCallback_84(void * context, uint8_t status) + { + (static_cast(context))->OnFailureResponse_84(status); + } - CHIP_ERROR TestCheckOnOffAttributeValueIsFalseAfterOffCommand_5() + static void OnSuccessCallback_84(void * context, uint16_t enum16) { - chip::Controller::OnOffClusterTest cluster; - cluster.Associate(mDevice, 1); + (static_cast(context))->OnSuccessResponse_84(enum16); + } - return cluster.ReadAttributeOnOff(mOnSuccessCallback_5.Cancel(), mOnFailureCallback_5.Cancel()); + static void OnFailureCallback_85(void * context, uint8_t status) + { + (static_cast(context))->OnFailureResponse_85(status); } - void OnFailureResponse_5(uint8_t status) { ThrowFailureResponse(); } + static void OnSuccessCallback_85(void * context, uint16_t enum16) + { + (static_cast(context))->OnSuccessResponse_85(enum16); + } - void OnSuccessResponse_5(bool onOff) + static void OnFailureCallback_86(void * context, uint8_t status) { - VerifyOrReturn(CheckValue("onOff", onOff, 0)); - NextTest(); + (static_cast(context))->OnFailureResponse_86(status); } -}; -class Test_TC_CC_4_3 : public TestCommand -{ -public: - Test_TC_CC_4_3() : TestCommand("Test_TC_CC_4_3"), mTestIndex(0) {} + static void OnSuccessCallback_86(void * context, uint16_t enum16) + { + (static_cast(context))->OnSuccessResponse_86(enum16); + } - /////////// TestCommand Interface ///////// - void NextTest() override + static void OnFailureCallback_87(void * context, uint8_t status) { - CHIP_ERROR err = CHIP_NO_ERROR; + (static_cast(context))->OnFailureResponse_87(status); + } - if (0 == mTestIndex) - { - ChipLogProgress(chipTool, " **** Test Start: Test_TC_CC_4_3\n"); - } + static void OnSuccessCallback_87(void * context, uint16_t enum16) + { + (static_cast(context))->OnSuccessResponse_87(enum16); + } - if (mTestCount == mTestIndex) - { - ChipLogProgress(chipTool, " **** Test Complete: Test_TC_CC_4_3\n"); - SetCommandExitStatus(CHIP_NO_ERROR); - return; - } + static void OnFailureCallback_88(void * context, uint8_t status) + { + (static_cast(context))->OnFailureResponse_88(status); + } - // Ensure we increment mTestIndex before we start running the relevant - // command. That way if we lose the timeslice after we send the message - // but before our function call returns, we won't end up with an - // incorrect mTestIndex value observed when we get the response. - switch (mTestIndex++) - { - case 0: - ChipLogProgress(chipTool, " ***** Test Step 0 : Turn on light for color control tests\n"); - err = TestTurnOnLightForColorControlTests_0(); - break; - case 1: - ChipLogProgress(chipTool, " ***** Test Step 1 : Check on/off attribute value is true after on command\n"); - err = TestCheckOnOffAttributeValueIsTrueAfterOnCommand_1(); - break; - case 2: - ChipLogProgress(chipTool, " ***** Test Step 2 : Step saturation up command\n"); - err = TestStepSaturationUpCommand_2(); - break; - case 3: - ChipLogProgress(chipTool, " ***** Test Step 3 : Step saturation down command\n"); - err = TestStepSaturationDownCommand_3(); - break; - case 4: - ChipLogProgress(chipTool, " ***** Test Step 4 : Turn off light that we turned on\n"); - err = TestTurnOffLightThatWeTurnedOn_4(); - break; - case 5: - ChipLogProgress(chipTool, " ***** Test Step 5 : Check on/off attribute value is false after off command\n"); - err = TestCheckOnOffAttributeValueIsFalseAfterOffCommand_5(); - break; - } + static void OnSuccessCallback_88(void * context, chip::ByteSpan octetString) + { + (static_cast(context))->OnSuccessResponse_88(octetString); + } - if (CHIP_NO_ERROR != err) - { - ChipLogError(chipTool, " ***** Test Failure: %s\n", chip::ErrorStr(err)); - SetCommandExitStatus(err); - } + static void OnFailureCallback_89(void * context, uint8_t status) + { + (static_cast(context))->OnFailureResponse_89(status); } -private: - std::atomic_uint16_t mTestIndex; - const uint16_t mTestCount = 6; + static void OnSuccessCallback_89(void * context, chip::ByteSpan octetString) + { + (static_cast(context))->OnSuccessResponse_89(octetString); + } - chip::Callback::Callback mOnFailureCallback_0{ OnFailureCallback_0, this }; - chip::Callback::Callback mOnSuccessCallback_0{ OnSuccessCallback_0, this }; - chip::Callback::Callback mOnFailureCallback_1{ OnFailureCallback_1, this }; - chip::Callback::Callback mOnSuccessCallback_1{ OnSuccessCallback_1, this }; - chip::Callback::Callback mOnFailureCallback_2{ OnFailureCallback_2, this }; - chip::Callback::Callback mOnSuccessCallback_2{ OnSuccessCallback_2, this }; - chip::Callback::Callback mOnFailureCallback_3{ OnFailureCallback_3, this }; - chip::Callback::Callback mOnSuccessCallback_3{ OnSuccessCallback_3, this }; - chip::Callback::Callback mOnFailureCallback_4{ OnFailureCallback_4, this }; - chip::Callback::Callback mOnSuccessCallback_4{ OnSuccessCallback_4, this }; - chip::Callback::Callback mOnFailureCallback_5{ OnFailureCallback_5, this }; - chip::Callback::Callback mOnSuccessCallback_5{ OnSuccessCallback_5, this }; + static void OnFailureCallback_90(void * context, uint8_t status) + { + (static_cast(context))->OnFailureResponse_90(status); + } - static void OnFailureCallback_0(void * context, uint8_t status) + static void OnSuccessCallback_90(void * context, chip::ByteSpan octetString) { - (static_cast(context))->OnFailureResponse_0(status); + (static_cast(context))->OnSuccessResponse_90(octetString); } - static void OnSuccessCallback_0(void * context) { (static_cast(context))->OnSuccessResponse_0(); } + static void OnFailureCallback_91(void * context, uint8_t status) + { + (static_cast(context))->OnFailureResponse_91(status); + } - static void OnFailureCallback_1(void * context, uint8_t status) + static void OnSuccessCallback_91(void * context, chip::ByteSpan octetString) { - (static_cast(context))->OnFailureResponse_1(status); + (static_cast(context))->OnSuccessResponse_91(octetString); } - static void OnSuccessCallback_1(void * context, bool onOff) + static void OnFailureCallback_92(void * context, uint8_t status) { - (static_cast(context))->OnSuccessResponse_1(onOff); + (static_cast(context))->OnFailureResponse_92(status); } - static void OnFailureCallback_2(void * context, uint8_t status) + static void OnSuccessCallback_92(void * context, chip::ByteSpan octetString) { - (static_cast(context))->OnFailureResponse_2(status); + (static_cast(context))->OnSuccessResponse_92(octetString); } - static void OnSuccessCallback_2(void * context) { (static_cast(context))->OnSuccessResponse_2(); } + static void OnFailureCallback_93(void * context, uint8_t status) + { + (static_cast(context))->OnFailureResponse_93(status); + } - static void OnFailureCallback_3(void * context, uint8_t status) + static void OnSuccessCallback_93(void * context, chip::ByteSpan octetString) { - (static_cast(context))->OnFailureResponse_3(status); + (static_cast(context))->OnSuccessResponse_93(octetString); } - static void OnSuccessCallback_3(void * context) { (static_cast(context))->OnSuccessResponse_3(); } + static void OnFailureCallback_94(void * context, uint8_t status) + { + (static_cast(context))->OnFailureResponse_94(status); + } - static void OnFailureCallback_4(void * context, uint8_t status) + static void OnSuccessCallback_94(void * context, chip::ByteSpan longOctetString) { - (static_cast(context))->OnFailureResponse_4(status); + (static_cast(context))->OnSuccessResponse_94(longOctetString); } - static void OnSuccessCallback_4(void * context) { (static_cast(context))->OnSuccessResponse_4(); } + static void OnFailureCallback_95(void * context, uint8_t status) + { + (static_cast(context))->OnFailureResponse_95(status); + } - static void OnFailureCallback_5(void * context, uint8_t status) + static void OnSuccessCallback_95(void * context, chip::ByteSpan longOctetString) { - (static_cast(context))->OnFailureResponse_5(status); + (static_cast(context))->OnSuccessResponse_95(longOctetString); } - static void OnSuccessCallback_5(void * context, bool onOff) + static void OnFailureCallback_96(void * context, uint8_t status) { - (static_cast(context))->OnSuccessResponse_5(onOff); + (static_cast(context))->OnFailureResponse_96(status); } - // - // Tests methods - // + static void OnSuccessCallback_96(void * context, chip::ByteSpan longOctetString) + { + (static_cast(context))->OnSuccessResponse_96(longOctetString); + } - CHIP_ERROR TestTurnOnLightForColorControlTests_0() + static void OnFailureCallback_97(void * context, uint8_t status) { - chip::Controller::OnOffClusterTest cluster; - cluster.Associate(mDevice, 1); + (static_cast(context))->OnFailureResponse_97(status); + } - return cluster.On(mOnSuccessCallback_0.Cancel(), mOnFailureCallback_0.Cancel()); + static void OnSuccessCallback_97(void * context, chip::ByteSpan longOctetString) + { + (static_cast(context))->OnSuccessResponse_97(longOctetString); } - void OnFailureResponse_0(uint8_t status) { ThrowFailureResponse(); } + static void OnFailureCallback_98(void * context, uint8_t status) + { + (static_cast(context))->OnFailureResponse_98(status); + } - void OnSuccessResponse_0() { NextTest(); } + static void OnSuccessCallback_98(void * context, chip::ByteSpan charString) + { + (static_cast(context))->OnSuccessResponse_98(charString); + } - CHIP_ERROR TestCheckOnOffAttributeValueIsTrueAfterOnCommand_1() + static void OnFailureCallback_99(void * context, uint8_t status) { - chip::Controller::OnOffClusterTest cluster; - cluster.Associate(mDevice, 1); + (static_cast(context))->OnFailureResponse_99(status); + } - return cluster.ReadAttributeOnOff(mOnSuccessCallback_1.Cancel(), mOnFailureCallback_1.Cancel()); + static void OnSuccessCallback_99(void * context, chip::ByteSpan charString) + { + (static_cast(context))->OnSuccessResponse_99(charString); } - void OnFailureResponse_1(uint8_t status) { ThrowFailureResponse(); } + static void OnFailureCallback_100(void * context, uint8_t status) + { + (static_cast(context))->OnFailureResponse_100(status); + } - void OnSuccessResponse_1(bool onOff) + static void OnSuccessCallback_100(void * context, chip::ByteSpan charString) { - VerifyOrReturn(CheckValue("onOff", onOff, 1)); - NextTest(); + (static_cast(context))->OnSuccessResponse_100(charString); } - CHIP_ERROR TestStepSaturationUpCommand_2() + static void OnFailureCallback_101(void * context, uint8_t status) { - chip::Controller::ColorControlClusterTest cluster; - cluster.Associate(mDevice, 1); + (static_cast(context))->OnFailureResponse_101(status); + } - uint8_t stepModeArgument = 1; - uint8_t stepSizeArgument = 15; - uint8_t transitionTimeArgument = 10; - uint8_t optionsMaskArgument = 0; - uint8_t optionsOverrideArgument = 0; + static void OnSuccessCallback_101(void * context, chip::ByteSpan charString) + { + (static_cast(context))->OnSuccessResponse_101(charString); + } - return cluster.StepSaturation(mOnSuccessCallback_2.Cancel(), mOnFailureCallback_2.Cancel(), stepModeArgument, - stepSizeArgument, transitionTimeArgument, optionsMaskArgument, optionsOverrideArgument); + static void OnFailureCallback_102(void * context, uint8_t status) + { + (static_cast(context))->OnFailureResponse_102(status); } - void OnFailureResponse_2(uint8_t status) { ThrowFailureResponse(); } + static void OnSuccessCallback_102(void * context, chip::ByteSpan longCharString) + { + (static_cast(context))->OnSuccessResponse_102(longCharString); + } - void OnSuccessResponse_2() { NextTest(); } + static void OnFailureCallback_103(void * context, uint8_t status) + { + (static_cast(context))->OnFailureResponse_103(status); + } - CHIP_ERROR TestStepSaturationDownCommand_3() + static void OnSuccessCallback_103(void * context, chip::ByteSpan longCharString) { - chip::Controller::ColorControlClusterTest cluster; - cluster.Associate(mDevice, 1); + (static_cast(context))->OnSuccessResponse_103(longCharString); + } - uint8_t stepModeArgument = 3; - uint8_t stepSizeArgument = 20; - uint8_t transitionTimeArgument = 10; - uint8_t optionsMaskArgument = 0; - uint8_t optionsOverrideArgument = 0; + static void OnFailureCallback_104(void * context, uint8_t status) + { + (static_cast(context))->OnFailureResponse_104(status); + } - return cluster.StepSaturation(mOnSuccessCallback_3.Cancel(), mOnFailureCallback_3.Cancel(), stepModeArgument, - stepSizeArgument, transitionTimeArgument, optionsMaskArgument, optionsOverrideArgument); + static void OnSuccessCallback_104(void * context, chip::ByteSpan longCharString) + { + (static_cast(context))->OnSuccessResponse_104(longCharString); } - void OnFailureResponse_3(uint8_t status) { ThrowFailureResponse(); } + static void OnFailureCallback_105(void * context, uint8_t status) + { + (static_cast(context))->OnFailureResponse_105(status); + } - void OnSuccessResponse_3() { NextTest(); } + static void OnSuccessCallback_105(void * context, chip::ByteSpan longCharString) + { + (static_cast(context))->OnSuccessResponse_105(longCharString); + } - CHIP_ERROR TestTurnOffLightThatWeTurnedOn_4() + static void OnFailureCallback_106(void * context, uint8_t status) { - chip::Controller::OnOffClusterTest cluster; - cluster.Associate(mDevice, 1); + (static_cast(context))->OnFailureResponse_106(status); + } - return cluster.Off(mOnSuccessCallback_4.Cancel(), mOnFailureCallback_4.Cancel()); + static void OnSuccessCallback_106(void * context, uint16_t count, uint8_t * listInt8u) + { + (static_cast(context))->OnSuccessResponse_106(count, listInt8u); } - void OnFailureResponse_4(uint8_t status) { ThrowFailureResponse(); } + static void OnFailureCallback_107(void * context, uint8_t status) + { + (static_cast(context))->OnFailureResponse_107(status); + } - void OnSuccessResponse_4() { NextTest(); } + static void OnSuccessCallback_107(void * context, uint16_t count, chip::ByteSpan * listOctetString) + { + (static_cast(context))->OnSuccessResponse_107(count, listOctetString); + } - CHIP_ERROR TestCheckOnOffAttributeValueIsFalseAfterOffCommand_5() + static void OnFailureCallback_108(void * context, uint8_t status) { - chip::Controller::OnOffClusterTest cluster; - cluster.Associate(mDevice, 1); + (static_cast(context))->OnFailureResponse_108(status); + } - return cluster.ReadAttributeOnOff(mOnSuccessCallback_5.Cancel(), mOnFailureCallback_5.Cancel()); + static void OnSuccessCallback_108(void * context, uint16_t count, _TestListStructOctet * listStructOctetString) + { + (static_cast(context))->OnSuccessResponse_108(count, listStructOctetString); } - void OnFailureResponse_5(uint8_t status) { ThrowFailureResponse(); } + static void OnFailureCallback_109(void * context, uint8_t status) + { + (static_cast(context))->OnFailureResponse_109(status); + } + + static void OnSuccessCallback_109(void * context, uint64_t epochUs) + { + (static_cast(context))->OnSuccessResponse_109(epochUs); + } + + static void OnFailureCallback_110(void * context, uint8_t status) + { + (static_cast(context))->OnFailureResponse_110(status); + } + + static void OnSuccessCallback_110(void * context, uint64_t epochUs) + { + (static_cast(context))->OnSuccessResponse_110(epochUs); + } + + static void OnFailureCallback_111(void * context, uint8_t status) + { + (static_cast(context))->OnFailureResponse_111(status); + } + + static void OnSuccessCallback_111(void * context, uint64_t epochUs) + { + (static_cast(context))->OnSuccessResponse_111(epochUs); + } + + static void OnFailureCallback_112(void * context, uint8_t status) + { + (static_cast(context))->OnFailureResponse_112(status); + } - void OnSuccessResponse_5(bool onOff) + static void OnSuccessCallback_112(void * context, uint64_t epochUs) { - VerifyOrReturn(CheckValue("onOff", onOff, 0)); - NextTest(); + (static_cast(context))->OnSuccessResponse_112(epochUs); } -}; - -class Test_TC_CC_4_4 : public TestCommand -{ -public: - Test_TC_CC_4_4() : TestCommand("Test_TC_CC_4_4"), mTestIndex(0) {} - /////////// TestCommand Interface ///////// - void NextTest() override + static void OnFailureCallback_113(void * context, uint8_t status) { - CHIP_ERROR err = CHIP_NO_ERROR; + (static_cast(context))->OnFailureResponse_113(status); + } - if (0 == mTestIndex) - { - ChipLogProgress(chipTool, " **** Test Start: Test_TC_CC_4_4\n"); - } + static void OnSuccessCallback_113(void * context, uint64_t epochUs) + { + (static_cast(context))->OnSuccessResponse_113(epochUs); + } - if (mTestCount == mTestIndex) - { - ChipLogProgress(chipTool, " **** Test Complete: Test_TC_CC_4_4\n"); - SetCommandExitStatus(CHIP_NO_ERROR); - return; - } + static void OnFailureCallback_114(void * context, uint8_t status) + { + (static_cast(context))->OnFailureResponse_114(status); + } - // Ensure we increment mTestIndex before we start running the relevant - // command. That way if we lose the timeslice after we send the message - // but before our function call returns, we won't end up with an - // incorrect mTestIndex value observed when we get the response. - switch (mTestIndex++) - { - case 0: - ChipLogProgress(chipTool, " ***** Test Step 0 : Turn on light for color control tests\n"); - err = TestTurnOnLightForColorControlTests_0(); - break; - case 1: - ChipLogProgress(chipTool, " ***** Test Step 1 : Check on/off attribute value is true after on command\n"); - err = TestCheckOnOffAttributeValueIsTrueAfterOnCommand_1(); - break; - case 2: - ChipLogProgress(chipTool, " ***** Test Step 2 : Move To current hue and saturation command\n"); - err = TestMoveToCurrentHueAndSaturationCommand_2(); - break; - case 3: - ChipLogProgress(chipTool, " ***** Test Step 3 : Turn off light that we turned on\n"); - err = TestTurnOffLightThatWeTurnedOn_3(); - break; - case 4: - ChipLogProgress(chipTool, " ***** Test Step 4 : Check on/off attribute value is false after off command\n"); - err = TestCheckOnOffAttributeValueIsFalseAfterOffCommand_4(); - break; - } + static void OnSuccessCallback_114(void * context, uint32_t epochS) + { + (static_cast(context))->OnSuccessResponse_114(epochS); + } - if (CHIP_NO_ERROR != err) - { - ChipLogError(chipTool, " ***** Test Failure: %s\n", chip::ErrorStr(err)); - SetCommandExitStatus(err); - } + static void OnFailureCallback_115(void * context, uint8_t status) + { + (static_cast(context))->OnFailureResponse_115(status); } -private: - std::atomic_uint16_t mTestIndex; - const uint16_t mTestCount = 5; + static void OnSuccessCallback_115(void * context, uint32_t epochS) + { + (static_cast(context))->OnSuccessResponse_115(epochS); + } - chip::Callback::Callback mOnFailureCallback_0{ OnFailureCallback_0, this }; - chip::Callback::Callback mOnSuccessCallback_0{ OnSuccessCallback_0, this }; - chip::Callback::Callback mOnFailureCallback_1{ OnFailureCallback_1, this }; - chip::Callback::Callback mOnSuccessCallback_1{ OnSuccessCallback_1, this }; - chip::Callback::Callback mOnFailureCallback_2{ OnFailureCallback_2, this }; - chip::Callback::Callback mOnSuccessCallback_2{ OnSuccessCallback_2, this }; - chip::Callback::Callback mOnFailureCallback_3{ OnFailureCallback_3, this }; - chip::Callback::Callback mOnSuccessCallback_3{ OnSuccessCallback_3, this }; - chip::Callback::Callback mOnFailureCallback_4{ OnFailureCallback_4, this }; - chip::Callback::Callback mOnSuccessCallback_4{ OnSuccessCallback_4, this }; + static void OnFailureCallback_116(void * context, uint8_t status) + { + (static_cast(context))->OnFailureResponse_116(status); + } - static void OnFailureCallback_0(void * context, uint8_t status) + static void OnSuccessCallback_116(void * context, uint32_t epochS) { - (static_cast(context))->OnFailureResponse_0(status); + (static_cast(context))->OnSuccessResponse_116(epochS); } - static void OnSuccessCallback_0(void * context) { (static_cast(context))->OnSuccessResponse_0(); } + static void OnFailureCallback_117(void * context, uint8_t status) + { + (static_cast(context))->OnFailureResponse_117(status); + } - static void OnFailureCallback_1(void * context, uint8_t status) + static void OnSuccessCallback_117(void * context, uint32_t epochS) { - (static_cast(context))->OnFailureResponse_1(status); + (static_cast(context))->OnSuccessResponse_117(epochS); } - static void OnSuccessCallback_1(void * context, bool onOff) + static void OnFailureCallback_118(void * context, uint8_t status) { - (static_cast(context))->OnSuccessResponse_1(onOff); + (static_cast(context))->OnFailureResponse_118(status); } - static void OnFailureCallback_2(void * context, uint8_t status) + static void OnSuccessCallback_118(void * context, uint32_t epochS) { - (static_cast(context))->OnFailureResponse_2(status); + (static_cast(context))->OnSuccessResponse_118(epochS); } - static void OnSuccessCallback_2(void * context) { (static_cast(context))->OnSuccessResponse_2(); } + static void OnFailureCallback_119(void * context, uint8_t status) + { + (static_cast(context))->OnFailureResponse_119(status); + } - static void OnFailureCallback_3(void * context, uint8_t status) + static void OnSuccessCallback_119(void * context, bool unsupported) { - (static_cast(context))->OnFailureResponse_3(status); + (static_cast(context))->OnSuccessResponse_119(unsupported); } - static void OnSuccessCallback_3(void * context) { (static_cast(context))->OnSuccessResponse_3(); } + static void OnFailureCallback_120(void * context, uint8_t status) + { + (static_cast(context))->OnFailureResponse_120(status); + } - static void OnFailureCallback_4(void * context, uint8_t status) + static void OnSuccessCallback_120(void * context, bool unsupported) { - (static_cast(context))->OnFailureResponse_4(status); + (static_cast(context))->OnSuccessResponse_120(unsupported); } - static void OnSuccessCallback_4(void * context, bool onOff) + static void OnFailureCallback_121(void * context, uint8_t status) { - (static_cast(context))->OnSuccessResponse_4(onOff); + (static_cast(context))->OnFailureResponse_121(status); } + static void OnSuccessCallback_121(void * context) { (static_cast(context))->OnSuccessResponse_121(); } + // // Tests methods // - CHIP_ERROR TestTurnOnLightForColorControlTests_0() + CHIP_ERROR TestSendTestCommand_0() { - chip::Controller::OnOffClusterTest cluster; + chip::Controller::TestClusterClusterTest cluster; cluster.Associate(mDevice, 1); - return cluster.On(mOnSuccessCallback_0.Cancel(), mOnFailureCallback_0.Cancel()); + return cluster.Test(mOnSuccessCallback_0.Cancel(), mOnFailureCallback_0.Cancel()); } void OnFailureResponse_0(uint8_t status) { ThrowFailureResponse(); } void OnSuccessResponse_0() { NextTest(); } - CHIP_ERROR TestCheckOnOffAttributeValueIsTrueAfterOnCommand_1() + CHIP_ERROR TestSendTestNotHandledCommand_1() { - chip::Controller::OnOffClusterTest cluster; + chip::Controller::TestClusterClusterTest cluster; cluster.Associate(mDevice, 1); - return cluster.ReadAttributeOnOff(mOnSuccessCallback_1.Cancel(), mOnFailureCallback_1.Cancel()); + return cluster.TestNotHandled(mOnSuccessCallback_1.Cancel(), mOnFailureCallback_1.Cancel()); } - void OnFailureResponse_1(uint8_t status) { ThrowFailureResponse(); } + void OnFailureResponse_1(uint8_t status) { NextTest(); } - void OnSuccessResponse_1(bool onOff) - { - VerifyOrReturn(CheckValue("onOff", onOff, 1)); - NextTest(); - } + void OnSuccessResponse_1() { ThrowSuccessResponse(); } - CHIP_ERROR TestMoveToCurrentHueAndSaturationCommand_2() + CHIP_ERROR TestSendTestSpecificCommand_2() { - chip::Controller::ColorControlClusterTest cluster; + chip::Controller::TestClusterClusterTest cluster; cluster.Associate(mDevice, 1); - uint8_t hueArgument = 40; - uint8_t saturationArgument = 160; - uint16_t transitionTimeArgument = 10U; - uint8_t optionsMaskArgument = 0; - uint8_t optionsOverrideArgument = 0; - - return cluster.MoveToHueAndSaturation(mOnSuccessCallback_2.Cancel(), mOnFailureCallback_2.Cancel(), hueArgument, - saturationArgument, transitionTimeArgument, optionsMaskArgument, - optionsOverrideArgument); + return cluster.TestSpecific(mOnSuccessCallback_2.Cancel(), mOnFailureCallback_2.Cancel()); } void OnFailureResponse_2(uint8_t status) { ThrowFailureResponse(); } - void OnSuccessResponse_2() { NextTest(); } - - CHIP_ERROR TestTurnOffLightThatWeTurnedOn_3() + void OnSuccessResponse_2(uint8_t returnValue) { - chip::Controller::OnOffClusterTest cluster; - cluster.Associate(mDevice, 1); - - return cluster.Off(mOnSuccessCallback_3.Cancel(), mOnFailureCallback_3.Cancel()); + VerifyOrReturn(CheckValue("returnValue", returnValue, 7)); + NextTest(); } - void OnFailureResponse_3(uint8_t status) { ThrowFailureResponse(); } - - void OnSuccessResponse_3() { NextTest(); } - - CHIP_ERROR TestCheckOnOffAttributeValueIsFalseAfterOffCommand_4() + CHIP_ERROR TestSendTestAddArgumentsCommand_3() { - chip::Controller::OnOffClusterTest cluster; + chip::Controller::TestClusterClusterTest cluster; cluster.Associate(mDevice, 1); - return cluster.ReadAttributeOnOff(mOnSuccessCallback_4.Cancel(), mOnFailureCallback_4.Cancel()); + uint8_t arg1Argument = 3; + uint8_t arg2Argument = 17; + + return cluster.TestAddArguments(mOnSuccessCallback_3.Cancel(), mOnFailureCallback_3.Cancel(), arg1Argument, arg2Argument); } - void OnFailureResponse_4(uint8_t status) { ThrowFailureResponse(); } + void OnFailureResponse_3(uint8_t status) { ThrowFailureResponse(); } - void OnSuccessResponse_4(bool onOff) + void OnSuccessResponse_3(uint8_t returnValue) { - VerifyOrReturn(CheckValue("onOff", onOff, 0)); + VerifyOrReturn(CheckValue("returnValue", returnValue, 20)); NextTest(); } -}; - -class Test_TC_CC_5_1 : public TestCommand -{ -public: - Test_TC_CC_5_1() : TestCommand("Test_TC_CC_5_1"), mTestIndex(0) {} - /////////// TestCommand Interface ///////// - void NextTest() override + CHIP_ERROR TestSendFailingTestAddArgumentsCommand_4() { - CHIP_ERROR err = CHIP_NO_ERROR; - - if (0 == mTestIndex) - { - ChipLogProgress(chipTool, " **** Test Start: Test_TC_CC_5_1\n"); - } + chip::Controller::TestClusterClusterTest cluster; + cluster.Associate(mDevice, 1); - if (mTestCount == mTestIndex) - { - ChipLogProgress(chipTool, " **** Test Complete: Test_TC_CC_5_1\n"); - SetCommandExitStatus(CHIP_NO_ERROR); - return; - } + uint8_t arg1Argument = 250; + uint8_t arg2Argument = 6; - // Ensure we increment mTestIndex before we start running the relevant - // command. That way if we lose the timeslice after we send the message - // but before our function call returns, we won't end up with an - // incorrect mTestIndex value observed when we get the response. - switch (mTestIndex++) - { - case 0: - ChipLogProgress(chipTool, " ***** Test Step 0 : Turn on light for color control tests\n"); - err = TestTurnOnLightForColorControlTests_0(); - break; - case 1: - ChipLogProgress(chipTool, " ***** Test Step 1 : Check on/off attribute value is true after on command\n"); - err = TestCheckOnOffAttributeValueIsTrueAfterOnCommand_1(); - break; - case 2: - ChipLogProgress(chipTool, " ***** Test Step 2 : Move to Color command\n"); - err = TestMoveToColorCommand_2(); - break; - case 3: - ChipLogProgress(chipTool, " ***** Test Step 3 : Turn off light that we turned on\n"); - err = TestTurnOffLightThatWeTurnedOn_3(); - break; - case 4: - ChipLogProgress(chipTool, " ***** Test Step 4 : Check on/off attribute value is false after off command\n"); - err = TestCheckOnOffAttributeValueIsFalseAfterOffCommand_4(); - break; - } + return cluster.TestAddArguments(mOnSuccessCallback_4.Cancel(), mOnFailureCallback_4.Cancel(), arg1Argument, arg2Argument); + } - if (CHIP_NO_ERROR != err) - { - ChipLogError(chipTool, " ***** Test Failure: %s\n", chip::ErrorStr(err)); - SetCommandExitStatus(err); - } + void OnFailureResponse_4(uint8_t status) { NextTest(); } + + void OnSuccessResponse_4(uint8_t returnValue) { ThrowSuccessResponse(); } + + CHIP_ERROR TestReadAttributeBooleanDefaultValue_5() + { + chip::Controller::TestClusterClusterTest cluster; + cluster.Associate(mDevice, 1); + + return cluster.ReadAttributeBoolean(mOnSuccessCallback_5.Cancel(), mOnFailureCallback_5.Cancel()); } -private: - std::atomic_uint16_t mTestIndex; - const uint16_t mTestCount = 5; + void OnFailureResponse_5(uint8_t status) { ThrowFailureResponse(); } - chip::Callback::Callback mOnFailureCallback_0{ OnFailureCallback_0, this }; - chip::Callback::Callback mOnSuccessCallback_0{ OnSuccessCallback_0, this }; - chip::Callback::Callback mOnFailureCallback_1{ OnFailureCallback_1, this }; - chip::Callback::Callback mOnSuccessCallback_1{ OnSuccessCallback_1, this }; - chip::Callback::Callback mOnFailureCallback_2{ OnFailureCallback_2, this }; - chip::Callback::Callback mOnSuccessCallback_2{ OnSuccessCallback_2, this }; - chip::Callback::Callback mOnFailureCallback_3{ OnFailureCallback_3, this }; - chip::Callback::Callback mOnSuccessCallback_3{ OnSuccessCallback_3, this }; - chip::Callback::Callback mOnFailureCallback_4{ OnFailureCallback_4, this }; - chip::Callback::Callback mOnSuccessCallback_4{ OnSuccessCallback_4, this }; + void OnSuccessResponse_5(bool boolean) + { + VerifyOrReturn(CheckValue("boolean", boolean, 0)); + NextTest(); + } - static void OnFailureCallback_0(void * context, uint8_t status) + CHIP_ERROR TestWriteAttributeBooleanTrue_6() { - (static_cast(context))->OnFailureResponse_0(status); + chip::Controller::TestClusterClusterTest cluster; + cluster.Associate(mDevice, 1); + + bool booleanArgument = 1; + + return cluster.WriteAttributeBoolean(mOnSuccessCallback_6.Cancel(), mOnFailureCallback_6.Cancel(), booleanArgument); } - static void OnSuccessCallback_0(void * context) { (static_cast(context))->OnSuccessResponse_0(); } + void OnFailureResponse_6(uint8_t status) { ThrowFailureResponse(); } - static void OnFailureCallback_1(void * context, uint8_t status) + void OnSuccessResponse_6(bool boolean) { NextTest(); } + + CHIP_ERROR TestReadAttributeBooleanTrue_7() { - (static_cast(context))->OnFailureResponse_1(status); + chip::Controller::TestClusterClusterTest cluster; + cluster.Associate(mDevice, 1); + + return cluster.ReadAttributeBoolean(mOnSuccessCallback_7.Cancel(), mOnFailureCallback_7.Cancel()); } - static void OnSuccessCallback_1(void * context, bool onOff) + void OnFailureResponse_7(uint8_t status) { ThrowFailureResponse(); } + + void OnSuccessResponse_7(bool boolean) { - (static_cast(context))->OnSuccessResponse_1(onOff); + VerifyOrReturn(CheckValue("boolean", boolean, 1)); + NextTest(); } - static void OnFailureCallback_2(void * context, uint8_t status) + CHIP_ERROR TestWriteAttributeBooleanFalse_8() { - (static_cast(context))->OnFailureResponse_2(status); + chip::Controller::TestClusterClusterTest cluster; + cluster.Associate(mDevice, 1); + + bool booleanArgument = 0; + + return cluster.WriteAttributeBoolean(mOnSuccessCallback_8.Cancel(), mOnFailureCallback_8.Cancel(), booleanArgument); } - static void OnSuccessCallback_2(void * context) { (static_cast(context))->OnSuccessResponse_2(); } + void OnFailureResponse_8(uint8_t status) { ThrowFailureResponse(); } - static void OnFailureCallback_3(void * context, uint8_t status) + void OnSuccessResponse_8(bool boolean) { NextTest(); } + + CHIP_ERROR TestReadAttributeBooleanFalse_9() { - (static_cast(context))->OnFailureResponse_3(status); + chip::Controller::TestClusterClusterTest cluster; + cluster.Associate(mDevice, 1); + + return cluster.ReadAttributeBoolean(mOnSuccessCallback_9.Cancel(), mOnFailureCallback_9.Cancel()); } - static void OnSuccessCallback_3(void * context) { (static_cast(context))->OnSuccessResponse_3(); } + void OnFailureResponse_9(uint8_t status) { ThrowFailureResponse(); } - static void OnFailureCallback_4(void * context, uint8_t status) + void OnSuccessResponse_9(bool boolean) { - (static_cast(context))->OnFailureResponse_4(status); + VerifyOrReturn(CheckValue("boolean", boolean, 0)); + NextTest(); } - static void OnSuccessCallback_4(void * context, bool onOff) + CHIP_ERROR TestReadAttributeBitmap8DefaultValue_10() { - (static_cast(context))->OnSuccessResponse_4(onOff); + chip::Controller::TestClusterClusterTest cluster; + cluster.Associate(mDevice, 1); + + return cluster.ReadAttributeBitmap8(mOnSuccessCallback_10.Cancel(), mOnFailureCallback_10.Cancel()); } - // - // Tests methods - // + void OnFailureResponse_10(uint8_t status) { ThrowFailureResponse(); } - CHIP_ERROR TestTurnOnLightForColorControlTests_0() + void OnSuccessResponse_10(uint8_t bitmap8) { - chip::Controller::OnOffClusterTest cluster; + VerifyOrReturn(CheckValue("bitmap8", bitmap8, 0)); + NextTest(); + } + + CHIP_ERROR TestWriteAttributeBitmap8MaxValue_11() + { + chip::Controller::TestClusterClusterTest cluster; cluster.Associate(mDevice, 1); - return cluster.On(mOnSuccessCallback_0.Cancel(), mOnFailureCallback_0.Cancel()); + uint8_t bitmap8Argument = 255; + + return cluster.WriteAttributeBitmap8(mOnSuccessCallback_11.Cancel(), mOnFailureCallback_11.Cancel(), bitmap8Argument); } - void OnFailureResponse_0(uint8_t status) { ThrowFailureResponse(); } + void OnFailureResponse_11(uint8_t status) { ThrowFailureResponse(); } - void OnSuccessResponse_0() { NextTest(); } + void OnSuccessResponse_11(uint8_t bitmap8) { NextTest(); } - CHIP_ERROR TestCheckOnOffAttributeValueIsTrueAfterOnCommand_1() + CHIP_ERROR TestReadAttributeBitmap8MaxValue_12() { - chip::Controller::OnOffClusterTest cluster; + chip::Controller::TestClusterClusterTest cluster; cluster.Associate(mDevice, 1); - return cluster.ReadAttributeOnOff(mOnSuccessCallback_1.Cancel(), mOnFailureCallback_1.Cancel()); + return cluster.ReadAttributeBitmap8(mOnSuccessCallback_12.Cancel(), mOnFailureCallback_12.Cancel()); } - void OnFailureResponse_1(uint8_t status) { ThrowFailureResponse(); } + void OnFailureResponse_12(uint8_t status) { ThrowFailureResponse(); } - void OnSuccessResponse_1(bool onOff) + void OnSuccessResponse_12(uint8_t bitmap8) { - VerifyOrReturn(CheckValue("onOff", onOff, 1)); + VerifyOrReturn(CheckValue("bitmap8", bitmap8, 255)); NextTest(); } - CHIP_ERROR TestMoveToColorCommand_2() + CHIP_ERROR TestWriteAttributeBitmap8MinValue_13() { - chip::Controller::ColorControlClusterTest cluster; + chip::Controller::TestClusterClusterTest cluster; cluster.Associate(mDevice, 1); - uint16_t colorXArgument = 200U; - uint16_t colorYArgument = 300U; - uint16_t transitionTimeArgument = 20U; - uint8_t optionsMaskArgument = 0; - uint8_t optionsOverrideArgument = 0; + uint8_t bitmap8Argument = 0; - return cluster.MoveToColor(mOnSuccessCallback_2.Cancel(), mOnFailureCallback_2.Cancel(), colorXArgument, colorYArgument, - transitionTimeArgument, optionsMaskArgument, optionsOverrideArgument); + return cluster.WriteAttributeBitmap8(mOnSuccessCallback_13.Cancel(), mOnFailureCallback_13.Cancel(), bitmap8Argument); } - void OnFailureResponse_2(uint8_t status) { ThrowFailureResponse(); } + void OnFailureResponse_13(uint8_t status) { ThrowFailureResponse(); } - void OnSuccessResponse_2() { NextTest(); } + void OnSuccessResponse_13(uint8_t bitmap8) { NextTest(); } - CHIP_ERROR TestTurnOffLightThatWeTurnedOn_3() + CHIP_ERROR TestReadAttributeBitmap8MinValue_14() { - chip::Controller::OnOffClusterTest cluster; + chip::Controller::TestClusterClusterTest cluster; cluster.Associate(mDevice, 1); - return cluster.Off(mOnSuccessCallback_3.Cancel(), mOnFailureCallback_3.Cancel()); + return cluster.ReadAttributeBitmap8(mOnSuccessCallback_14.Cancel(), mOnFailureCallback_14.Cancel()); } - void OnFailureResponse_3(uint8_t status) { ThrowFailureResponse(); } + void OnFailureResponse_14(uint8_t status) { ThrowFailureResponse(); } - void OnSuccessResponse_3() { NextTest(); } + void OnSuccessResponse_14(uint8_t bitmap8) + { + VerifyOrReturn(CheckValue("bitmap8", bitmap8, 0)); + NextTest(); + } - CHIP_ERROR TestCheckOnOffAttributeValueIsFalseAfterOffCommand_4() + CHIP_ERROR TestReadAttributeBitmap16DefaultValue_15() { - chip::Controller::OnOffClusterTest cluster; + chip::Controller::TestClusterClusterTest cluster; cluster.Associate(mDevice, 1); - return cluster.ReadAttributeOnOff(mOnSuccessCallback_4.Cancel(), mOnFailureCallback_4.Cancel()); + return cluster.ReadAttributeBitmap16(mOnSuccessCallback_15.Cancel(), mOnFailureCallback_15.Cancel()); } - void OnFailureResponse_4(uint8_t status) { ThrowFailureResponse(); } + void OnFailureResponse_15(uint8_t status) { ThrowFailureResponse(); } - void OnSuccessResponse_4(bool onOff) + void OnSuccessResponse_15(uint16_t bitmap16) { - VerifyOrReturn(CheckValue("onOff", onOff, 0)); + VerifyOrReturn(CheckValue("bitmap16", bitmap16, 0U)); NextTest(); } -}; -class Test_TC_CC_5_2 : public TestCommand -{ -public: - Test_TC_CC_5_2() : TestCommand("Test_TC_CC_5_2"), mTestIndex(0) {} + CHIP_ERROR TestWriteAttributeBitmap16MaxValue_16() + { + chip::Controller::TestClusterClusterTest cluster; + cluster.Associate(mDevice, 1); - /////////// TestCommand Interface ///////// - void NextTest() override + uint16_t bitmap16Argument = 65535U; + + return cluster.WriteAttributeBitmap16(mOnSuccessCallback_16.Cancel(), mOnFailureCallback_16.Cancel(), bitmap16Argument); + } + + void OnFailureResponse_16(uint8_t status) { ThrowFailureResponse(); } + + void OnSuccessResponse_16(uint16_t bitmap16) { NextTest(); } + + CHIP_ERROR TestReadAttributeBitmap16MaxValue_17() { - CHIP_ERROR err = CHIP_NO_ERROR; + chip::Controller::TestClusterClusterTest cluster; + cluster.Associate(mDevice, 1); - if (0 == mTestIndex) - { - ChipLogProgress(chipTool, " **** Test Start: Test_TC_CC_5_2\n"); - } + return cluster.ReadAttributeBitmap16(mOnSuccessCallback_17.Cancel(), mOnFailureCallback_17.Cancel()); + } - if (mTestCount == mTestIndex) - { - ChipLogProgress(chipTool, " **** Test Complete: Test_TC_CC_5_2\n"); - SetCommandExitStatus(CHIP_NO_ERROR); - return; - } + void OnFailureResponse_17(uint8_t status) { ThrowFailureResponse(); } - // Ensure we increment mTestIndex before we start running the relevant - // command. That way if we lose the timeslice after we send the message - // but before our function call returns, we won't end up with an - // incorrect mTestIndex value observed when we get the response. - switch (mTestIndex++) - { - case 0: - ChipLogProgress(chipTool, " ***** Test Step 0 : Turn on light for color control tests\n"); - err = TestTurnOnLightForColorControlTests_0(); - break; - case 1: - ChipLogProgress(chipTool, " ***** Test Step 1 : Check on/off attribute value is true after on command\n"); - err = TestCheckOnOffAttributeValueIsTrueAfterOnCommand_1(); - break; - case 2: - ChipLogProgress(chipTool, " ***** Test Step 2 : Move Color command\n"); - err = TestMoveColorCommand_2(); - break; - case 3: - ChipLogProgress(chipTool, " ***** Test Step 3 : Stop Move Step command\n"); - err = TestStopMoveStepCommand_3(); - break; - case 4: - ChipLogProgress(chipTool, " ***** Test Step 4 : Turn off light that we turned on\n"); - err = TestTurnOffLightThatWeTurnedOn_4(); - break; - case 5: - ChipLogProgress(chipTool, " ***** Test Step 5 : Check on/off attribute value is false after off command\n"); - err = TestCheckOnOffAttributeValueIsFalseAfterOffCommand_5(); - break; - } + void OnSuccessResponse_17(uint16_t bitmap16) + { + VerifyOrReturn(CheckValue("bitmap16", bitmap16, 65535U)); + NextTest(); + } - if (CHIP_NO_ERROR != err) - { - ChipLogError(chipTool, " ***** Test Failure: %s\n", chip::ErrorStr(err)); - SetCommandExitStatus(err); - } + CHIP_ERROR TestWriteAttributeBitmap16MinValue_18() + { + chip::Controller::TestClusterClusterTest cluster; + cluster.Associate(mDevice, 1); + + uint16_t bitmap16Argument = 0U; + + return cluster.WriteAttributeBitmap16(mOnSuccessCallback_18.Cancel(), mOnFailureCallback_18.Cancel(), bitmap16Argument); } -private: - std::atomic_uint16_t mTestIndex; - const uint16_t mTestCount = 6; + void OnFailureResponse_18(uint8_t status) { ThrowFailureResponse(); } - chip::Callback::Callback mOnFailureCallback_0{ OnFailureCallback_0, this }; - chip::Callback::Callback mOnSuccessCallback_0{ OnSuccessCallback_0, this }; - chip::Callback::Callback mOnFailureCallback_1{ OnFailureCallback_1, this }; - chip::Callback::Callback mOnSuccessCallback_1{ OnSuccessCallback_1, this }; - chip::Callback::Callback mOnFailureCallback_2{ OnFailureCallback_2, this }; - chip::Callback::Callback mOnSuccessCallback_2{ OnSuccessCallback_2, this }; - chip::Callback::Callback mOnFailureCallback_3{ OnFailureCallback_3, this }; - chip::Callback::Callback mOnSuccessCallback_3{ OnSuccessCallback_3, this }; - chip::Callback::Callback mOnFailureCallback_4{ OnFailureCallback_4, this }; - chip::Callback::Callback mOnSuccessCallback_4{ OnSuccessCallback_4, this }; - chip::Callback::Callback mOnFailureCallback_5{ OnFailureCallback_5, this }; - chip::Callback::Callback mOnSuccessCallback_5{ OnSuccessCallback_5, this }; + void OnSuccessResponse_18(uint16_t bitmap16) { NextTest(); } - static void OnFailureCallback_0(void * context, uint8_t status) + CHIP_ERROR TestReadAttributeBitmap16MinValue_19() { - (static_cast(context))->OnFailureResponse_0(status); + chip::Controller::TestClusterClusterTest cluster; + cluster.Associate(mDevice, 1); + + return cluster.ReadAttributeBitmap16(mOnSuccessCallback_19.Cancel(), mOnFailureCallback_19.Cancel()); } - static void OnSuccessCallback_0(void * context) { (static_cast(context))->OnSuccessResponse_0(); } + void OnFailureResponse_19(uint8_t status) { ThrowFailureResponse(); } - static void OnFailureCallback_1(void * context, uint8_t status) + void OnSuccessResponse_19(uint16_t bitmap16) { - (static_cast(context))->OnFailureResponse_1(status); + VerifyOrReturn(CheckValue("bitmap16", bitmap16, 0U)); + NextTest(); } - static void OnSuccessCallback_1(void * context, bool onOff) + CHIP_ERROR TestReadAttributeBitmap32DefaultValue_20() { - (static_cast(context))->OnSuccessResponse_1(onOff); + chip::Controller::TestClusterClusterTest cluster; + cluster.Associate(mDevice, 1); + + return cluster.ReadAttributeBitmap32(mOnSuccessCallback_20.Cancel(), mOnFailureCallback_20.Cancel()); } - static void OnFailureCallback_2(void * context, uint8_t status) + void OnFailureResponse_20(uint8_t status) { ThrowFailureResponse(); } + + void OnSuccessResponse_20(uint32_t bitmap32) { - (static_cast(context))->OnFailureResponse_2(status); + VerifyOrReturn(CheckValue("bitmap32", bitmap32, 0UL)); + NextTest(); } - static void OnSuccessCallback_2(void * context) { (static_cast(context))->OnSuccessResponse_2(); } - - static void OnFailureCallback_3(void * context, uint8_t status) + CHIP_ERROR TestWriteAttributeBitmap32MaxValue_21() { - (static_cast(context))->OnFailureResponse_3(status); + chip::Controller::TestClusterClusterTest cluster; + cluster.Associate(mDevice, 1); + + uint32_t bitmap32Argument = 4294967295UL; + + return cluster.WriteAttributeBitmap32(mOnSuccessCallback_21.Cancel(), mOnFailureCallback_21.Cancel(), bitmap32Argument); } - static void OnSuccessCallback_3(void * context) { (static_cast(context))->OnSuccessResponse_3(); } + void OnFailureResponse_21(uint8_t status) { ThrowFailureResponse(); } - static void OnFailureCallback_4(void * context, uint8_t status) + void OnSuccessResponse_21(uint32_t bitmap32) { NextTest(); } + + CHIP_ERROR TestReadAttributeBitmap32MaxValue_22() { - (static_cast(context))->OnFailureResponse_4(status); + chip::Controller::TestClusterClusterTest cluster; + cluster.Associate(mDevice, 1); + + return cluster.ReadAttributeBitmap32(mOnSuccessCallback_22.Cancel(), mOnFailureCallback_22.Cancel()); } - static void OnSuccessCallback_4(void * context) { (static_cast(context))->OnSuccessResponse_4(); } + void OnFailureResponse_22(uint8_t status) { ThrowFailureResponse(); } - static void OnFailureCallback_5(void * context, uint8_t status) + void OnSuccessResponse_22(uint32_t bitmap32) { - (static_cast(context))->OnFailureResponse_5(status); + VerifyOrReturn(CheckValue("bitmap32", bitmap32, 4294967295UL)); + NextTest(); } - static void OnSuccessCallback_5(void * context, bool onOff) + CHIP_ERROR TestWriteAttributeBitmap32MinValue_23() { - (static_cast(context))->OnSuccessResponse_5(onOff); + chip::Controller::TestClusterClusterTest cluster; + cluster.Associate(mDevice, 1); + + uint32_t bitmap32Argument = 0UL; + + return cluster.WriteAttributeBitmap32(mOnSuccessCallback_23.Cancel(), mOnFailureCallback_23.Cancel(), bitmap32Argument); } - // - // Tests methods - // + void OnFailureResponse_23(uint8_t status) { ThrowFailureResponse(); } - CHIP_ERROR TestTurnOnLightForColorControlTests_0() + void OnSuccessResponse_23(uint32_t bitmap32) { NextTest(); } + + CHIP_ERROR TestReadAttributeBitmap32MinValue_24() { - chip::Controller::OnOffClusterTest cluster; + chip::Controller::TestClusterClusterTest cluster; cluster.Associate(mDevice, 1); - return cluster.On(mOnSuccessCallback_0.Cancel(), mOnFailureCallback_0.Cancel()); + return cluster.ReadAttributeBitmap32(mOnSuccessCallback_24.Cancel(), mOnFailureCallback_24.Cancel()); } - void OnFailureResponse_0(uint8_t status) { ThrowFailureResponse(); } + void OnFailureResponse_24(uint8_t status) { ThrowFailureResponse(); } - void OnSuccessResponse_0() { NextTest(); } + void OnSuccessResponse_24(uint32_t bitmap32) + { + VerifyOrReturn(CheckValue("bitmap32", bitmap32, 0UL)); + NextTest(); + } - CHIP_ERROR TestCheckOnOffAttributeValueIsTrueAfterOnCommand_1() + CHIP_ERROR TestReadAttributeBitmap64DefaultValue_25() { - chip::Controller::OnOffClusterTest cluster; + chip::Controller::TestClusterClusterTest cluster; cluster.Associate(mDevice, 1); - return cluster.ReadAttributeOnOff(mOnSuccessCallback_1.Cancel(), mOnFailureCallback_1.Cancel()); + return cluster.ReadAttributeBitmap64(mOnSuccessCallback_25.Cancel(), mOnFailureCallback_25.Cancel()); } - void OnFailureResponse_1(uint8_t status) { ThrowFailureResponse(); } + void OnFailureResponse_25(uint8_t status) { ThrowFailureResponse(); } - void OnSuccessResponse_1(bool onOff) + void OnSuccessResponse_25(uint64_t bitmap64) { - VerifyOrReturn(CheckValue("onOff", onOff, 1)); + VerifyOrReturn(CheckValue("bitmap64", bitmap64, 0ULL)); NextTest(); } - CHIP_ERROR TestMoveColorCommand_2() + CHIP_ERROR TestWriteAttributeBitmap64MaxValue_26() { - chip::Controller::ColorControlClusterTest cluster; + chip::Controller::TestClusterClusterTest cluster; cluster.Associate(mDevice, 1); - int16_t rateXArgument = 15; - int16_t rateYArgument = 20; - uint8_t optionsMaskArgument = 0; - uint8_t optionsOverrideArgument = 0; + uint64_t bitmap64Argument = 18446744073709551615ULL; - return cluster.MoveColor(mOnSuccessCallback_2.Cancel(), mOnFailureCallback_2.Cancel(), rateXArgument, rateYArgument, - optionsMaskArgument, optionsOverrideArgument); + return cluster.WriteAttributeBitmap64(mOnSuccessCallback_26.Cancel(), mOnFailureCallback_26.Cancel(), bitmap64Argument); } - void OnFailureResponse_2(uint8_t status) { ThrowFailureResponse(); } + void OnFailureResponse_26(uint8_t status) { ThrowFailureResponse(); } - void OnSuccessResponse_2() { NextTest(); } + void OnSuccessResponse_26(uint64_t bitmap64) { NextTest(); } - CHIP_ERROR TestStopMoveStepCommand_3() + CHIP_ERROR TestReadAttributeBitmap64MaxValue_27() { - chip::Controller::ColorControlClusterTest cluster; + chip::Controller::TestClusterClusterTest cluster; cluster.Associate(mDevice, 1); - uint8_t optionsMaskArgument = 0; - uint8_t optionsOverrideArgument = 0; - - return cluster.StopMoveStep(mOnSuccessCallback_3.Cancel(), mOnFailureCallback_3.Cancel(), optionsMaskArgument, - optionsOverrideArgument); + return cluster.ReadAttributeBitmap64(mOnSuccessCallback_27.Cancel(), mOnFailureCallback_27.Cancel()); } - void OnFailureResponse_3(uint8_t status) { ThrowFailureResponse(); } + void OnFailureResponse_27(uint8_t status) { ThrowFailureResponse(); } - void OnSuccessResponse_3() { NextTest(); } + void OnSuccessResponse_27(uint64_t bitmap64) + { + VerifyOrReturn(CheckValue("bitmap64", bitmap64, 18446744073709551615ULL)); + NextTest(); + } - CHIP_ERROR TestTurnOffLightThatWeTurnedOn_4() + CHIP_ERROR TestWriteAttributeBitmap64MinValue_28() { - chip::Controller::OnOffClusterTest cluster; + chip::Controller::TestClusterClusterTest cluster; cluster.Associate(mDevice, 1); - return cluster.Off(mOnSuccessCallback_4.Cancel(), mOnFailureCallback_4.Cancel()); + uint64_t bitmap64Argument = 0ULL; + + return cluster.WriteAttributeBitmap64(mOnSuccessCallback_28.Cancel(), mOnFailureCallback_28.Cancel(), bitmap64Argument); } - void OnFailureResponse_4(uint8_t status) { ThrowFailureResponse(); } + void OnFailureResponse_28(uint8_t status) { ThrowFailureResponse(); } - void OnSuccessResponse_4() { NextTest(); } + void OnSuccessResponse_28(uint64_t bitmap64) { NextTest(); } - CHIP_ERROR TestCheckOnOffAttributeValueIsFalseAfterOffCommand_5() + CHIP_ERROR TestReadAttributeBitmap64MinValue_29() { - chip::Controller::OnOffClusterTest cluster; + chip::Controller::TestClusterClusterTest cluster; cluster.Associate(mDevice, 1); - return cluster.ReadAttributeOnOff(mOnSuccessCallback_5.Cancel(), mOnFailureCallback_5.Cancel()); + return cluster.ReadAttributeBitmap64(mOnSuccessCallback_29.Cancel(), mOnFailureCallback_29.Cancel()); } - void OnFailureResponse_5(uint8_t status) { ThrowFailureResponse(); } + void OnFailureResponse_29(uint8_t status) { ThrowFailureResponse(); } - void OnSuccessResponse_5(bool onOff) + void OnSuccessResponse_29(uint64_t bitmap64) { - VerifyOrReturn(CheckValue("onOff", onOff, 0)); + VerifyOrReturn(CheckValue("bitmap64", bitmap64, 0ULL)); NextTest(); } -}; - -class Test_TC_CC_5_3 : public TestCommand -{ -public: - Test_TC_CC_5_3() : TestCommand("Test_TC_CC_5_3"), mTestIndex(0) {} - /////////// TestCommand Interface ///////// - void NextTest() override + CHIP_ERROR TestReadAttributeInt8uDefaultValue_30() { - CHIP_ERROR err = CHIP_NO_ERROR; - - if (0 == mTestIndex) - { - ChipLogProgress(chipTool, " **** Test Start: Test_TC_CC_5_3\n"); - } + chip::Controller::TestClusterClusterTest cluster; + cluster.Associate(mDevice, 1); - if (mTestCount == mTestIndex) - { - ChipLogProgress(chipTool, " **** Test Complete: Test_TC_CC_5_3\n"); - SetCommandExitStatus(CHIP_NO_ERROR); - return; - } + return cluster.ReadAttributeInt8u(mOnSuccessCallback_30.Cancel(), mOnFailureCallback_30.Cancel()); + } - // Ensure we increment mTestIndex before we start running the relevant - // command. That way if we lose the timeslice after we send the message - // but before our function call returns, we won't end up with an - // incorrect mTestIndex value observed when we get the response. - switch (mTestIndex++) - { - case 0: - ChipLogProgress(chipTool, " ***** Test Step 0 : Turn on light for color control tests\n"); - err = TestTurnOnLightForColorControlTests_0(); - break; - case 1: - ChipLogProgress(chipTool, " ***** Test Step 1 : Check on/off attribute value is true after on command\n"); - err = TestCheckOnOffAttributeValueIsTrueAfterOnCommand_1(); - break; - case 2: - ChipLogProgress(chipTool, " ***** Test Step 2 : Step Color command\n"); - err = TestStepColorCommand_2(); - break; - case 3: - ChipLogProgress(chipTool, " ***** Test Step 3 : Turn off light that we turned on\n"); - err = TestTurnOffLightThatWeTurnedOn_3(); - break; - case 4: - ChipLogProgress(chipTool, " ***** Test Step 4 : Check on/off attribute value is false after off command\n"); - err = TestCheckOnOffAttributeValueIsFalseAfterOffCommand_4(); - break; - } + void OnFailureResponse_30(uint8_t status) { ThrowFailureResponse(); } - if (CHIP_NO_ERROR != err) - { - ChipLogError(chipTool, " ***** Test Failure: %s\n", chip::ErrorStr(err)); - SetCommandExitStatus(err); - } + void OnSuccessResponse_30(uint8_t int8u) + { + VerifyOrReturn(CheckValue("int8u", int8u, 0)); + NextTest(); } -private: - std::atomic_uint16_t mTestIndex; - const uint16_t mTestCount = 5; - - chip::Callback::Callback mOnFailureCallback_0{ OnFailureCallback_0, this }; - chip::Callback::Callback mOnSuccessCallback_0{ OnSuccessCallback_0, this }; - chip::Callback::Callback mOnFailureCallback_1{ OnFailureCallback_1, this }; - chip::Callback::Callback mOnSuccessCallback_1{ OnSuccessCallback_1, this }; - chip::Callback::Callback mOnFailureCallback_2{ OnFailureCallback_2, this }; - chip::Callback::Callback mOnSuccessCallback_2{ OnSuccessCallback_2, this }; - chip::Callback::Callback mOnFailureCallback_3{ OnFailureCallback_3, this }; - chip::Callback::Callback mOnSuccessCallback_3{ OnSuccessCallback_3, this }; - chip::Callback::Callback mOnFailureCallback_4{ OnFailureCallback_4, this }; - chip::Callback::Callback mOnSuccessCallback_4{ OnSuccessCallback_4, this }; + CHIP_ERROR TestWriteAttributeInt8uMaxValue_31() + { + chip::Controller::TestClusterClusterTest cluster; + cluster.Associate(mDevice, 1); - static void OnFailureCallback_0(void * context, uint8_t status) - { - (static_cast(context))->OnFailureResponse_0(status); + uint8_t int8uArgument = 255; + + return cluster.WriteAttributeInt8u(mOnSuccessCallback_31.Cancel(), mOnFailureCallback_31.Cancel(), int8uArgument); } - static void OnSuccessCallback_0(void * context) { (static_cast(context))->OnSuccessResponse_0(); } + void OnFailureResponse_31(uint8_t status) { ThrowFailureResponse(); } - static void OnFailureCallback_1(void * context, uint8_t status) + void OnSuccessResponse_31(uint8_t int8u) { NextTest(); } + + CHIP_ERROR TestReadAttributeInt8uMaxValue_32() { - (static_cast(context))->OnFailureResponse_1(status); + chip::Controller::TestClusterClusterTest cluster; + cluster.Associate(mDevice, 1); + + return cluster.ReadAttributeInt8u(mOnSuccessCallback_32.Cancel(), mOnFailureCallback_32.Cancel()); } - static void OnSuccessCallback_1(void * context, bool onOff) + void OnFailureResponse_32(uint8_t status) { ThrowFailureResponse(); } + + void OnSuccessResponse_32(uint8_t int8u) { - (static_cast(context))->OnSuccessResponse_1(onOff); + VerifyOrReturn(CheckValue("int8u", int8u, 255)); + NextTest(); } - static void OnFailureCallback_2(void * context, uint8_t status) + CHIP_ERROR TestWriteAttributeInt8uMinValue_33() { - (static_cast(context))->OnFailureResponse_2(status); + chip::Controller::TestClusterClusterTest cluster; + cluster.Associate(mDevice, 1); + + uint8_t int8uArgument = 0; + + return cluster.WriteAttributeInt8u(mOnSuccessCallback_33.Cancel(), mOnFailureCallback_33.Cancel(), int8uArgument); } - static void OnSuccessCallback_2(void * context) { (static_cast(context))->OnSuccessResponse_2(); } + void OnFailureResponse_33(uint8_t status) { ThrowFailureResponse(); } - static void OnFailureCallback_3(void * context, uint8_t status) + void OnSuccessResponse_33(uint8_t int8u) { NextTest(); } + + CHIP_ERROR TestReadAttributeInt8uMinValue_34() { - (static_cast(context))->OnFailureResponse_3(status); + chip::Controller::TestClusterClusterTest cluster; + cluster.Associate(mDevice, 1); + + return cluster.ReadAttributeInt8u(mOnSuccessCallback_34.Cancel(), mOnFailureCallback_34.Cancel()); } - static void OnSuccessCallback_3(void * context) { (static_cast(context))->OnSuccessResponse_3(); } + void OnFailureResponse_34(uint8_t status) { ThrowFailureResponse(); } - static void OnFailureCallback_4(void * context, uint8_t status) + void OnSuccessResponse_34(uint8_t int8u) { - (static_cast(context))->OnFailureResponse_4(status); + VerifyOrReturn(CheckValue("int8u", int8u, 0)); + NextTest(); } - static void OnSuccessCallback_4(void * context, bool onOff) + CHIP_ERROR TestReadAttributeInt16uDefaultValue_35() { - (static_cast(context))->OnSuccessResponse_4(onOff); + chip::Controller::TestClusterClusterTest cluster; + cluster.Associate(mDevice, 1); + + return cluster.ReadAttributeInt16u(mOnSuccessCallback_35.Cancel(), mOnFailureCallback_35.Cancel()); } - // - // Tests methods - // + void OnFailureResponse_35(uint8_t status) { ThrowFailureResponse(); } - CHIP_ERROR TestTurnOnLightForColorControlTests_0() + void OnSuccessResponse_35(uint16_t int16u) { - chip::Controller::OnOffClusterTest cluster; + VerifyOrReturn(CheckValue("int16u", int16u, 0U)); + NextTest(); + } + + CHIP_ERROR TestWriteAttributeInt16uMaxValue_36() + { + chip::Controller::TestClusterClusterTest cluster; cluster.Associate(mDevice, 1); - return cluster.On(mOnSuccessCallback_0.Cancel(), mOnFailureCallback_0.Cancel()); + uint16_t int16uArgument = 65535U; + + return cluster.WriteAttributeInt16u(mOnSuccessCallback_36.Cancel(), mOnFailureCallback_36.Cancel(), int16uArgument); } - void OnFailureResponse_0(uint8_t status) { ThrowFailureResponse(); } + void OnFailureResponse_36(uint8_t status) { ThrowFailureResponse(); } - void OnSuccessResponse_0() { NextTest(); } + void OnSuccessResponse_36(uint16_t int16u) { NextTest(); } - CHIP_ERROR TestCheckOnOffAttributeValueIsTrueAfterOnCommand_1() + CHIP_ERROR TestReadAttributeInt16uMaxValue_37() { - chip::Controller::OnOffClusterTest cluster; + chip::Controller::TestClusterClusterTest cluster; cluster.Associate(mDevice, 1); - return cluster.ReadAttributeOnOff(mOnSuccessCallback_1.Cancel(), mOnFailureCallback_1.Cancel()); + return cluster.ReadAttributeInt16u(mOnSuccessCallback_37.Cancel(), mOnFailureCallback_37.Cancel()); } - void OnFailureResponse_1(uint8_t status) { ThrowFailureResponse(); } + void OnFailureResponse_37(uint8_t status) { ThrowFailureResponse(); } - void OnSuccessResponse_1(bool onOff) + void OnSuccessResponse_37(uint16_t int16u) { - VerifyOrReturn(CheckValue("onOff", onOff, 1)); + VerifyOrReturn(CheckValue("int16u", int16u, 65535U)); NextTest(); } - CHIP_ERROR TestStepColorCommand_2() + CHIP_ERROR TestWriteAttributeInt16uMinValue_38() { - chip::Controller::ColorControlClusterTest cluster; + chip::Controller::TestClusterClusterTest cluster; cluster.Associate(mDevice, 1); - int16_t stepXArgument = 15; - int16_t stepYArgument = 20; - uint16_t transitionTimeArgument = 50U; - uint8_t optionsMaskArgument = 0; - uint8_t optionsOverrideArgument = 0; + uint16_t int16uArgument = 0U; - return cluster.StepColor(mOnSuccessCallback_2.Cancel(), mOnFailureCallback_2.Cancel(), stepXArgument, stepYArgument, - transitionTimeArgument, optionsMaskArgument, optionsOverrideArgument); + return cluster.WriteAttributeInt16u(mOnSuccessCallback_38.Cancel(), mOnFailureCallback_38.Cancel(), int16uArgument); } - void OnFailureResponse_2(uint8_t status) { ThrowFailureResponse(); } + void OnFailureResponse_38(uint8_t status) { ThrowFailureResponse(); } - void OnSuccessResponse_2() { NextTest(); } + void OnSuccessResponse_38(uint16_t int16u) { NextTest(); } - CHIP_ERROR TestTurnOffLightThatWeTurnedOn_3() + CHIP_ERROR TestReadAttributeInt16uMinValue_39() { - chip::Controller::OnOffClusterTest cluster; + chip::Controller::TestClusterClusterTest cluster; cluster.Associate(mDevice, 1); - return cluster.Off(mOnSuccessCallback_3.Cancel(), mOnFailureCallback_3.Cancel()); + return cluster.ReadAttributeInt16u(mOnSuccessCallback_39.Cancel(), mOnFailureCallback_39.Cancel()); } - void OnFailureResponse_3(uint8_t status) { ThrowFailureResponse(); } + void OnFailureResponse_39(uint8_t status) { ThrowFailureResponse(); } - void OnSuccessResponse_3() { NextTest(); } + void OnSuccessResponse_39(uint16_t int16u) + { + VerifyOrReturn(CheckValue("int16u", int16u, 0U)); + NextTest(); + } - CHIP_ERROR TestCheckOnOffAttributeValueIsFalseAfterOffCommand_4() + CHIP_ERROR TestReadAttributeInt32uDefaultValue_40() { - chip::Controller::OnOffClusterTest cluster; + chip::Controller::TestClusterClusterTest cluster; cluster.Associate(mDevice, 1); - return cluster.ReadAttributeOnOff(mOnSuccessCallback_4.Cancel(), mOnFailureCallback_4.Cancel()); + return cluster.ReadAttributeInt32u(mOnSuccessCallback_40.Cancel(), mOnFailureCallback_40.Cancel()); } - void OnFailureResponse_4(uint8_t status) { ThrowFailureResponse(); } + void OnFailureResponse_40(uint8_t status) { ThrowFailureResponse(); } - void OnSuccessResponse_4(bool onOff) + void OnSuccessResponse_40(uint32_t int32u) { - VerifyOrReturn(CheckValue("onOff", onOff, 0)); + VerifyOrReturn(CheckValue("int32u", int32u, 0UL)); NextTest(); } -}; -class Test_TC_CC_6_1 : public TestCommand -{ -public: - Test_TC_CC_6_1() : TestCommand("Test_TC_CC_6_1"), mTestIndex(0) {} + CHIP_ERROR TestWriteAttributeInt32uMaxValue_41() + { + chip::Controller::TestClusterClusterTest cluster; + cluster.Associate(mDevice, 1); - /////////// TestCommand Interface ///////// - void NextTest() override + uint32_t int32uArgument = 4294967295UL; + + return cluster.WriteAttributeInt32u(mOnSuccessCallback_41.Cancel(), mOnFailureCallback_41.Cancel(), int32uArgument); + } + + void OnFailureResponse_41(uint8_t status) { ThrowFailureResponse(); } + + void OnSuccessResponse_41(uint32_t int32u) { NextTest(); } + + CHIP_ERROR TestReadAttributeInt32uMaxValue_42() { - CHIP_ERROR err = CHIP_NO_ERROR; + chip::Controller::TestClusterClusterTest cluster; + cluster.Associate(mDevice, 1); - if (0 == mTestIndex) - { - ChipLogProgress(chipTool, " **** Test Start: Test_TC_CC_6_1\n"); - } + return cluster.ReadAttributeInt32u(mOnSuccessCallback_42.Cancel(), mOnFailureCallback_42.Cancel()); + } - if (mTestCount == mTestIndex) - { - ChipLogProgress(chipTool, " **** Test Complete: Test_TC_CC_6_1\n"); - SetCommandExitStatus(CHIP_NO_ERROR); - return; - } + void OnFailureResponse_42(uint8_t status) { ThrowFailureResponse(); } - // Ensure we increment mTestIndex before we start running the relevant - // command. That way if we lose the timeslice after we send the message - // but before our function call returns, we won't end up with an - // incorrect mTestIndex value observed when we get the response. - switch (mTestIndex++) - { - case 0: - ChipLogProgress(chipTool, " ***** Test Step 0 : Turn on light for color control tests\n"); - err = TestTurnOnLightForColorControlTests_0(); - break; - case 1: - ChipLogProgress(chipTool, " ***** Test Step 1 : Check on/off attribute value is true after on command\n"); - err = TestCheckOnOffAttributeValueIsTrueAfterOnCommand_1(); - break; - case 2: - ChipLogProgress(chipTool, " ***** Test Step 2 : Move To Color Temperature command\n"); - err = TestMoveToColorTemperatureCommand_2(); - break; - case 3: - ChipLogProgress(chipTool, " ***** Test Step 3 : Turn off light that we turned on\n"); - err = TestTurnOffLightThatWeTurnedOn_3(); - break; - case 4: - ChipLogProgress(chipTool, " ***** Test Step 4 : Check on/off attribute value is false after off command\n"); - err = TestCheckOnOffAttributeValueIsFalseAfterOffCommand_4(); - break; - } + void OnSuccessResponse_42(uint32_t int32u) + { + VerifyOrReturn(CheckValue("int32u", int32u, 4294967295UL)); + NextTest(); + } - if (CHIP_NO_ERROR != err) - { - ChipLogError(chipTool, " ***** Test Failure: %s\n", chip::ErrorStr(err)); - SetCommandExitStatus(err); - } + CHIP_ERROR TestWriteAttributeInt32uMinValue_43() + { + chip::Controller::TestClusterClusterTest cluster; + cluster.Associate(mDevice, 1); + + uint32_t int32uArgument = 0UL; + + return cluster.WriteAttributeInt32u(mOnSuccessCallback_43.Cancel(), mOnFailureCallback_43.Cancel(), int32uArgument); } -private: - std::atomic_uint16_t mTestIndex; - const uint16_t mTestCount = 5; + void OnFailureResponse_43(uint8_t status) { ThrowFailureResponse(); } - chip::Callback::Callback mOnFailureCallback_0{ OnFailureCallback_0, this }; - chip::Callback::Callback mOnSuccessCallback_0{ OnSuccessCallback_0, this }; - chip::Callback::Callback mOnFailureCallback_1{ OnFailureCallback_1, this }; - chip::Callback::Callback mOnSuccessCallback_1{ OnSuccessCallback_1, this }; - chip::Callback::Callback mOnFailureCallback_2{ OnFailureCallback_2, this }; - chip::Callback::Callback mOnSuccessCallback_2{ OnSuccessCallback_2, this }; - chip::Callback::Callback mOnFailureCallback_3{ OnFailureCallback_3, this }; - chip::Callback::Callback mOnSuccessCallback_3{ OnSuccessCallback_3, this }; - chip::Callback::Callback mOnFailureCallback_4{ OnFailureCallback_4, this }; - chip::Callback::Callback mOnSuccessCallback_4{ OnSuccessCallback_4, this }; + void OnSuccessResponse_43(uint32_t int32u) { NextTest(); } - static void OnFailureCallback_0(void * context, uint8_t status) + CHIP_ERROR TestReadAttributeInt32uMinValue_44() { - (static_cast(context))->OnFailureResponse_0(status); + chip::Controller::TestClusterClusterTest cluster; + cluster.Associate(mDevice, 1); + + return cluster.ReadAttributeInt32u(mOnSuccessCallback_44.Cancel(), mOnFailureCallback_44.Cancel()); } - static void OnSuccessCallback_0(void * context) { (static_cast(context))->OnSuccessResponse_0(); } + void OnFailureResponse_44(uint8_t status) { ThrowFailureResponse(); } - static void OnFailureCallback_1(void * context, uint8_t status) + void OnSuccessResponse_44(uint32_t int32u) { - (static_cast(context))->OnFailureResponse_1(status); + VerifyOrReturn(CheckValue("int32u", int32u, 0UL)); + NextTest(); + } + + CHIP_ERROR TestReadAttributeInt64uDefaultValue_45() + { + chip::Controller::TestClusterClusterTest cluster; + cluster.Associate(mDevice, 1); + + return cluster.ReadAttributeInt64u(mOnSuccessCallback_45.Cancel(), mOnFailureCallback_45.Cancel()); } - static void OnSuccessCallback_1(void * context, bool onOff) + void OnFailureResponse_45(uint8_t status) { ThrowFailureResponse(); } + + void OnSuccessResponse_45(uint64_t int64u) { - (static_cast(context))->OnSuccessResponse_1(onOff); + VerifyOrReturn(CheckValue("int64u", int64u, 0ULL)); + NextTest(); } - static void OnFailureCallback_2(void * context, uint8_t status) + CHIP_ERROR TestWriteAttributeInt64uMaxValue_46() { - (static_cast(context))->OnFailureResponse_2(status); - } + chip::Controller::TestClusterClusterTest cluster; + cluster.Associate(mDevice, 1); - static void OnSuccessCallback_2(void * context) { (static_cast(context))->OnSuccessResponse_2(); } + uint64_t int64uArgument = 18446744073709551615ULL; - static void OnFailureCallback_3(void * context, uint8_t status) - { - (static_cast(context))->OnFailureResponse_3(status); + return cluster.WriteAttributeInt64u(mOnSuccessCallback_46.Cancel(), mOnFailureCallback_46.Cancel(), int64uArgument); } - static void OnSuccessCallback_3(void * context) { (static_cast(context))->OnSuccessResponse_3(); } + void OnFailureResponse_46(uint8_t status) { ThrowFailureResponse(); } - static void OnFailureCallback_4(void * context, uint8_t status) + void OnSuccessResponse_46(uint64_t int64u) { NextTest(); } + + CHIP_ERROR TestReadAttributeInt64uMaxValue_47() { - (static_cast(context))->OnFailureResponse_4(status); + chip::Controller::TestClusterClusterTest cluster; + cluster.Associate(mDevice, 1); + + return cluster.ReadAttributeInt64u(mOnSuccessCallback_47.Cancel(), mOnFailureCallback_47.Cancel()); } - static void OnSuccessCallback_4(void * context, bool onOff) + void OnFailureResponse_47(uint8_t status) { ThrowFailureResponse(); } + + void OnSuccessResponse_47(uint64_t int64u) { - (static_cast(context))->OnSuccessResponse_4(onOff); + VerifyOrReturn(CheckValue("int64u", int64u, 18446744073709551615ULL)); + NextTest(); } - // - // Tests methods - // - - CHIP_ERROR TestTurnOnLightForColorControlTests_0() + CHIP_ERROR TestWriteAttributeInt64uMinValue_48() { - chip::Controller::OnOffClusterTest cluster; + chip::Controller::TestClusterClusterTest cluster; cluster.Associate(mDevice, 1); - return cluster.On(mOnSuccessCallback_0.Cancel(), mOnFailureCallback_0.Cancel()); + uint64_t int64uArgument = 0ULL; + + return cluster.WriteAttributeInt64u(mOnSuccessCallback_48.Cancel(), mOnFailureCallback_48.Cancel(), int64uArgument); } - void OnFailureResponse_0(uint8_t status) { ThrowFailureResponse(); } + void OnFailureResponse_48(uint8_t status) { ThrowFailureResponse(); } - void OnSuccessResponse_0() { NextTest(); } + void OnSuccessResponse_48(uint64_t int64u) { NextTest(); } - CHIP_ERROR TestCheckOnOffAttributeValueIsTrueAfterOnCommand_1() + CHIP_ERROR TestReadAttributeInt64uMinValue_49() { - chip::Controller::OnOffClusterTest cluster; + chip::Controller::TestClusterClusterTest cluster; cluster.Associate(mDevice, 1); - return cluster.ReadAttributeOnOff(mOnSuccessCallback_1.Cancel(), mOnFailureCallback_1.Cancel()); + return cluster.ReadAttributeInt64u(mOnSuccessCallback_49.Cancel(), mOnFailureCallback_49.Cancel()); } - void OnFailureResponse_1(uint8_t status) { ThrowFailureResponse(); } + void OnFailureResponse_49(uint8_t status) { ThrowFailureResponse(); } - void OnSuccessResponse_1(bool onOff) + void OnSuccessResponse_49(uint64_t int64u) { - VerifyOrReturn(CheckValue("onOff", onOff, 1)); + VerifyOrReturn(CheckValue("int64u", int64u, 0ULL)); NextTest(); } - CHIP_ERROR TestMoveToColorTemperatureCommand_2() + CHIP_ERROR TestReadAttributeInt8sDefaultValue_50() { - chip::Controller::ColorControlClusterTest cluster; + chip::Controller::TestClusterClusterTest cluster; cluster.Associate(mDevice, 1); - uint16_t colorTemperatureArgument = 100U; - uint16_t transitionTimeArgument = 10U; - uint8_t optionsMaskArgument = 0; - uint8_t optionsOverrideArgument = 0; - - return cluster.MoveToColorTemperature(mOnSuccessCallback_2.Cancel(), mOnFailureCallback_2.Cancel(), - colorTemperatureArgument, transitionTimeArgument, optionsMaskArgument, - optionsOverrideArgument); + return cluster.ReadAttributeInt8s(mOnSuccessCallback_50.Cancel(), mOnFailureCallback_50.Cancel()); } - void OnFailureResponse_2(uint8_t status) { ThrowFailureResponse(); } + void OnFailureResponse_50(uint8_t status) { ThrowFailureResponse(); } - void OnSuccessResponse_2() { NextTest(); } + void OnSuccessResponse_50(int8_t int8s) + { + VerifyOrReturn(CheckValue("int8s", int8s, 0)); + NextTest(); + } - CHIP_ERROR TestTurnOffLightThatWeTurnedOn_3() + CHIP_ERROR TestWriteAttributeInt8sMaxValue_51() { - chip::Controller::OnOffClusterTest cluster; + chip::Controller::TestClusterClusterTest cluster; cluster.Associate(mDevice, 1); - return cluster.Off(mOnSuccessCallback_3.Cancel(), mOnFailureCallback_3.Cancel()); + int8_t int8sArgument = 127; + + return cluster.WriteAttributeInt8s(mOnSuccessCallback_51.Cancel(), mOnFailureCallback_51.Cancel(), int8sArgument); } - void OnFailureResponse_3(uint8_t status) { ThrowFailureResponse(); } + void OnFailureResponse_51(uint8_t status) { ThrowFailureResponse(); } - void OnSuccessResponse_3() { NextTest(); } + void OnSuccessResponse_51(int8_t int8s) { NextTest(); } - CHIP_ERROR TestCheckOnOffAttributeValueIsFalseAfterOffCommand_4() + CHIP_ERROR TestReadAttributeInt8sMaxValue_52() { - chip::Controller::OnOffClusterTest cluster; + chip::Controller::TestClusterClusterTest cluster; cluster.Associate(mDevice, 1); - return cluster.ReadAttributeOnOff(mOnSuccessCallback_4.Cancel(), mOnFailureCallback_4.Cancel()); + return cluster.ReadAttributeInt8s(mOnSuccessCallback_52.Cancel(), mOnFailureCallback_52.Cancel()); } - void OnFailureResponse_4(uint8_t status) { ThrowFailureResponse(); } + void OnFailureResponse_52(uint8_t status) { ThrowFailureResponse(); } - void OnSuccessResponse_4(bool onOff) + void OnSuccessResponse_52(int8_t int8s) { - VerifyOrReturn(CheckValue("onOff", onOff, 0)); + VerifyOrReturn(CheckValue("int8s", int8s, 127)); NextTest(); } -}; - -class Test_TC_CC_6_2 : public TestCommand -{ -public: - Test_TC_CC_6_2() : TestCommand("Test_TC_CC_6_2"), mTestIndex(0) {} - /////////// TestCommand Interface ///////// - void NextTest() override + CHIP_ERROR TestWriteAttributeInt8sMinValue_53() { - CHIP_ERROR err = CHIP_NO_ERROR; - - if (0 == mTestIndex) - { - ChipLogProgress(chipTool, " **** Test Start: Test_TC_CC_6_2\n"); - } - - if (mTestCount == mTestIndex) - { - ChipLogProgress(chipTool, " **** Test Complete: Test_TC_CC_6_2\n"); - SetCommandExitStatus(CHIP_NO_ERROR); - return; - } + chip::Controller::TestClusterClusterTest cluster; + cluster.Associate(mDevice, 1); - // Ensure we increment mTestIndex before we start running the relevant - // command. That way if we lose the timeslice after we send the message - // but before our function call returns, we won't end up with an - // incorrect mTestIndex value observed when we get the response. - switch (mTestIndex++) - { - case 0: - ChipLogProgress(chipTool, " ***** Test Step 0 : Turn on light for color control tests\n"); - err = TestTurnOnLightForColorControlTests_0(); - break; - case 1: - ChipLogProgress(chipTool, " ***** Test Step 1 : Check on/off attribute value is true after on command\n"); - err = TestCheckOnOffAttributeValueIsTrueAfterOnCommand_1(); - break; - case 2: - ChipLogProgress(chipTool, " ***** Test Step 2 : Move up color temperature command\n"); - err = TestMoveUpColorTemperatureCommand_2(); - break; - case 3: - ChipLogProgress(chipTool, " ***** Test Step 3 : Stop Color Temperature command\n"); - err = TestStopColorTemperatureCommand_3(); - break; - case 4: - ChipLogProgress(chipTool, " ***** Test Step 4 : Move down color temperature command\n"); - err = TestMoveDownColorTemperatureCommand_4(); - break; - case 5: - ChipLogProgress(chipTool, " ***** Test Step 5 : Turn off light that we turned on\n"); - err = TestTurnOffLightThatWeTurnedOn_5(); - break; - case 6: - ChipLogProgress(chipTool, " ***** Test Step 6 : Check on/off attribute value is false after off command\n"); - err = TestCheckOnOffAttributeValueIsFalseAfterOffCommand_6(); - break; - } + int8_t int8sArgument = -128; - if (CHIP_NO_ERROR != err) - { - ChipLogError(chipTool, " ***** Test Failure: %s\n", chip::ErrorStr(err)); - SetCommandExitStatus(err); - } + return cluster.WriteAttributeInt8s(mOnSuccessCallback_53.Cancel(), mOnFailureCallback_53.Cancel(), int8sArgument); } -private: - std::atomic_uint16_t mTestIndex; - const uint16_t mTestCount = 7; + void OnFailureResponse_53(uint8_t status) { ThrowFailureResponse(); } - chip::Callback::Callback mOnFailureCallback_0{ OnFailureCallback_0, this }; - chip::Callback::Callback mOnSuccessCallback_0{ OnSuccessCallback_0, this }; - chip::Callback::Callback mOnFailureCallback_1{ OnFailureCallback_1, this }; - chip::Callback::Callback mOnSuccessCallback_1{ OnSuccessCallback_1, this }; - chip::Callback::Callback mOnFailureCallback_2{ OnFailureCallback_2, this }; - chip::Callback::Callback mOnSuccessCallback_2{ OnSuccessCallback_2, this }; - chip::Callback::Callback mOnFailureCallback_3{ OnFailureCallback_3, this }; - chip::Callback::Callback mOnSuccessCallback_3{ OnSuccessCallback_3, this }; - chip::Callback::Callback mOnFailureCallback_4{ OnFailureCallback_4, this }; - chip::Callback::Callback mOnSuccessCallback_4{ OnSuccessCallback_4, this }; - chip::Callback::Callback mOnFailureCallback_5{ OnFailureCallback_5, this }; - chip::Callback::Callback mOnSuccessCallback_5{ OnSuccessCallback_5, this }; - chip::Callback::Callback mOnFailureCallback_6{ OnFailureCallback_6, this }; - chip::Callback::Callback mOnSuccessCallback_6{ OnSuccessCallback_6, this }; + void OnSuccessResponse_53(int8_t int8s) { NextTest(); } - static void OnFailureCallback_0(void * context, uint8_t status) + CHIP_ERROR TestReadAttributeInt8sMinValue_54() { - (static_cast(context))->OnFailureResponse_0(status); - } - - static void OnSuccessCallback_0(void * context) { (static_cast(context))->OnSuccessResponse_0(); } + chip::Controller::TestClusterClusterTest cluster; + cluster.Associate(mDevice, 1); - static void OnFailureCallback_1(void * context, uint8_t status) - { - (static_cast(context))->OnFailureResponse_1(status); + return cluster.ReadAttributeInt8s(mOnSuccessCallback_54.Cancel(), mOnFailureCallback_54.Cancel()); } - static void OnSuccessCallback_1(void * context, bool onOff) + void OnFailureResponse_54(uint8_t status) { ThrowFailureResponse(); } + + void OnSuccessResponse_54(int8_t int8s) { - (static_cast(context))->OnSuccessResponse_1(onOff); + VerifyOrReturn(CheckValue("int8s", int8s, -128)); + NextTest(); } - static void OnFailureCallback_2(void * context, uint8_t status) + CHIP_ERROR TestWriteAttributeInt8sDefaultValue_55() { - (static_cast(context))->OnFailureResponse_2(status); - } + chip::Controller::TestClusterClusterTest cluster; + cluster.Associate(mDevice, 1); - static void OnSuccessCallback_2(void * context) { (static_cast(context))->OnSuccessResponse_2(); } + int8_t int8sArgument = 0; - static void OnFailureCallback_3(void * context, uint8_t status) - { - (static_cast(context))->OnFailureResponse_3(status); + return cluster.WriteAttributeInt8s(mOnSuccessCallback_55.Cancel(), mOnFailureCallback_55.Cancel(), int8sArgument); } - static void OnSuccessCallback_3(void * context) { (static_cast(context))->OnSuccessResponse_3(); } + void OnFailureResponse_55(uint8_t status) { ThrowFailureResponse(); } - static void OnFailureCallback_4(void * context, uint8_t status) + void OnSuccessResponse_55(int8_t int8s) { NextTest(); } + + CHIP_ERROR TestReadAttributeInt8sDefaultValue_56() { - (static_cast(context))->OnFailureResponse_4(status); + chip::Controller::TestClusterClusterTest cluster; + cluster.Associate(mDevice, 1); + + return cluster.ReadAttributeInt8s(mOnSuccessCallback_56.Cancel(), mOnFailureCallback_56.Cancel()); } - static void OnSuccessCallback_4(void * context) { (static_cast(context))->OnSuccessResponse_4(); } + void OnFailureResponse_56(uint8_t status) { ThrowFailureResponse(); } - static void OnFailureCallback_5(void * context, uint8_t status) + void OnSuccessResponse_56(int8_t int8s) { - (static_cast(context))->OnFailureResponse_5(status); + VerifyOrReturn(CheckValue("int8s", int8s, 0)); + NextTest(); } - static void OnSuccessCallback_5(void * context) { (static_cast(context))->OnSuccessResponse_5(); } - - static void OnFailureCallback_6(void * context, uint8_t status) + CHIP_ERROR TestReadAttributeInt16sDefaultValue_57() { - (static_cast(context))->OnFailureResponse_6(status); + chip::Controller::TestClusterClusterTest cluster; + cluster.Associate(mDevice, 1); + + return cluster.ReadAttributeInt16s(mOnSuccessCallback_57.Cancel(), mOnFailureCallback_57.Cancel()); } - static void OnSuccessCallback_6(void * context, bool onOff) + void OnFailureResponse_57(uint8_t status) { ThrowFailureResponse(); } + + void OnSuccessResponse_57(int16_t int16s) { - (static_cast(context))->OnSuccessResponse_6(onOff); + VerifyOrReturn(CheckValue("int16s", int16s, 0)); + NextTest(); } - // - // Tests methods - // - - CHIP_ERROR TestTurnOnLightForColorControlTests_0() + CHIP_ERROR TestWriteAttributeInt16sMaxValue_58() { - chip::Controller::OnOffClusterTest cluster; + chip::Controller::TestClusterClusterTest cluster; cluster.Associate(mDevice, 1); - return cluster.On(mOnSuccessCallback_0.Cancel(), mOnFailureCallback_0.Cancel()); + int16_t int16sArgument = 32767; + + return cluster.WriteAttributeInt16s(mOnSuccessCallback_58.Cancel(), mOnFailureCallback_58.Cancel(), int16sArgument); } - void OnFailureResponse_0(uint8_t status) { ThrowFailureResponse(); } + void OnFailureResponse_58(uint8_t status) { ThrowFailureResponse(); } - void OnSuccessResponse_0() { NextTest(); } + void OnSuccessResponse_58(int16_t int16s) { NextTest(); } - CHIP_ERROR TestCheckOnOffAttributeValueIsTrueAfterOnCommand_1() + CHIP_ERROR TestReadAttributeInt16sMaxValue_59() { - chip::Controller::OnOffClusterTest cluster; + chip::Controller::TestClusterClusterTest cluster; cluster.Associate(mDevice, 1); - return cluster.ReadAttributeOnOff(mOnSuccessCallback_1.Cancel(), mOnFailureCallback_1.Cancel()); + return cluster.ReadAttributeInt16s(mOnSuccessCallback_59.Cancel(), mOnFailureCallback_59.Cancel()); } - void OnFailureResponse_1(uint8_t status) { ThrowFailureResponse(); } + void OnFailureResponse_59(uint8_t status) { ThrowFailureResponse(); } - void OnSuccessResponse_1(bool onOff) + void OnSuccessResponse_59(int16_t int16s) { - VerifyOrReturn(CheckValue("onOff", onOff, 1)); + VerifyOrReturn(CheckValue("int16s", int16s, 32767)); NextTest(); } - CHIP_ERROR TestMoveUpColorTemperatureCommand_2() + CHIP_ERROR TestWriteAttributeInt16sMinValue_60() { - chip::Controller::ColorControlClusterTest cluster; + chip::Controller::TestClusterClusterTest cluster; cluster.Associate(mDevice, 1); - uint8_t moveModeArgument = 1; - uint16_t rateArgument = 10U; - uint16_t colorTemperatureMinimumArgument = 1U; - uint16_t colorTemperatureMaximumArgument = 255U; - uint8_t optionsMaskArgument = 0; - uint8_t optionsOverrideArgument = 0; + int16_t int16sArgument = -32768; - return cluster.MoveColorTemperature(mOnSuccessCallback_2.Cancel(), mOnFailureCallback_2.Cancel(), moveModeArgument, - rateArgument, colorTemperatureMinimumArgument, colorTemperatureMaximumArgument, - optionsMaskArgument, optionsOverrideArgument); + return cluster.WriteAttributeInt16s(mOnSuccessCallback_60.Cancel(), mOnFailureCallback_60.Cancel(), int16sArgument); } - void OnFailureResponse_2(uint8_t status) { ThrowFailureResponse(); } + void OnFailureResponse_60(uint8_t status) { ThrowFailureResponse(); } - void OnSuccessResponse_2() { NextTest(); } + void OnSuccessResponse_60(int16_t int16s) { NextTest(); } - CHIP_ERROR TestStopColorTemperatureCommand_3() + CHIP_ERROR TestReadAttributeInt16sMinValue_61() { - chip::Controller::ColorControlClusterTest cluster; + chip::Controller::TestClusterClusterTest cluster; cluster.Associate(mDevice, 1); - uint8_t moveModeArgument = 0; - uint16_t rateArgument = 10U; - uint16_t colorTemperatureMinimumArgument = 1U; - uint16_t colorTemperatureMaximumArgument = 255U; - uint8_t optionsMaskArgument = 0; - uint8_t optionsOverrideArgument = 0; - - return cluster.MoveColorTemperature(mOnSuccessCallback_3.Cancel(), mOnFailureCallback_3.Cancel(), moveModeArgument, - rateArgument, colorTemperatureMinimumArgument, colorTemperatureMaximumArgument, - optionsMaskArgument, optionsOverrideArgument); + return cluster.ReadAttributeInt16s(mOnSuccessCallback_61.Cancel(), mOnFailureCallback_61.Cancel()); } - void OnFailureResponse_3(uint8_t status) { ThrowFailureResponse(); } + void OnFailureResponse_61(uint8_t status) { ThrowFailureResponse(); } - void OnSuccessResponse_3() { NextTest(); } + void OnSuccessResponse_61(int16_t int16s) + { + VerifyOrReturn(CheckValue("int16s", int16s, -32768)); + NextTest(); + } - CHIP_ERROR TestMoveDownColorTemperatureCommand_4() + CHIP_ERROR TestWriteAttributeInt16sDefaultValue_62() { - chip::Controller::ColorControlClusterTest cluster; + chip::Controller::TestClusterClusterTest cluster; cluster.Associate(mDevice, 1); - uint8_t moveModeArgument = 3; - uint16_t rateArgument = 20U; - uint16_t colorTemperatureMinimumArgument = 1U; - uint16_t colorTemperatureMaximumArgument = 255U; - uint8_t optionsMaskArgument = 0; - uint8_t optionsOverrideArgument = 0; + int16_t int16sArgument = 0; - return cluster.MoveColorTemperature(mOnSuccessCallback_4.Cancel(), mOnFailureCallback_4.Cancel(), moveModeArgument, - rateArgument, colorTemperatureMinimumArgument, colorTemperatureMaximumArgument, - optionsMaskArgument, optionsOverrideArgument); + return cluster.WriteAttributeInt16s(mOnSuccessCallback_62.Cancel(), mOnFailureCallback_62.Cancel(), int16sArgument); } - void OnFailureResponse_4(uint8_t status) { ThrowFailureResponse(); } + void OnFailureResponse_62(uint8_t status) { ThrowFailureResponse(); } - void OnSuccessResponse_4() { NextTest(); } + void OnSuccessResponse_62(int16_t int16s) { NextTest(); } - CHIP_ERROR TestTurnOffLightThatWeTurnedOn_5() + CHIP_ERROR TestReadAttributeInt16sDefaultValue_63() { - chip::Controller::OnOffClusterTest cluster; + chip::Controller::TestClusterClusterTest cluster; cluster.Associate(mDevice, 1); - return cluster.Off(mOnSuccessCallback_5.Cancel(), mOnFailureCallback_5.Cancel()); + return cluster.ReadAttributeInt16s(mOnSuccessCallback_63.Cancel(), mOnFailureCallback_63.Cancel()); } - void OnFailureResponse_5(uint8_t status) { ThrowFailureResponse(); } + void OnFailureResponse_63(uint8_t status) { ThrowFailureResponse(); } - void OnSuccessResponse_5() { NextTest(); } + void OnSuccessResponse_63(int16_t int16s) + { + VerifyOrReturn(CheckValue("int16s", int16s, 0)); + NextTest(); + } - CHIP_ERROR TestCheckOnOffAttributeValueIsFalseAfterOffCommand_6() + CHIP_ERROR TestReadAttributeInt32sDefaultValue_64() { - chip::Controller::OnOffClusterTest cluster; + chip::Controller::TestClusterClusterTest cluster; cluster.Associate(mDevice, 1); - return cluster.ReadAttributeOnOff(mOnSuccessCallback_6.Cancel(), mOnFailureCallback_6.Cancel()); + return cluster.ReadAttributeInt32s(mOnSuccessCallback_64.Cancel(), mOnFailureCallback_64.Cancel()); } - void OnFailureResponse_6(uint8_t status) { ThrowFailureResponse(); } + void OnFailureResponse_64(uint8_t status) { ThrowFailureResponse(); } - void OnSuccessResponse_6(bool onOff) + void OnSuccessResponse_64(int32_t int32s) { - VerifyOrReturn(CheckValue("onOff", onOff, 0)); + VerifyOrReturn(CheckValue("int32s", int32s, 0L)); NextTest(); } -}; - -class Test_TC_CC_6_3 : public TestCommand -{ -public: - Test_TC_CC_6_3() : TestCommand("Test_TC_CC_6_3"), mTestIndex(0) {} - /////////// TestCommand Interface ///////// - void NextTest() override + CHIP_ERROR TestWriteAttributeInt32sMaxValue_65() { - CHIP_ERROR err = CHIP_NO_ERROR; - - if (0 == mTestIndex) - { - ChipLogProgress(chipTool, " **** Test Start: Test_TC_CC_6_3\n"); - } - - if (mTestCount == mTestIndex) - { - ChipLogProgress(chipTool, " **** Test Complete: Test_TC_CC_6_3\n"); - SetCommandExitStatus(CHIP_NO_ERROR); - return; - } + chip::Controller::TestClusterClusterTest cluster; + cluster.Associate(mDevice, 1); - // Ensure we increment mTestIndex before we start running the relevant - // command. That way if we lose the timeslice after we send the message - // but before our function call returns, we won't end up with an - // incorrect mTestIndex value observed when we get the response. - switch (mTestIndex++) - { - case 0: - ChipLogProgress(chipTool, " ***** Test Step 0 : Turn on light for color control tests\n"); - err = TestTurnOnLightForColorControlTests_0(); - break; - case 1: - ChipLogProgress(chipTool, " ***** Test Step 1 : Check on/off attribute value is true after on command\n"); - err = TestCheckOnOffAttributeValueIsTrueAfterOnCommand_1(); - break; - case 2: - ChipLogProgress(chipTool, " ***** Test Step 2 : Step up color temperature command\n"); - err = TestStepUpColorTemperatureCommand_2(); - break; - case 3: - ChipLogProgress(chipTool, " ***** Test Step 3 : Step down color temperature command\n"); - err = TestStepDownColorTemperatureCommand_3(); - break; - case 4: - ChipLogProgress(chipTool, " ***** Test Step 4 : Turn off light that we turned on\n"); - err = TestTurnOffLightThatWeTurnedOn_4(); - break; - case 5: - ChipLogProgress(chipTool, " ***** Test Step 5 : Check on/off attribute value is false after off command\n"); - err = TestCheckOnOffAttributeValueIsFalseAfterOffCommand_5(); - break; - } + int32_t int32sArgument = 2147483647L; - if (CHIP_NO_ERROR != err) - { - ChipLogError(chipTool, " ***** Test Failure: %s\n", chip::ErrorStr(err)); - SetCommandExitStatus(err); - } + return cluster.WriteAttributeInt32s(mOnSuccessCallback_65.Cancel(), mOnFailureCallback_65.Cancel(), int32sArgument); } -private: - std::atomic_uint16_t mTestIndex; - const uint16_t mTestCount = 6; + void OnFailureResponse_65(uint8_t status) { ThrowFailureResponse(); } - chip::Callback::Callback mOnFailureCallback_0{ OnFailureCallback_0, this }; - chip::Callback::Callback mOnSuccessCallback_0{ OnSuccessCallback_0, this }; - chip::Callback::Callback mOnFailureCallback_1{ OnFailureCallback_1, this }; - chip::Callback::Callback mOnSuccessCallback_1{ OnSuccessCallback_1, this }; - chip::Callback::Callback mOnFailureCallback_2{ OnFailureCallback_2, this }; - chip::Callback::Callback mOnSuccessCallback_2{ OnSuccessCallback_2, this }; - chip::Callback::Callback mOnFailureCallback_3{ OnFailureCallback_3, this }; - chip::Callback::Callback mOnSuccessCallback_3{ OnSuccessCallback_3, this }; - chip::Callback::Callback mOnFailureCallback_4{ OnFailureCallback_4, this }; - chip::Callback::Callback mOnSuccessCallback_4{ OnSuccessCallback_4, this }; - chip::Callback::Callback mOnFailureCallback_5{ OnFailureCallback_5, this }; - chip::Callback::Callback mOnSuccessCallback_5{ OnSuccessCallback_5, this }; + void OnSuccessResponse_65(int32_t int32s) { NextTest(); } - static void OnFailureCallback_0(void * context, uint8_t status) + CHIP_ERROR TestReadAttributeInt32sMaxValue_66() { - (static_cast(context))->OnFailureResponse_0(status); - } - - static void OnSuccessCallback_0(void * context) { (static_cast(context))->OnSuccessResponse_0(); } + chip::Controller::TestClusterClusterTest cluster; + cluster.Associate(mDevice, 1); - static void OnFailureCallback_1(void * context, uint8_t status) - { - (static_cast(context))->OnFailureResponse_1(status); + return cluster.ReadAttributeInt32s(mOnSuccessCallback_66.Cancel(), mOnFailureCallback_66.Cancel()); } - static void OnSuccessCallback_1(void * context, bool onOff) + void OnFailureResponse_66(uint8_t status) { ThrowFailureResponse(); } + + void OnSuccessResponse_66(int32_t int32s) { - (static_cast(context))->OnSuccessResponse_1(onOff); + VerifyOrReturn(CheckValue("int32s", int32s, 2147483647L)); + NextTest(); } - static void OnFailureCallback_2(void * context, uint8_t status) + CHIP_ERROR TestWriteAttributeInt32sMinValue_67() { - (static_cast(context))->OnFailureResponse_2(status); - } + chip::Controller::TestClusterClusterTest cluster; + cluster.Associate(mDevice, 1); - static void OnSuccessCallback_2(void * context) { (static_cast(context))->OnSuccessResponse_2(); } + int32_t int32sArgument = -2147483648L; - static void OnFailureCallback_3(void * context, uint8_t status) - { - (static_cast(context))->OnFailureResponse_3(status); + return cluster.WriteAttributeInt32s(mOnSuccessCallback_67.Cancel(), mOnFailureCallback_67.Cancel(), int32sArgument); } - static void OnSuccessCallback_3(void * context) { (static_cast(context))->OnSuccessResponse_3(); } + void OnFailureResponse_67(uint8_t status) { ThrowFailureResponse(); } - static void OnFailureCallback_4(void * context, uint8_t status) + void OnSuccessResponse_67(int32_t int32s) { NextTest(); } + + CHIP_ERROR TestReadAttributeInt32sMinValue_68() { - (static_cast(context))->OnFailureResponse_4(status); + chip::Controller::TestClusterClusterTest cluster; + cluster.Associate(mDevice, 1); + + return cluster.ReadAttributeInt32s(mOnSuccessCallback_68.Cancel(), mOnFailureCallback_68.Cancel()); } - static void OnSuccessCallback_4(void * context) { (static_cast(context))->OnSuccessResponse_4(); } + void OnFailureResponse_68(uint8_t status) { ThrowFailureResponse(); } - static void OnFailureCallback_5(void * context, uint8_t status) + void OnSuccessResponse_68(int32_t int32s) { - (static_cast(context))->OnFailureResponse_5(status); + VerifyOrReturn(CheckValue("int32s", int32s, -2147483648L)); + NextTest(); } - static void OnSuccessCallback_5(void * context, bool onOff) + CHIP_ERROR TestWriteAttributeInt32sDefaultValue_69() { - (static_cast(context))->OnSuccessResponse_5(onOff); + chip::Controller::TestClusterClusterTest cluster; + cluster.Associate(mDevice, 1); + + int32_t int32sArgument = 0L; + + return cluster.WriteAttributeInt32s(mOnSuccessCallback_69.Cancel(), mOnFailureCallback_69.Cancel(), int32sArgument); } - // - // Tests methods - // + void OnFailureResponse_69(uint8_t status) { ThrowFailureResponse(); } + + void OnSuccessResponse_69(int32_t int32s) { NextTest(); } - CHIP_ERROR TestTurnOnLightForColorControlTests_0() + CHIP_ERROR TestReadAttributeInt32sDefaultValue_70() { - chip::Controller::OnOffClusterTest cluster; + chip::Controller::TestClusterClusterTest cluster; cluster.Associate(mDevice, 1); - return cluster.On(mOnSuccessCallback_0.Cancel(), mOnFailureCallback_0.Cancel()); + return cluster.ReadAttributeInt32s(mOnSuccessCallback_70.Cancel(), mOnFailureCallback_70.Cancel()); } - void OnFailureResponse_0(uint8_t status) { ThrowFailureResponse(); } + void OnFailureResponse_70(uint8_t status) { ThrowFailureResponse(); } - void OnSuccessResponse_0() { NextTest(); } + void OnSuccessResponse_70(int32_t int32s) + { + VerifyOrReturn(CheckValue("int32s", int32s, 0L)); + NextTest(); + } - CHIP_ERROR TestCheckOnOffAttributeValueIsTrueAfterOnCommand_1() + CHIP_ERROR TestReadAttributeInt64sDefaultValue_71() { - chip::Controller::OnOffClusterTest cluster; + chip::Controller::TestClusterClusterTest cluster; cluster.Associate(mDevice, 1); - return cluster.ReadAttributeOnOff(mOnSuccessCallback_1.Cancel(), mOnFailureCallback_1.Cancel()); + return cluster.ReadAttributeInt64s(mOnSuccessCallback_71.Cancel(), mOnFailureCallback_71.Cancel()); } - void OnFailureResponse_1(uint8_t status) { ThrowFailureResponse(); } + void OnFailureResponse_71(uint8_t status) { ThrowFailureResponse(); } - void OnSuccessResponse_1(bool onOff) + void OnSuccessResponse_71(int64_t int64s) { - VerifyOrReturn(CheckValue("onOff", onOff, 1)); + VerifyOrReturn(CheckValue("int64s", int64s, 0LL)); NextTest(); } - CHIP_ERROR TestStepUpColorTemperatureCommand_2() + CHIP_ERROR TestWriteAttributeInt64sMaxValue_72() { - chip::Controller::ColorControlClusterTest cluster; + chip::Controller::TestClusterClusterTest cluster; cluster.Associate(mDevice, 1); - uint8_t stepModeArgument = 1; - uint16_t stepSizeArgument = 5U; - uint16_t transitionTimeArgument = 50U; - uint16_t colorTemperatureMinimumArgument = 5U; - uint16_t colorTemperatureMaximumArgument = 100U; - uint8_t optionsMaskArgument = 0; - uint8_t optionsOverrideArgument = 0; + int64_t int64sArgument = 9223372036854775807LL; - return cluster.StepColorTemperature(mOnSuccessCallback_2.Cancel(), mOnFailureCallback_2.Cancel(), stepModeArgument, - stepSizeArgument, transitionTimeArgument, colorTemperatureMinimumArgument, - colorTemperatureMaximumArgument, optionsMaskArgument, optionsOverrideArgument); + return cluster.WriteAttributeInt64s(mOnSuccessCallback_72.Cancel(), mOnFailureCallback_72.Cancel(), int64sArgument); } - void OnFailureResponse_2(uint8_t status) { ThrowFailureResponse(); } + void OnFailureResponse_72(uint8_t status) { ThrowFailureResponse(); } - void OnSuccessResponse_2() { NextTest(); } + void OnSuccessResponse_72(int64_t int64s) { NextTest(); } - CHIP_ERROR TestStepDownColorTemperatureCommand_3() + CHIP_ERROR TestReadAttributeInt64sMaxValue_73() { - chip::Controller::ColorControlClusterTest cluster; + chip::Controller::TestClusterClusterTest cluster; cluster.Associate(mDevice, 1); - uint8_t stepModeArgument = 3; - uint16_t stepSizeArgument = 5U; - uint16_t transitionTimeArgument = 50U; - uint16_t colorTemperatureMinimumArgument = 5U; - uint16_t colorTemperatureMaximumArgument = 100U; - uint8_t optionsMaskArgument = 0; - uint8_t optionsOverrideArgument = 0; - - return cluster.StepColorTemperature(mOnSuccessCallback_3.Cancel(), mOnFailureCallback_3.Cancel(), stepModeArgument, - stepSizeArgument, transitionTimeArgument, colorTemperatureMinimumArgument, - colorTemperatureMaximumArgument, optionsMaskArgument, optionsOverrideArgument); + return cluster.ReadAttributeInt64s(mOnSuccessCallback_73.Cancel(), mOnFailureCallback_73.Cancel()); } - void OnFailureResponse_3(uint8_t status) { ThrowFailureResponse(); } + void OnFailureResponse_73(uint8_t status) { ThrowFailureResponse(); } - void OnSuccessResponse_3() { NextTest(); } + void OnSuccessResponse_73(int64_t int64s) + { + VerifyOrReturn(CheckValue("int64s", int64s, 9223372036854775807LL)); + NextTest(); + } - CHIP_ERROR TestTurnOffLightThatWeTurnedOn_4() + CHIP_ERROR TestWriteAttributeInt64sMinValue_74() { - chip::Controller::OnOffClusterTest cluster; + chip::Controller::TestClusterClusterTest cluster; cluster.Associate(mDevice, 1); - return cluster.Off(mOnSuccessCallback_4.Cancel(), mOnFailureCallback_4.Cancel()); + int64_t int64sArgument = -9223372036854775807LL; + + return cluster.WriteAttributeInt64s(mOnSuccessCallback_74.Cancel(), mOnFailureCallback_74.Cancel(), int64sArgument); } - void OnFailureResponse_4(uint8_t status) { ThrowFailureResponse(); } + void OnFailureResponse_74(uint8_t status) { ThrowFailureResponse(); } - void OnSuccessResponse_4() { NextTest(); } + void OnSuccessResponse_74(int64_t int64s) { NextTest(); } - CHIP_ERROR TestCheckOnOffAttributeValueIsFalseAfterOffCommand_5() + CHIP_ERROR TestReadAttributeInt64sMinValue_75() { - chip::Controller::OnOffClusterTest cluster; + chip::Controller::TestClusterClusterTest cluster; cluster.Associate(mDevice, 1); - return cluster.ReadAttributeOnOff(mOnSuccessCallback_5.Cancel(), mOnFailureCallback_5.Cancel()); + return cluster.ReadAttributeInt64s(mOnSuccessCallback_75.Cancel(), mOnFailureCallback_75.Cancel()); } - void OnFailureResponse_5(uint8_t status) { ThrowFailureResponse(); } + void OnFailureResponse_75(uint8_t status) { ThrowFailureResponse(); } - void OnSuccessResponse_5(bool onOff) + void OnSuccessResponse_75(int64_t int64s) { - VerifyOrReturn(CheckValue("onOff", onOff, 0)); + VerifyOrReturn(CheckValue("int64s", int64s, -9223372036854775807LL)); NextTest(); } -}; - -class Test_TC_CC_7_1 : public TestCommand -{ -public: - Test_TC_CC_7_1() : TestCommand("Test_TC_CC_7_1"), mTestIndex(0) {} - /////////// TestCommand Interface ///////// - void NextTest() override + CHIP_ERROR TestWriteAttributeInt64sDefaultValue_76() { - CHIP_ERROR err = CHIP_NO_ERROR; - - if (0 == mTestIndex) - { - ChipLogProgress(chipTool, " **** Test Start: Test_TC_CC_7_1\n"); - } - - if (mTestCount == mTestIndex) - { - ChipLogProgress(chipTool, " **** Test Complete: Test_TC_CC_7_1\n"); - SetCommandExitStatus(CHIP_NO_ERROR); - return; - } + chip::Controller::TestClusterClusterTest cluster; + cluster.Associate(mDevice, 1); - // Ensure we increment mTestIndex before we start running the relevant - // command. That way if we lose the timeslice after we send the message - // but before our function call returns, we won't end up with an - // incorrect mTestIndex value observed when we get the response. - switch (mTestIndex++) - { - case 0: - ChipLogProgress(chipTool, " ***** Test Step 0 : Turn on light for color control tests\n"); - err = TestTurnOnLightForColorControlTests_0(); - break; - case 1: - ChipLogProgress(chipTool, " ***** Test Step 1 : Check on/off attribute value is true after on command\n"); - err = TestCheckOnOffAttributeValueIsTrueAfterOnCommand_1(); - break; - case 2: - ChipLogProgress(chipTool, " ***** Test Step 2 : Enhanced Move To Hue command\n"); - err = TestEnhancedMoveToHueCommand_2(); - break; - case 3: - ChipLogProgress( - chipTool, " ***** Test Step 3 : Check Remaining time attribute value matched the value sent by the last command\n"); - err = TestCheckRemainingTimeAttributeValueMatchedTheValueSentByTheLastCommand_3(); - break; - case 4: - ChipLogProgress(chipTool, " ***** Test Step 4 : Turn off light that we turned on\n"); - err = TestTurnOffLightThatWeTurnedOn_4(); - break; - case 5: - ChipLogProgress(chipTool, " ***** Test Step 5 : Check on/off attribute value is false after off command\n"); - err = TestCheckOnOffAttributeValueIsFalseAfterOffCommand_5(); - break; - } + int64_t int64sArgument = 0LL; - if (CHIP_NO_ERROR != err) - { - ChipLogError(chipTool, " ***** Test Failure: %s\n", chip::ErrorStr(err)); - SetCommandExitStatus(err); - } + return cluster.WriteAttributeInt64s(mOnSuccessCallback_76.Cancel(), mOnFailureCallback_76.Cancel(), int64sArgument); } -private: - std::atomic_uint16_t mTestIndex; - const uint16_t mTestCount = 6; + void OnFailureResponse_76(uint8_t status) { ThrowFailureResponse(); } - chip::Callback::Callback mOnFailureCallback_0{ OnFailureCallback_0, this }; - chip::Callback::Callback mOnSuccessCallback_0{ OnSuccessCallback_0, this }; - chip::Callback::Callback mOnFailureCallback_1{ OnFailureCallback_1, this }; - chip::Callback::Callback mOnSuccessCallback_1{ OnSuccessCallback_1, this }; - chip::Callback::Callback mOnFailureCallback_2{ OnFailureCallback_2, this }; - chip::Callback::Callback mOnSuccessCallback_2{ OnSuccessCallback_2, this }; - chip::Callback::Callback mOnFailureCallback_3{ OnFailureCallback_3, this }; - chip::Callback::Callback mOnSuccessCallback_3{ OnSuccessCallback_3, this }; - chip::Callback::Callback mOnFailureCallback_4{ OnFailureCallback_4, this }; - chip::Callback::Callback mOnSuccessCallback_4{ OnSuccessCallback_4, this }; - chip::Callback::Callback mOnFailureCallback_5{ OnFailureCallback_5, this }; - chip::Callback::Callback mOnSuccessCallback_5{ OnSuccessCallback_5, this }; + void OnSuccessResponse_76(int64_t int64s) { NextTest(); } - static void OnFailureCallback_0(void * context, uint8_t status) + CHIP_ERROR TestReadAttributeInt64sDefaultValue_77() { - (static_cast(context))->OnFailureResponse_0(status); + chip::Controller::TestClusterClusterTest cluster; + cluster.Associate(mDevice, 1); + + return cluster.ReadAttributeInt64s(mOnSuccessCallback_77.Cancel(), mOnFailureCallback_77.Cancel()); } - static void OnSuccessCallback_0(void * context) { (static_cast(context))->OnSuccessResponse_0(); } + void OnFailureResponse_77(uint8_t status) { ThrowFailureResponse(); } - static void OnFailureCallback_1(void * context, uint8_t status) + void OnSuccessResponse_77(int64_t int64s) { - (static_cast(context))->OnFailureResponse_1(status); + VerifyOrReturn(CheckValue("int64s", int64s, 0LL)); + NextTest(); } - static void OnSuccessCallback_1(void * context, bool onOff) + CHIP_ERROR TestReadAttributeEnum8DefaultValue_78() { - (static_cast(context))->OnSuccessResponse_1(onOff); - } + chip::Controller::TestClusterClusterTest cluster; + cluster.Associate(mDevice, 1); - static void OnFailureCallback_2(void * context, uint8_t status) - { - (static_cast(context))->OnFailureResponse_2(status); + return cluster.ReadAttributeEnum8(mOnSuccessCallback_78.Cancel(), mOnFailureCallback_78.Cancel()); } - static void OnSuccessCallback_2(void * context) { (static_cast(context))->OnSuccessResponse_2(); } + void OnFailureResponse_78(uint8_t status) { ThrowFailureResponse(); } - static void OnFailureCallback_3(void * context, uint8_t status) + void OnSuccessResponse_78(uint8_t enum8) { - (static_cast(context))->OnFailureResponse_3(status); + VerifyOrReturn(CheckValue("enum8", enum8, 0)); + NextTest(); } - static void OnSuccessCallback_3(void * context, uint16_t remainingTime) + CHIP_ERROR TestWriteAttributeEnum8MaxValue_79() { - (static_cast(context))->OnSuccessResponse_3(remainingTime); + chip::Controller::TestClusterClusterTest cluster; + cluster.Associate(mDevice, 1); + + uint8_t enum8Argument = 255; + + return cluster.WriteAttributeEnum8(mOnSuccessCallback_79.Cancel(), mOnFailureCallback_79.Cancel(), enum8Argument); } - static void OnFailureCallback_4(void * context, uint8_t status) + void OnFailureResponse_79(uint8_t status) { ThrowFailureResponse(); } + + void OnSuccessResponse_79(uint8_t enum8) { NextTest(); } + + CHIP_ERROR TestReadAttributeEnum8MaxValue_80() { - (static_cast(context))->OnFailureResponse_4(status); + chip::Controller::TestClusterClusterTest cluster; + cluster.Associate(mDevice, 1); + + return cluster.ReadAttributeEnum8(mOnSuccessCallback_80.Cancel(), mOnFailureCallback_80.Cancel()); } - static void OnSuccessCallback_4(void * context) { (static_cast(context))->OnSuccessResponse_4(); } + void OnFailureResponse_80(uint8_t status) { ThrowFailureResponse(); } - static void OnFailureCallback_5(void * context, uint8_t status) + void OnSuccessResponse_80(uint8_t enum8) { - (static_cast(context))->OnFailureResponse_5(status); + VerifyOrReturn(CheckValue("enum8", enum8, 255)); + NextTest(); } - static void OnSuccessCallback_5(void * context, bool onOff) + CHIP_ERROR TestWriteAttributeEnum8MinValue_81() { - (static_cast(context))->OnSuccessResponse_5(onOff); + chip::Controller::TestClusterClusterTest cluster; + cluster.Associate(mDevice, 1); + + uint8_t enum8Argument = 0; + + return cluster.WriteAttributeEnum8(mOnSuccessCallback_81.Cancel(), mOnFailureCallback_81.Cancel(), enum8Argument); } - // - // Tests methods - // + void OnFailureResponse_81(uint8_t status) { ThrowFailureResponse(); } - CHIP_ERROR TestTurnOnLightForColorControlTests_0() + void OnSuccessResponse_81(uint8_t enum8) { NextTest(); } + + CHIP_ERROR TestReadAttributeEnum8MinValue_82() { - chip::Controller::OnOffClusterTest cluster; + chip::Controller::TestClusterClusterTest cluster; cluster.Associate(mDevice, 1); - return cluster.On(mOnSuccessCallback_0.Cancel(), mOnFailureCallback_0.Cancel()); + return cluster.ReadAttributeEnum8(mOnSuccessCallback_82.Cancel(), mOnFailureCallback_82.Cancel()); } - void OnFailureResponse_0(uint8_t status) { ThrowFailureResponse(); } + void OnFailureResponse_82(uint8_t status) { ThrowFailureResponse(); } - void OnSuccessResponse_0() { NextTest(); } + void OnSuccessResponse_82(uint8_t enum8) + { + VerifyOrReturn(CheckValue("enum8", enum8, 0)); + NextTest(); + } - CHIP_ERROR TestCheckOnOffAttributeValueIsTrueAfterOnCommand_1() + CHIP_ERROR TestReadAttributeEnum16DefaultValue_83() { - chip::Controller::OnOffClusterTest cluster; + chip::Controller::TestClusterClusterTest cluster; cluster.Associate(mDevice, 1); - return cluster.ReadAttributeOnOff(mOnSuccessCallback_1.Cancel(), mOnFailureCallback_1.Cancel()); + return cluster.ReadAttributeEnum16(mOnSuccessCallback_83.Cancel(), mOnFailureCallback_83.Cancel()); } - void OnFailureResponse_1(uint8_t status) { ThrowFailureResponse(); } + void OnFailureResponse_83(uint8_t status) { ThrowFailureResponse(); } - void OnSuccessResponse_1(bool onOff) + void OnSuccessResponse_83(uint16_t enum16) { - VerifyOrReturn(CheckValue("onOff", onOff, 1)); + VerifyOrReturn(CheckValue("enum16", enum16, 0U)); NextTest(); } - CHIP_ERROR TestEnhancedMoveToHueCommand_2() + CHIP_ERROR TestWriteAttributeEnum16MaxValue_84() { - chip::Controller::ColorControlClusterTest cluster; + chip::Controller::TestClusterClusterTest cluster; cluster.Associate(mDevice, 1); - uint16_t enhancedHueArgument = 1025U; - uint8_t directionArgument = 0; - uint16_t transitionTimeArgument = 1U; - uint8_t optionsMaskArgument = 0; - uint8_t optionsOverrideArgument = 0; + uint16_t enum16Argument = 65535U; - return cluster.EnhancedMoveToHue(mOnSuccessCallback_2.Cancel(), mOnFailureCallback_2.Cancel(), enhancedHueArgument, - directionArgument, transitionTimeArgument, optionsMaskArgument, optionsOverrideArgument); + return cluster.WriteAttributeEnum16(mOnSuccessCallback_84.Cancel(), mOnFailureCallback_84.Cancel(), enum16Argument); } - void OnFailureResponse_2(uint8_t status) { ThrowFailureResponse(); } + void OnFailureResponse_84(uint8_t status) { ThrowFailureResponse(); } - void OnSuccessResponse_2() { NextTest(); } + void OnSuccessResponse_84(uint16_t enum16) { NextTest(); } - CHIP_ERROR TestCheckRemainingTimeAttributeValueMatchedTheValueSentByTheLastCommand_3() + CHIP_ERROR TestReadAttributeEnum16MaxValue_85() { - chip::Controller::ColorControlClusterTest cluster; + chip::Controller::TestClusterClusterTest cluster; cluster.Associate(mDevice, 1); - return cluster.ReadAttributeRemainingTime(mOnSuccessCallback_3.Cancel(), mOnFailureCallback_3.Cancel()); + return cluster.ReadAttributeEnum16(mOnSuccessCallback_85.Cancel(), mOnFailureCallback_85.Cancel()); } - void OnFailureResponse_3(uint8_t status) { ThrowFailureResponse(); } + void OnFailureResponse_85(uint8_t status) { ThrowFailureResponse(); } - void OnSuccessResponse_3(uint16_t remainingTime) + void OnSuccessResponse_85(uint16_t enum16) { - VerifyOrReturn(CheckValue("remainingTime", remainingTime, 1U)); + VerifyOrReturn(CheckValue("enum16", enum16, 65535U)); NextTest(); } - CHIP_ERROR TestTurnOffLightThatWeTurnedOn_4() + CHIP_ERROR TestWriteAttributeEnum16MinValue_86() { - chip::Controller::OnOffClusterTest cluster; + chip::Controller::TestClusterClusterTest cluster; cluster.Associate(mDevice, 1); - return cluster.Off(mOnSuccessCallback_4.Cancel(), mOnFailureCallback_4.Cancel()); + uint16_t enum16Argument = 0U; + + return cluster.WriteAttributeEnum16(mOnSuccessCallback_86.Cancel(), mOnFailureCallback_86.Cancel(), enum16Argument); } - void OnFailureResponse_4(uint8_t status) { ThrowFailureResponse(); } + void OnFailureResponse_86(uint8_t status) { ThrowFailureResponse(); } - void OnSuccessResponse_4() { NextTest(); } + void OnSuccessResponse_86(uint16_t enum16) { NextTest(); } - CHIP_ERROR TestCheckOnOffAttributeValueIsFalseAfterOffCommand_5() + CHIP_ERROR TestReadAttributeEnum16MinValue_87() { - chip::Controller::OnOffClusterTest cluster; + chip::Controller::TestClusterClusterTest cluster; cluster.Associate(mDevice, 1); - return cluster.ReadAttributeOnOff(mOnSuccessCallback_5.Cancel(), mOnFailureCallback_5.Cancel()); + return cluster.ReadAttributeEnum16(mOnSuccessCallback_87.Cancel(), mOnFailureCallback_87.Cancel()); } - void OnFailureResponse_5(uint8_t status) { ThrowFailureResponse(); } + void OnFailureResponse_87(uint8_t status) { ThrowFailureResponse(); } - void OnSuccessResponse_5(bool onOff) + void OnSuccessResponse_87(uint16_t enum16) { - VerifyOrReturn(CheckValue("onOff", onOff, 0)); + VerifyOrReturn(CheckValue("enum16", enum16, 0U)); NextTest(); } -}; - -class Test_TC_CC_7_2 : public TestCommand -{ -public: - Test_TC_CC_7_2() : TestCommand("Test_TC_CC_7_2"), mTestIndex(0) {} - /////////// TestCommand Interface ///////// - void NextTest() override + CHIP_ERROR TestReadAttributeOctetStringDefaultValue_88() { - CHIP_ERROR err = CHIP_NO_ERROR; - - if (0 == mTestIndex) - { - ChipLogProgress(chipTool, " **** Test Start: Test_TC_CC_7_2\n"); - } + chip::Controller::TestClusterClusterTest cluster; + cluster.Associate(mDevice, 1); - if (mTestCount == mTestIndex) - { - ChipLogProgress(chipTool, " **** Test Complete: Test_TC_CC_7_2\n"); - SetCommandExitStatus(CHIP_NO_ERROR); - return; - } + return cluster.ReadAttributeOctetString(mOnSuccessCallback_88.Cancel(), mOnFailureCallback_88.Cancel()); + } - // Ensure we increment mTestIndex before we start running the relevant - // command. That way if we lose the timeslice after we send the message - // but before our function call returns, we won't end up with an - // incorrect mTestIndex value observed when we get the response. - switch (mTestIndex++) - { - case 0: - ChipLogProgress(chipTool, " ***** Test Step 0 : Turn on light for color control tests\n"); - err = TestTurnOnLightForColorControlTests_0(); - break; - case 1: - ChipLogProgress(chipTool, " ***** Test Step 1 : Check on/off attribute value is true after on command\n"); - err = TestCheckOnOffAttributeValueIsTrueAfterOnCommand_1(); - break; - case 2: - ChipLogProgress(chipTool, " ***** Test Step 2 : Enhanced Move Hue Down command \n"); - err = TestEnhancedMoveHueDownCommand_2(); - break; - case 3: - ChipLogProgress(chipTool, " ***** Test Step 3 : Enhanced Move Hue Stop command\n"); - err = TestEnhancedMoveHueStopCommand_3(); - break; - case 4: - ChipLogProgress(chipTool, " ***** Test Step 4 : Enhanced Move Hue Up command\n"); - err = TestEnhancedMoveHueUpCommand_4(); - break; - case 5: - ChipLogProgress(chipTool, " ***** Test Step 5 : Enhanced Move Hue Stop command\n"); - err = TestEnhancedMoveHueStopCommand_5(); - break; - case 6: - ChipLogProgress(chipTool, " ***** Test Step 6 : Turn off light that we turned on\n"); - err = TestTurnOffLightThatWeTurnedOn_6(); - break; - case 7: - ChipLogProgress(chipTool, " ***** Test Step 7 : Check on/off attribute value is false after off command\n"); - err = TestCheckOnOffAttributeValueIsFalseAfterOffCommand_7(); - break; - } + void OnFailureResponse_88(uint8_t status) { ThrowFailureResponse(); } - if (CHIP_NO_ERROR != err) - { - ChipLogError(chipTool, " ***** Test Failure: %s\n", chip::ErrorStr(err)); - SetCommandExitStatus(err); - } + void OnSuccessResponse_88(chip::ByteSpan octetString) + { + VerifyOrReturn(CheckValueAsString("octetString", octetString, "")); + NextTest(); } -private: - std::atomic_uint16_t mTestIndex; - const uint16_t mTestCount = 8; + CHIP_ERROR TestWriteAttributeOctetString_89() + { + chip::Controller::TestClusterClusterTest cluster; + cluster.Associate(mDevice, 1); - chip::Callback::Callback mOnFailureCallback_0{ OnFailureCallback_0, this }; - chip::Callback::Callback mOnSuccessCallback_0{ OnSuccessCallback_0, this }; - chip::Callback::Callback mOnFailureCallback_1{ OnFailureCallback_1, this }; - chip::Callback::Callback mOnSuccessCallback_1{ OnSuccessCallback_1, this }; - chip::Callback::Callback mOnFailureCallback_2{ OnFailureCallback_2, this }; - chip::Callback::Callback mOnSuccessCallback_2{ OnSuccessCallback_2, this }; - chip::Callback::Callback mOnFailureCallback_3{ OnFailureCallback_3, this }; - chip::Callback::Callback mOnSuccessCallback_3{ OnSuccessCallback_3, this }; - chip::Callback::Callback mOnFailureCallback_4{ OnFailureCallback_4, this }; - chip::Callback::Callback mOnSuccessCallback_4{ OnSuccessCallback_4, this }; - chip::Callback::Callback mOnFailureCallback_5{ OnFailureCallback_5, this }; - chip::Callback::Callback mOnSuccessCallback_5{ OnSuccessCallback_5, this }; - chip::Callback::Callback mOnFailureCallback_6{ OnFailureCallback_6, this }; - chip::Callback::Callback mOnSuccessCallback_6{ OnSuccessCallback_6, this }; - chip::Callback::Callback mOnFailureCallback_7{ OnFailureCallback_7, this }; - chip::Callback::Callback mOnSuccessCallback_7{ OnSuccessCallback_7, this }; + chip::ByteSpan octetStringArgument = chip::ByteSpan(chip::Uint8::from_const_char("TestValue"), strlen("TestValue")); - static void OnFailureCallback_0(void * context, uint8_t status) - { - (static_cast(context))->OnFailureResponse_0(status); + return cluster.WriteAttributeOctetString(mOnSuccessCallback_89.Cancel(), mOnFailureCallback_89.Cancel(), + octetStringArgument); } - static void OnSuccessCallback_0(void * context) { (static_cast(context))->OnSuccessResponse_0(); } + void OnFailureResponse_89(uint8_t status) { ThrowFailureResponse(); } - static void OnFailureCallback_1(void * context, uint8_t status) + void OnSuccessResponse_89(chip::ByteSpan octetString) { NextTest(); } + + CHIP_ERROR TestReadAttributeOctetString_90() { - (static_cast(context))->OnFailureResponse_1(status); + chip::Controller::TestClusterClusterTest cluster; + cluster.Associate(mDevice, 1); + + return cluster.ReadAttributeOctetString(mOnSuccessCallback_90.Cancel(), mOnFailureCallback_90.Cancel()); } - static void OnSuccessCallback_1(void * context, bool onOff) + void OnFailureResponse_90(uint8_t status) { ThrowFailureResponse(); } + + void OnSuccessResponse_90(chip::ByteSpan octetString) { - (static_cast(context))->OnSuccessResponse_1(onOff); + VerifyOrReturn(CheckValueAsString("octetString", octetString, "TestValue")); + NextTest(); } - static void OnFailureCallback_2(void * context, uint8_t status) + CHIP_ERROR TestWriteAttributeOctetString_91() { - (static_cast(context))->OnFailureResponse_2(status); - } + chip::Controller::TestClusterClusterTest cluster; + cluster.Associate(mDevice, 1); - static void OnSuccessCallback_2(void * context) { (static_cast(context))->OnSuccessResponse_2(); } + chip::ByteSpan octetStringArgument = + chip::ByteSpan(chip::Uint8::from_const_char("TestValueLongerThan10"), strlen("TestValueLongerThan10")); - static void OnFailureCallback_3(void * context, uint8_t status) - { - (static_cast(context))->OnFailureResponse_3(status); + return cluster.WriteAttributeOctetString(mOnSuccessCallback_91.Cancel(), mOnFailureCallback_91.Cancel(), + octetStringArgument); } - static void OnSuccessCallback_3(void * context) { (static_cast(context))->OnSuccessResponse_3(); } + void OnFailureResponse_91(uint8_t status) { NextTest(); } - static void OnFailureCallback_4(void * context, uint8_t status) + void OnSuccessResponse_91(chip::ByteSpan octetString) { ThrowSuccessResponse(); } + + CHIP_ERROR TestReadAttributeOctetString_92() { - (static_cast(context))->OnFailureResponse_4(status); + chip::Controller::TestClusterClusterTest cluster; + cluster.Associate(mDevice, 1); + + return cluster.ReadAttributeOctetString(mOnSuccessCallback_92.Cancel(), mOnFailureCallback_92.Cancel()); } - static void OnSuccessCallback_4(void * context) { (static_cast(context))->OnSuccessResponse_4(); } + void OnFailureResponse_92(uint8_t status) { ThrowFailureResponse(); } - static void OnFailureCallback_5(void * context, uint8_t status) + void OnSuccessResponse_92(chip::ByteSpan octetString) { - (static_cast(context))->OnFailureResponse_5(status); + VerifyOrReturn(CheckValueAsString("octetString", octetString, "TestValue")); + NextTest(); } - static void OnSuccessCallback_5(void * context) { (static_cast(context))->OnSuccessResponse_5(); } - - static void OnFailureCallback_6(void * context, uint8_t status) + CHIP_ERROR TestWriteAttributeOctetString_93() { - (static_cast(context))->OnFailureResponse_6(status); + chip::Controller::TestClusterClusterTest cluster; + cluster.Associate(mDevice, 1); + + chip::ByteSpan octetStringArgument = chip::ByteSpan(chip::Uint8::from_const_char(""), strlen("")); + + return cluster.WriteAttributeOctetString(mOnSuccessCallback_93.Cancel(), mOnFailureCallback_93.Cancel(), + octetStringArgument); } - static void OnSuccessCallback_6(void * context) { (static_cast(context))->OnSuccessResponse_6(); } + void OnFailureResponse_93(uint8_t status) { ThrowFailureResponse(); } - static void OnFailureCallback_7(void * context, uint8_t status) + void OnSuccessResponse_93(chip::ByteSpan octetString) { NextTest(); } + + CHIP_ERROR TestReadAttributeLongOctetStringDefaultValue_94() { - (static_cast(context))->OnFailureResponse_7(status); + chip::Controller::TestClusterClusterTest cluster; + cluster.Associate(mDevice, 1); + + return cluster.ReadAttributeLongOctetString(mOnSuccessCallback_94.Cancel(), mOnFailureCallback_94.Cancel()); } - static void OnSuccessCallback_7(void * context, bool onOff) + void OnFailureResponse_94(uint8_t status) { ThrowFailureResponse(); } + + void OnSuccessResponse_94(chip::ByteSpan longOctetString) { - (static_cast(context))->OnSuccessResponse_7(onOff); + VerifyOrReturn(CheckValueAsString("longOctetString", longOctetString, "")); + NextTest(); } - // - // Tests methods - // - - CHIP_ERROR TestTurnOnLightForColorControlTests_0() + CHIP_ERROR TestWriteAttributeLongOctetString_95() { - chip::Controller::OnOffClusterTest cluster; + chip::Controller::TestClusterClusterTest cluster; cluster.Associate(mDevice, 1); - return cluster.On(mOnSuccessCallback_0.Cancel(), mOnFailureCallback_0.Cancel()); + chip::ByteSpan longOctetStringArgument = chip::ByteSpan( + chip::Uint8::from_const_char( + "111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111" + "111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111" + "111111111111111111111111111111111111111111111111111111111111111111111111"), + strlen("111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111" + "111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111" + "111111111111111111111111111111111111111111111111111111111111111111111111111111")); + + return cluster.WriteAttributeLongOctetString(mOnSuccessCallback_95.Cancel(), mOnFailureCallback_95.Cancel(), + longOctetStringArgument); } - void OnFailureResponse_0(uint8_t status) { ThrowFailureResponse(); } + void OnFailureResponse_95(uint8_t status) { ThrowFailureResponse(); } - void OnSuccessResponse_0() { NextTest(); } + void OnSuccessResponse_95(chip::ByteSpan longOctetString) { NextTest(); } - CHIP_ERROR TestCheckOnOffAttributeValueIsTrueAfterOnCommand_1() + CHIP_ERROR TestReadAttributeLongOctetString_96() { - chip::Controller::OnOffClusterTest cluster; + chip::Controller::TestClusterClusterTest cluster; cluster.Associate(mDevice, 1); - return cluster.ReadAttributeOnOff(mOnSuccessCallback_1.Cancel(), mOnFailureCallback_1.Cancel()); + return cluster.ReadAttributeLongOctetString(mOnSuccessCallback_96.Cancel(), mOnFailureCallback_96.Cancel()); } - void OnFailureResponse_1(uint8_t status) { ThrowFailureResponse(); } + void OnFailureResponse_96(uint8_t status) { ThrowFailureResponse(); } - void OnSuccessResponse_1(bool onOff) + void OnSuccessResponse_96(chip::ByteSpan longOctetString) { - VerifyOrReturn(CheckValue("onOff", onOff, 1)); + VerifyOrReturn(CheckValueAsString( + "longOctetString", longOctetString, + "1111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111" + "1111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111" + "1111111111111111111111111111111111111111111111111111111111111111")); NextTest(); } - CHIP_ERROR TestEnhancedMoveHueDownCommand_2() + CHIP_ERROR TestWriteAttributeLongOctetString_97() { - chip::Controller::ColorControlClusterTest cluster; + chip::Controller::TestClusterClusterTest cluster; cluster.Associate(mDevice, 1); - uint8_t moveModeArgument = 3; - uint16_t rateArgument = 5U; - uint8_t optionsMaskArgument = 0; - uint8_t optionsOverrideArgument = 0; + chip::ByteSpan longOctetStringArgument = chip::ByteSpan(chip::Uint8::from_const_char(""), strlen("")); - return cluster.EnhancedMoveHue(mOnSuccessCallback_2.Cancel(), mOnFailureCallback_2.Cancel(), moveModeArgument, rateArgument, - optionsMaskArgument, optionsOverrideArgument); + return cluster.WriteAttributeLongOctetString(mOnSuccessCallback_97.Cancel(), mOnFailureCallback_97.Cancel(), + longOctetStringArgument); } - void OnFailureResponse_2(uint8_t status) { ThrowFailureResponse(); } + void OnFailureResponse_97(uint8_t status) { ThrowFailureResponse(); } - void OnSuccessResponse_2() { NextTest(); } + void OnSuccessResponse_97(chip::ByteSpan longOctetString) { NextTest(); } - CHIP_ERROR TestEnhancedMoveHueStopCommand_3() + CHIP_ERROR TestReadAttributeCharStringDefaultValue_98() { - chip::Controller::ColorControlClusterTest cluster; + chip::Controller::TestClusterClusterTest cluster; cluster.Associate(mDevice, 1); - uint8_t moveModeArgument = 0; - uint16_t rateArgument = 0U; - uint8_t optionsMaskArgument = 0; - uint8_t optionsOverrideArgument = 0; - - return cluster.EnhancedMoveHue(mOnSuccessCallback_3.Cancel(), mOnFailureCallback_3.Cancel(), moveModeArgument, rateArgument, - optionsMaskArgument, optionsOverrideArgument); + return cluster.ReadAttributeCharString(mOnSuccessCallback_98.Cancel(), mOnFailureCallback_98.Cancel()); } - void OnFailureResponse_3(uint8_t status) { ThrowFailureResponse(); } + void OnFailureResponse_98(uint8_t status) { ThrowFailureResponse(); } - void OnSuccessResponse_3() { NextTest(); } + void OnSuccessResponse_98(chip::ByteSpan charString) + { + VerifyOrReturn(CheckValueAsString("charString", charString, "")); + NextTest(); + } - CHIP_ERROR TestEnhancedMoveHueUpCommand_4() + CHIP_ERROR TestWriteAttributeCharString_99() { - chip::Controller::ColorControlClusterTest cluster; + chip::Controller::TestClusterClusterTest cluster; cluster.Associate(mDevice, 1); - uint8_t moveModeArgument = 1; - uint16_t rateArgument = 50U; - uint8_t optionsMaskArgument = 0; - uint8_t optionsOverrideArgument = 0; + chip::ByteSpan charStringArgument = chip::ByteSpan(chip::Uint8::from_const_char("☉T☉"), strlen("☉T☉")); - return cluster.EnhancedMoveHue(mOnSuccessCallback_4.Cancel(), mOnFailureCallback_4.Cancel(), moveModeArgument, rateArgument, - optionsMaskArgument, optionsOverrideArgument); + return cluster.WriteAttributeCharString(mOnSuccessCallback_99.Cancel(), mOnFailureCallback_99.Cancel(), charStringArgument); } - void OnFailureResponse_4(uint8_t status) { ThrowFailureResponse(); } + void OnFailureResponse_99(uint8_t status) { ThrowFailureResponse(); } - void OnSuccessResponse_4() { NextTest(); } + void OnSuccessResponse_99(chip::ByteSpan charString) { NextTest(); } - CHIP_ERROR TestEnhancedMoveHueStopCommand_5() + CHIP_ERROR TestWriteAttributeCharStringValueTooLong_100() { - chip::Controller::ColorControlClusterTest cluster; + chip::Controller::TestClusterClusterTest cluster; cluster.Associate(mDevice, 1); - uint8_t moveModeArgument = 0; - uint16_t rateArgument = 0U; - uint8_t optionsMaskArgument = 0; - uint8_t optionsOverrideArgument = 0; + chip::ByteSpan charStringArgument = + chip::ByteSpan(chip::Uint8::from_const_char("☉TestValueLongerThan10☉"), strlen("☉TestValueLongerThan10☉")); - return cluster.EnhancedMoveHue(mOnSuccessCallback_5.Cancel(), mOnFailureCallback_5.Cancel(), moveModeArgument, rateArgument, - optionsMaskArgument, optionsOverrideArgument); + return cluster.WriteAttributeCharString(mOnSuccessCallback_100.Cancel(), mOnFailureCallback_100.Cancel(), + charStringArgument); } - void OnFailureResponse_5(uint8_t status) { ThrowFailureResponse(); } + void OnFailureResponse_100(uint8_t status) { NextTest(); } - void OnSuccessResponse_5() { NextTest(); } + void OnSuccessResponse_100(chip::ByteSpan charString) { ThrowSuccessResponse(); } - CHIP_ERROR TestTurnOffLightThatWeTurnedOn_6() + CHIP_ERROR TestWriteAttributeCharStringEmpty_101() { - chip::Controller::OnOffClusterTest cluster; + chip::Controller::TestClusterClusterTest cluster; cluster.Associate(mDevice, 1); - return cluster.Off(mOnSuccessCallback_6.Cancel(), mOnFailureCallback_6.Cancel()); + chip::ByteSpan charStringArgument = chip::ByteSpan(chip::Uint8::from_const_char(""), strlen("")); + + return cluster.WriteAttributeCharString(mOnSuccessCallback_101.Cancel(), mOnFailureCallback_101.Cancel(), + charStringArgument); } - void OnFailureResponse_6(uint8_t status) { ThrowFailureResponse(); } + void OnFailureResponse_101(uint8_t status) { ThrowFailureResponse(); } - void OnSuccessResponse_6() { NextTest(); } + void OnSuccessResponse_101(chip::ByteSpan charString) { NextTest(); } - CHIP_ERROR TestCheckOnOffAttributeValueIsFalseAfterOffCommand_7() + CHIP_ERROR TestReadAttributeLongCharStringDefaultValue_102() { - chip::Controller::OnOffClusterTest cluster; + chip::Controller::TestClusterClusterTest cluster; cluster.Associate(mDevice, 1); - return cluster.ReadAttributeOnOff(mOnSuccessCallback_7.Cancel(), mOnFailureCallback_7.Cancel()); + return cluster.ReadAttributeLongCharString(mOnSuccessCallback_102.Cancel(), mOnFailureCallback_102.Cancel()); } - void OnFailureResponse_7(uint8_t status) { ThrowFailureResponse(); } + void OnFailureResponse_102(uint8_t status) { ThrowFailureResponse(); } - void OnSuccessResponse_7(bool onOff) + void OnSuccessResponse_102(chip::ByteSpan longCharString) { - VerifyOrReturn(CheckValue("onOff", onOff, 0)); + VerifyOrReturn(CheckValueAsString("longCharString", longCharString, "")); NextTest(); } -}; - -class Test_TC_CC_7_3 : public TestCommand -{ -public: - Test_TC_CC_7_3() : TestCommand("Test_TC_CC_7_3"), mTestIndex(0) {} - /////////// TestCommand Interface ///////// - void NextTest() override + CHIP_ERROR TestWriteAttributeLongCharString_103() { - CHIP_ERROR err = CHIP_NO_ERROR; - - if (0 == mTestIndex) - { - ChipLogProgress(chipTool, " **** Test Start: Test_TC_CC_7_3\n"); - } - - if (mTestCount == mTestIndex) - { - ChipLogProgress(chipTool, " **** Test Complete: Test_TC_CC_7_3\n"); - SetCommandExitStatus(CHIP_NO_ERROR); - return; - } - - // Ensure we increment mTestIndex before we start running the relevant - // command. That way if we lose the timeslice after we send the message - // but before our function call returns, we won't end up with an - // incorrect mTestIndex value observed when we get the response. - switch (mTestIndex++) - { - case 0: - ChipLogProgress(chipTool, " ***** Test Step 0 : Turn on light for color control tests\n"); - err = TestTurnOnLightForColorControlTests_0(); - break; - case 1: - ChipLogProgress(chipTool, " ***** Test Step 1 : Check on/off attribute value is true after on command\n"); - err = TestCheckOnOffAttributeValueIsTrueAfterOnCommand_1(); - break; - case 2: - ChipLogProgress(chipTool, " ***** Test Step 2 : Enhanced Step Hue Up command\n"); - err = TestEnhancedStepHueUpCommand_2(); - break; - case 3: - ChipLogProgress(chipTool, " ***** Test Step 3 : Enhanced Step Hue Down command\n"); - err = TestEnhancedStepHueDownCommand_3(); - break; - case 4: - ChipLogProgress(chipTool, " ***** Test Step 4 : Turn off light that we turned on\n"); - err = TestTurnOffLightThatWeTurnedOn_4(); - break; - case 5: - ChipLogProgress(chipTool, " ***** Test Step 5 : Check on/off attribute value is false after off command\n"); - err = TestCheckOnOffAttributeValueIsFalseAfterOffCommand_5(); - break; - } - - if (CHIP_NO_ERROR != err) - { - ChipLogError(chipTool, " ***** Test Failure: %s\n", chip::ErrorStr(err)); - SetCommandExitStatus(err); - } - } - -private: - std::atomic_uint16_t mTestIndex; - const uint16_t mTestCount = 6; + chip::Controller::TestClusterClusterTest cluster; + cluster.Associate(mDevice, 1); - chip::Callback::Callback mOnFailureCallback_0{ OnFailureCallback_0, this }; - chip::Callback::Callback mOnSuccessCallback_0{ OnSuccessCallback_0, this }; - chip::Callback::Callback mOnFailureCallback_1{ OnFailureCallback_1, this }; - chip::Callback::Callback mOnSuccessCallback_1{ OnSuccessCallback_1, this }; - chip::Callback::Callback mOnFailureCallback_2{ OnFailureCallback_2, this }; - chip::Callback::Callback mOnSuccessCallback_2{ OnSuccessCallback_2, this }; - chip::Callback::Callback mOnFailureCallback_3{ OnFailureCallback_3, this }; - chip::Callback::Callback mOnSuccessCallback_3{ OnSuccessCallback_3, this }; - chip::Callback::Callback mOnFailureCallback_4{ OnFailureCallback_4, this }; - chip::Callback::Callback mOnSuccessCallback_4{ OnSuccessCallback_4, this }; - chip::Callback::Callback mOnFailureCallback_5{ OnFailureCallback_5, this }; - chip::Callback::Callback mOnSuccessCallback_5{ OnSuccessCallback_5, this }; + chip::ByteSpan longCharStringArgument = chip::ByteSpan( + chip::Uint8::from_const_char( + "☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉" + "☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉" + "☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉"), + strlen("☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉" + "☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉" + "☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉")); - static void OnFailureCallback_0(void * context, uint8_t status) - { - (static_cast(context))->OnFailureResponse_0(status); + return cluster.WriteAttributeLongCharString(mOnSuccessCallback_103.Cancel(), mOnFailureCallback_103.Cancel(), + longCharStringArgument); } - static void OnSuccessCallback_0(void * context) { (static_cast(context))->OnSuccessResponse_0(); } + void OnFailureResponse_103(uint8_t status) { ThrowFailureResponse(); } - static void OnFailureCallback_1(void * context, uint8_t status) - { - (static_cast(context))->OnFailureResponse_1(status); - } + void OnSuccessResponse_103(chip::ByteSpan longCharString) { NextTest(); } - static void OnSuccessCallback_1(void * context, bool onOff) + CHIP_ERROR TestReadAttributeLongCharString_104() { - (static_cast(context))->OnSuccessResponse_1(onOff); - } + chip::Controller::TestClusterClusterTest cluster; + cluster.Associate(mDevice, 1); - static void OnFailureCallback_2(void * context, uint8_t status) - { - (static_cast(context))->OnFailureResponse_2(status); + return cluster.ReadAttributeLongCharString(mOnSuccessCallback_104.Cancel(), mOnFailureCallback_104.Cancel()); } - static void OnSuccessCallback_2(void * context) { (static_cast(context))->OnSuccessResponse_2(); } + void OnFailureResponse_104(uint8_t status) { ThrowFailureResponse(); } - static void OnFailureCallback_3(void * context, uint8_t status) + void OnSuccessResponse_104(chip::ByteSpan longCharString) { - (static_cast(context))->OnFailureResponse_3(status); + VerifyOrReturn(CheckValueAsString( + "longCharString", longCharString, + "☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉" + "☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉" + "☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉")); + NextTest(); } - static void OnSuccessCallback_3(void * context) { (static_cast(context))->OnSuccessResponse_3(); } - - static void OnFailureCallback_4(void * context, uint8_t status) + CHIP_ERROR TestWriteAttributeLongCharString_105() { - (static_cast(context))->OnFailureResponse_4(status); - } + chip::Controller::TestClusterClusterTest cluster; + cluster.Associate(mDevice, 1); - static void OnSuccessCallback_4(void * context) { (static_cast(context))->OnSuccessResponse_4(); } + chip::ByteSpan longCharStringArgument = chip::ByteSpan(chip::Uint8::from_const_char(""), strlen("")); - static void OnFailureCallback_5(void * context, uint8_t status) - { - (static_cast(context))->OnFailureResponse_5(status); + return cluster.WriteAttributeLongCharString(mOnSuccessCallback_105.Cancel(), mOnFailureCallback_105.Cancel(), + longCharStringArgument); } - static void OnSuccessCallback_5(void * context, bool onOff) - { - (static_cast(context))->OnSuccessResponse_5(onOff); - } + void OnFailureResponse_105(uint8_t status) { ThrowFailureResponse(); } - // - // Tests methods - // + void OnSuccessResponse_105(chip::ByteSpan longCharString) { NextTest(); } - CHIP_ERROR TestTurnOnLightForColorControlTests_0() + CHIP_ERROR TestReadAttributeList_106() { - chip::Controller::OnOffClusterTest cluster; + chip::Controller::TestClusterClusterTest cluster; cluster.Associate(mDevice, 1); - return cluster.On(mOnSuccessCallback_0.Cancel(), mOnFailureCallback_0.Cancel()); + return cluster.ReadAttributeListInt8u(mOnSuccessCallback_106.Cancel(), mOnFailureCallback_106.Cancel()); } - void OnFailureResponse_0(uint8_t status) { ThrowFailureResponse(); } + void OnFailureResponse_106(uint8_t status) { ThrowFailureResponse(); } - void OnSuccessResponse_0() { NextTest(); } + void OnSuccessResponse_106(uint16_t count, uint8_t * listInt8u) + { + VerifyOrReturn(CheckValueAsList("listInt8u", count, 4)); + NextTest(); + } - CHIP_ERROR TestCheckOnOffAttributeValueIsTrueAfterOnCommand_1() + CHIP_ERROR TestReadAttributeListOctetString_107() { - chip::Controller::OnOffClusterTest cluster; + chip::Controller::TestClusterClusterTest cluster; cluster.Associate(mDevice, 1); - return cluster.ReadAttributeOnOff(mOnSuccessCallback_1.Cancel(), mOnFailureCallback_1.Cancel()); + return cluster.ReadAttributeListOctetString(mOnSuccessCallback_107.Cancel(), mOnFailureCallback_107.Cancel()); } - void OnFailureResponse_1(uint8_t status) { ThrowFailureResponse(); } + void OnFailureResponse_107(uint8_t status) { ThrowFailureResponse(); } - void OnSuccessResponse_1(bool onOff) + void OnSuccessResponse_107(uint16_t count, chip::ByteSpan * listOctetString) { - VerifyOrReturn(CheckValue("onOff", onOff, 1)); + VerifyOrReturn(CheckValueAsList("listOctetString", count, 4)); NextTest(); } - CHIP_ERROR TestEnhancedStepHueUpCommand_2() + CHIP_ERROR TestReadAttributeListStructOctetString_108() { - chip::Controller::ColorControlClusterTest cluster; + chip::Controller::TestClusterClusterTest cluster; cluster.Associate(mDevice, 1); - uint8_t stepModeArgument = 0; - uint16_t stepSizeArgument = 50U; - uint16_t transitionTimeArgument = 1U; - uint8_t optionsMaskArgument = 0; - uint8_t optionsOverrideArgument = 0; - - return cluster.EnhancedStepHue(mOnSuccessCallback_2.Cancel(), mOnFailureCallback_2.Cancel(), stepModeArgument, - stepSizeArgument, transitionTimeArgument, optionsMaskArgument, optionsOverrideArgument); + return cluster.ReadAttributeListStructOctetString(mOnSuccessCallback_108.Cancel(), mOnFailureCallback_108.Cancel()); } - void OnFailureResponse_2(uint8_t status) { ThrowFailureResponse(); } + void OnFailureResponse_108(uint8_t status) { ThrowFailureResponse(); } - void OnSuccessResponse_2() { NextTest(); } + void OnSuccessResponse_108(uint16_t count, _TestListStructOctet * listStructOctetString) + { + VerifyOrReturn(CheckValueAsList("listStructOctetString", count, 4)); + NextTest(); + } - CHIP_ERROR TestEnhancedStepHueDownCommand_3() + CHIP_ERROR TestReadAttributeEpochUsDefaultValue_109() { - chip::Controller::ColorControlClusterTest cluster; + chip::Controller::TestClusterClusterTest cluster; cluster.Associate(mDevice, 1); - uint8_t stepModeArgument = 1; - uint16_t stepSizeArgument = 75U; - uint16_t transitionTimeArgument = 1U; - uint8_t optionsMaskArgument = 0; - uint8_t optionsOverrideArgument = 0; - - return cluster.EnhancedStepHue(mOnSuccessCallback_3.Cancel(), mOnFailureCallback_3.Cancel(), stepModeArgument, - stepSizeArgument, transitionTimeArgument, optionsMaskArgument, optionsOverrideArgument); + return cluster.ReadAttributeEpochUs(mOnSuccessCallback_109.Cancel(), mOnFailureCallback_109.Cancel()); } - void OnFailureResponse_3(uint8_t status) { ThrowFailureResponse(); } + void OnFailureResponse_109(uint8_t status) { ThrowFailureResponse(); } - void OnSuccessResponse_3() { NextTest(); } + void OnSuccessResponse_109(uint64_t epochUs) + { + VerifyOrReturn(CheckValue("epochUs", epochUs, 0ULL)); + NextTest(); + } - CHIP_ERROR TestTurnOffLightThatWeTurnedOn_4() + CHIP_ERROR TestWriteAttributeEpochUsMaxValue_110() { - chip::Controller::OnOffClusterTest cluster; + chip::Controller::TestClusterClusterTest cluster; cluster.Associate(mDevice, 1); - return cluster.Off(mOnSuccessCallback_4.Cancel(), mOnFailureCallback_4.Cancel()); + uint64_t epochUsArgument = 18446744073709551615ULL; + + return cluster.WriteAttributeEpochUs(mOnSuccessCallback_110.Cancel(), mOnFailureCallback_110.Cancel(), epochUsArgument); } - void OnFailureResponse_4(uint8_t status) { ThrowFailureResponse(); } + void OnFailureResponse_110(uint8_t status) { ThrowFailureResponse(); } - void OnSuccessResponse_4() { NextTest(); } + void OnSuccessResponse_110(uint64_t epochUs) { NextTest(); } - CHIP_ERROR TestCheckOnOffAttributeValueIsFalseAfterOffCommand_5() + CHIP_ERROR TestReadAttributeEpochUsMaxValue_111() { - chip::Controller::OnOffClusterTest cluster; + chip::Controller::TestClusterClusterTest cluster; cluster.Associate(mDevice, 1); - return cluster.ReadAttributeOnOff(mOnSuccessCallback_5.Cancel(), mOnFailureCallback_5.Cancel()); + return cluster.ReadAttributeEpochUs(mOnSuccessCallback_111.Cancel(), mOnFailureCallback_111.Cancel()); } - void OnFailureResponse_5(uint8_t status) { ThrowFailureResponse(); } + void OnFailureResponse_111(uint8_t status) { ThrowFailureResponse(); } - void OnSuccessResponse_5(bool onOff) + void OnSuccessResponse_111(uint64_t epochUs) { - VerifyOrReturn(CheckValue("onOff", onOff, 0)); + VerifyOrReturn(CheckValue("epochUs", epochUs, 18446744073709551615ULL)); NextTest(); } -}; - -class Test_TC_CC_7_4 : public TestCommand -{ -public: - Test_TC_CC_7_4() : TestCommand("Test_TC_CC_7_4"), mTestIndex(0) {} - /////////// TestCommand Interface ///////// - void NextTest() override + CHIP_ERROR TestWriteAttributeEpochUsMinValue_112() { - CHIP_ERROR err = CHIP_NO_ERROR; - - if (0 == mTestIndex) - { - ChipLogProgress(chipTool, " **** Test Start: Test_TC_CC_7_4\n"); - } - - if (mTestCount == mTestIndex) - { - ChipLogProgress(chipTool, " **** Test Complete: Test_TC_CC_7_4\n"); - SetCommandExitStatus(CHIP_NO_ERROR); - return; - } + chip::Controller::TestClusterClusterTest cluster; + cluster.Associate(mDevice, 1); - // Ensure we increment mTestIndex before we start running the relevant - // command. That way if we lose the timeslice after we send the message - // but before our function call returns, we won't end up with an - // incorrect mTestIndex value observed when we get the response. - switch (mTestIndex++) - { - case 0: - ChipLogProgress(chipTool, " ***** Test Step 0 : Turn on light for color control tests\n"); - err = TestTurnOnLightForColorControlTests_0(); - break; - case 1: - ChipLogProgress(chipTool, " ***** Test Step 1 : Check on/off attribute value is true after on command\n"); - err = TestCheckOnOffAttributeValueIsTrueAfterOnCommand_1(); - break; - case 2: - ChipLogProgress(chipTool, " ***** Test Step 2 : Enhanced move to hue and saturation command\n"); - err = TestEnhancedMoveToHueAndSaturationCommand_2(); - break; - case 3: - ChipLogProgress(chipTool, " ***** Test Step 3 : Turn off light that we turned on\n"); - err = TestTurnOffLightThatWeTurnedOn_3(); - break; - case 4: - ChipLogProgress(chipTool, " ***** Test Step 4 : Check on/off attribute value is false after off command\n"); - err = TestCheckOnOffAttributeValueIsFalseAfterOffCommand_4(); - break; - } + uint64_t epochUsArgument = 0ULL; - if (CHIP_NO_ERROR != err) - { - ChipLogError(chipTool, " ***** Test Failure: %s\n", chip::ErrorStr(err)); - SetCommandExitStatus(err); - } + return cluster.WriteAttributeEpochUs(mOnSuccessCallback_112.Cancel(), mOnFailureCallback_112.Cancel(), epochUsArgument); } -private: - std::atomic_uint16_t mTestIndex; - const uint16_t mTestCount = 5; + void OnFailureResponse_112(uint8_t status) { ThrowFailureResponse(); } - chip::Callback::Callback mOnFailureCallback_0{ OnFailureCallback_0, this }; - chip::Callback::Callback mOnSuccessCallback_0{ OnSuccessCallback_0, this }; - chip::Callback::Callback mOnFailureCallback_1{ OnFailureCallback_1, this }; - chip::Callback::Callback mOnSuccessCallback_1{ OnSuccessCallback_1, this }; - chip::Callback::Callback mOnFailureCallback_2{ OnFailureCallback_2, this }; - chip::Callback::Callback mOnSuccessCallback_2{ OnSuccessCallback_2, this }; - chip::Callback::Callback mOnFailureCallback_3{ OnFailureCallback_3, this }; - chip::Callback::Callback mOnSuccessCallback_3{ OnSuccessCallback_3, this }; - chip::Callback::Callback mOnFailureCallback_4{ OnFailureCallback_4, this }; - chip::Callback::Callback mOnSuccessCallback_4{ OnSuccessCallback_4, this }; + void OnSuccessResponse_112(uint64_t epochUs) { NextTest(); } - static void OnFailureCallback_0(void * context, uint8_t status) + CHIP_ERROR TestReadAttributeEpochUsMinValue_113() { - (static_cast(context))->OnFailureResponse_0(status); + chip::Controller::TestClusterClusterTest cluster; + cluster.Associate(mDevice, 1); + + return cluster.ReadAttributeEpochUs(mOnSuccessCallback_113.Cancel(), mOnFailureCallback_113.Cancel()); } - static void OnSuccessCallback_0(void * context) { (static_cast(context))->OnSuccessResponse_0(); } + void OnFailureResponse_113(uint8_t status) { ThrowFailureResponse(); } - static void OnFailureCallback_1(void * context, uint8_t status) + void OnSuccessResponse_113(uint64_t epochUs) { - (static_cast(context))->OnFailureResponse_1(status); + VerifyOrReturn(CheckValue("epochUs", epochUs, 0ULL)); + NextTest(); } - static void OnSuccessCallback_1(void * context, bool onOff) + CHIP_ERROR TestReadAttributeEpochSDefaultValue_114() { - (static_cast(context))->OnSuccessResponse_1(onOff); + chip::Controller::TestClusterClusterTest cluster; + cluster.Associate(mDevice, 1); + + return cluster.ReadAttributeEpochS(mOnSuccessCallback_114.Cancel(), mOnFailureCallback_114.Cancel()); } - static void OnFailureCallback_2(void * context, uint8_t status) + void OnFailureResponse_114(uint8_t status) { ThrowFailureResponse(); } + + void OnSuccessResponse_114(uint32_t epochS) { - (static_cast(context))->OnFailureResponse_2(status); + VerifyOrReturn(CheckValue("epochS", epochS, 0UL)); + NextTest(); } - static void OnSuccessCallback_2(void * context) { (static_cast(context))->OnSuccessResponse_2(); } - - static void OnFailureCallback_3(void * context, uint8_t status) + CHIP_ERROR TestWriteAttributeEpochSMaxValue_115() { - (static_cast(context))->OnFailureResponse_3(status); + chip::Controller::TestClusterClusterTest cluster; + cluster.Associate(mDevice, 1); + + uint32_t epochSArgument = 4294967295UL; + + return cluster.WriteAttributeEpochS(mOnSuccessCallback_115.Cancel(), mOnFailureCallback_115.Cancel(), epochSArgument); } - static void OnSuccessCallback_3(void * context) { (static_cast(context))->OnSuccessResponse_3(); } + void OnFailureResponse_115(uint8_t status) { ThrowFailureResponse(); } - static void OnFailureCallback_4(void * context, uint8_t status) + void OnSuccessResponse_115(uint32_t epochS) { NextTest(); } + + CHIP_ERROR TestReadAttributeEpochSMaxValue_116() { - (static_cast(context))->OnFailureResponse_4(status); + chip::Controller::TestClusterClusterTest cluster; + cluster.Associate(mDevice, 1); + + return cluster.ReadAttributeEpochS(mOnSuccessCallback_116.Cancel(), mOnFailureCallback_116.Cancel()); } - static void OnSuccessCallback_4(void * context, bool onOff) + void OnFailureResponse_116(uint8_t status) { ThrowFailureResponse(); } + + void OnSuccessResponse_116(uint32_t epochS) { - (static_cast(context))->OnSuccessResponse_4(onOff); + VerifyOrReturn(CheckValue("epochS", epochS, 4294967295UL)); + NextTest(); } - // - // Tests methods - // - - CHIP_ERROR TestTurnOnLightForColorControlTests_0() + CHIP_ERROR TestWriteAttributeEpochSMinValue_117() { - chip::Controller::OnOffClusterTest cluster; + chip::Controller::TestClusterClusterTest cluster; cluster.Associate(mDevice, 1); - return cluster.On(mOnSuccessCallback_0.Cancel(), mOnFailureCallback_0.Cancel()); + uint32_t epochSArgument = 0UL; + + return cluster.WriteAttributeEpochS(mOnSuccessCallback_117.Cancel(), mOnFailureCallback_117.Cancel(), epochSArgument); } - void OnFailureResponse_0(uint8_t status) { ThrowFailureResponse(); } + void OnFailureResponse_117(uint8_t status) { ThrowFailureResponse(); } - void OnSuccessResponse_0() { NextTest(); } + void OnSuccessResponse_117(uint32_t epochS) { NextTest(); } - CHIP_ERROR TestCheckOnOffAttributeValueIsTrueAfterOnCommand_1() + CHIP_ERROR TestReadAttributeEpochSMinValue_118() { - chip::Controller::OnOffClusterTest cluster; + chip::Controller::TestClusterClusterTest cluster; cluster.Associate(mDevice, 1); - return cluster.ReadAttributeOnOff(mOnSuccessCallback_1.Cancel(), mOnFailureCallback_1.Cancel()); + return cluster.ReadAttributeEpochS(mOnSuccessCallback_118.Cancel(), mOnFailureCallback_118.Cancel()); } - void OnFailureResponse_1(uint8_t status) { ThrowFailureResponse(); } + void OnFailureResponse_118(uint8_t status) { ThrowFailureResponse(); } - void OnSuccessResponse_1(bool onOff) + void OnSuccessResponse_118(uint32_t epochS) { - VerifyOrReturn(CheckValue("onOff", onOff, 1)); + VerifyOrReturn(CheckValue("epochS", epochS, 0UL)); NextTest(); } - CHIP_ERROR TestEnhancedMoveToHueAndSaturationCommand_2() + CHIP_ERROR TestReadAttributeUnsupported_119() { - chip::Controller::ColorControlClusterTest cluster; + chip::Controller::TestClusterClusterTest cluster; cluster.Associate(mDevice, 1); - uint16_t enhancedHueArgument = 1200U; - uint8_t saturationArgument = 90; - uint16_t transitionTimeArgument = 10U; - uint8_t optionsMaskArgument = 0; - uint8_t optionsOverrideArgument = 0; - - return cluster.EnhancedMoveToHueAndSaturation(mOnSuccessCallback_2.Cancel(), mOnFailureCallback_2.Cancel(), - enhancedHueArgument, saturationArgument, transitionTimeArgument, - optionsMaskArgument, optionsOverrideArgument); + return cluster.ReadAttributeUnsupported(mOnSuccessCallback_119.Cancel(), mOnFailureCallback_119.Cancel()); } - void OnFailureResponse_2(uint8_t status) { ThrowFailureResponse(); } + void OnFailureResponse_119(uint8_t status) + { + (status == EMBER_ZCL_STATUS_UNSUPPORTED_ATTRIBUTE) ? NextTest() : ThrowFailureResponse(); + } - void OnSuccessResponse_2() { NextTest(); } + void OnSuccessResponse_119(bool unsupported) + { + VerifyOrReturn(CheckValue("unsupported", unsupported, 0)); + NextTest(); + } - CHIP_ERROR TestTurnOffLightThatWeTurnedOn_3() + CHIP_ERROR TestWriteattributeUnsupported_120() { - chip::Controller::OnOffClusterTest cluster; + chip::Controller::TestClusterClusterTest cluster; cluster.Associate(mDevice, 1); - return cluster.Off(mOnSuccessCallback_3.Cancel(), mOnFailureCallback_3.Cancel()); + bool unsupportedArgument = 0; + + return cluster.WriteAttributeUnsupported(mOnSuccessCallback_120.Cancel(), mOnFailureCallback_120.Cancel(), + unsupportedArgument); } - void OnFailureResponse_3(uint8_t status) { ThrowFailureResponse(); } + void OnFailureResponse_120(uint8_t status) + { + (status == EMBER_ZCL_STATUS_UNSUPPORTED_ATTRIBUTE) ? NextTest() : ThrowFailureResponse(); + } - void OnSuccessResponse_3() { NextTest(); } + void OnSuccessResponse_120(bool unsupported) { NextTest(); } - CHIP_ERROR TestCheckOnOffAttributeValueIsFalseAfterOffCommand_4() + CHIP_ERROR TestSendTestCommandToUnsupportedEndpoint_121() { - chip::Controller::OnOffClusterTest cluster; - cluster.Associate(mDevice, 1); + chip::Controller::TestClusterClusterTest cluster; + cluster.Associate(mDevice, 200); - return cluster.ReadAttributeOnOff(mOnSuccessCallback_4.Cancel(), mOnFailureCallback_4.Cancel()); + return cluster.Test(mOnSuccessCallback_121.Cancel(), mOnFailureCallback_121.Cancel()); } - void OnFailureResponse_4(uint8_t status) { ThrowFailureResponse(); } + void OnFailureResponse_121(uint8_t status) { NextTest(); } - void OnSuccessResponse_4(bool onOff) - { - VerifyOrReturn(CheckValue("onOff", onOff, 0)); - NextTest(); - } + void OnSuccessResponse_121() { ThrowSuccessResponse(); } }; -class Test_TC_CC_8_1 : public TestCommand +class TestConstraints : public TestCommand { public: - Test_TC_CC_8_1() : TestCommand("Test_TC_CC_8_1"), mTestIndex(0) {} + TestConstraints() : TestCommand("TestConstraints"), mTestIndex(0) {} /////////// TestCommand Interface ///////// void NextTest() override @@ -15141,12 +15181,12 @@ class Test_TC_CC_8_1 : public TestCommand if (0 == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Start: Test_TC_CC_8_1\n"); + ChipLogProgress(chipTool, " **** Test Start: TestConstraints\n"); } if (mTestCount == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Complete: Test_TC_CC_8_1\n"); + ChipLogProgress(chipTool, " **** Test Complete: TestConstraints\n"); SetCommandExitStatus(CHIP_NO_ERROR); return; } @@ -15158,535 +15198,495 @@ class Test_TC_CC_8_1 : public TestCommand switch (mTestIndex++) { case 0: - ChipLogProgress(chipTool, " ***** Test Step 0 : Turn on light for color control tests\n"); - err = TestTurnOnLightForColorControlTests_0(); + ChipLogProgress(chipTool, " ***** Test Step 0 : Write attribute INT32U Value\n"); + err = TestWriteAttributeInt32uValue_0(); break; case 1: - ChipLogProgress(chipTool, " ***** Test Step 1 : Check on/off attribute value is true after on command\n"); - err = TestCheckOnOffAttributeValueIsTrueAfterOnCommand_1(); + ChipLogProgress(chipTool, " ***** Test Step 1 : Read attribute INT32U Value MinValue Constraints\n"); + err = TestReadAttributeInt32uValueMinValueConstraints_1(); break; case 2: - ChipLogProgress(chipTool, " ***** Test Step 2 : Color Loop Set Command - Set all Attributs\n"); - err = TestColorLoopSetCommandSetAllAttributs_2(); + ChipLogProgress(chipTool, " ***** Test Step 2 : Read attribute INT32U Value MaxValue Constraints\n"); + err = TestReadAttributeInt32uValueMaxValueConstraints_2(); break; case 3: - ChipLogProgress(chipTool, " ***** Test Step 3 : Check ColorLoopDirection Value\n"); - err = TestCheckColorLoopDirectionValue_3(); - break; - case 4: - ChipLogProgress(chipTool, " ***** Test Step 4 : Check ColorLoopTime Value\n"); - err = TestCheckColorLoopTimeValue_4(); - break; - case 5: - ChipLogProgress(chipTool, " ***** Test Step 5 : Check ColorLoopStartEnhancedHue Value\n"); - err = TestCheckColorLoopStartEnhancedHueValue_5(); - break; - case 6: - ChipLogProgress(chipTool, " ***** Test Step 6 : Check ColorLoopActive Value\n"); - err = TestCheckColorLoopActiveValue_6(); - break; - case 7: - ChipLogProgress(chipTool, " ***** Test Step 7 : Color Loop Set Command - Start Color Loop\n"); - err = TestColorLoopSetCommandStartColorLoop_7(); - break; - case 8: - ChipLogProgress(chipTool, " ***** Test Step 8 : Check ColorLoopActive Value\n"); - err = TestCheckColorLoopActiveValue_8(); - break; - case 9: - ChipLogProgress(chipTool, " ***** Test Step 9 : Color Loop Set Command - Set direction and time while running\n"); - err = TestColorLoopSetCommandSetDirectionAndTimeWhileRunning_9(); - break; - case 10: - ChipLogProgress(chipTool, " ***** Test Step 10 : Check ColorLoopDirection Value\n"); - err = TestCheckColorLoopDirectionValue_10(); - break; - case 11: - ChipLogProgress(chipTool, " ***** Test Step 11 : Check ColorLoopTime Value\n"); - err = TestCheckColorLoopTimeValue_11(); - break; - case 12: - ChipLogProgress(chipTool, " ***** Test Step 12 : Color Loop Set Command - Set direction while running\n"); - err = TestColorLoopSetCommandSetDirectionWhileRunning_12(); - break; - case 13: - ChipLogProgress(chipTool, " ***** Test Step 13 : Check ColorLoopDirection Value\n"); - err = TestCheckColorLoopDirectionValue_13(); - break; - case 14: - ChipLogProgress(chipTool, " ***** Test Step 14 : Turn off light that we turned on\n"); - err = TestTurnOffLightThatWeTurnedOn_14(); - break; - case 15: - ChipLogProgress(chipTool, " ***** Test Step 15 : Check on/off attribute value is false after off command\n"); - err = TestCheckOnOffAttributeValueIsFalseAfterOffCommand_15(); + ChipLogProgress(chipTool, " ***** Test Step 3 : Read attribute INT32U Value NotValue Constraints\n"); + err = TestReadAttributeInt32uValueNotValueConstraints_3(); break; } if (CHIP_NO_ERROR != err) { ChipLogError(chipTool, " ***** Test Failure: %s\n", chip::ErrorStr(err)); - SetCommandExitStatus(err); - } - } - -private: - std::atomic_uint16_t mTestIndex; - const uint16_t mTestCount = 16; - - chip::Callback::Callback mOnFailureCallback_0{ OnFailureCallback_0, this }; - chip::Callback::Callback mOnSuccessCallback_0{ OnSuccessCallback_0, this }; - chip::Callback::Callback mOnFailureCallback_1{ OnFailureCallback_1, this }; - chip::Callback::Callback mOnSuccessCallback_1{ OnSuccessCallback_1, this }; - chip::Callback::Callback mOnFailureCallback_2{ OnFailureCallback_2, this }; - chip::Callback::Callback mOnSuccessCallback_2{ OnSuccessCallback_2, this }; - chip::Callback::Callback mOnFailureCallback_3{ OnFailureCallback_3, this }; - chip::Callback::Callback mOnSuccessCallback_3{ OnSuccessCallback_3, - this }; - chip::Callback::Callback mOnFailureCallback_4{ OnFailureCallback_4, this }; - chip::Callback::Callback mOnSuccessCallback_4{ OnSuccessCallback_4, this }; - chip::Callback::Callback mOnFailureCallback_5{ OnFailureCallback_5, this }; - chip::Callback::Callback mOnSuccessCallback_5{ - OnSuccessCallback_5, this - }; - chip::Callback::Callback mOnFailureCallback_6{ OnFailureCallback_6, this }; - chip::Callback::Callback mOnSuccessCallback_6{ OnSuccessCallback_6, this }; - chip::Callback::Callback mOnFailureCallback_7{ OnFailureCallback_7, this }; - chip::Callback::Callback mOnSuccessCallback_7{ OnSuccessCallback_7, this }; - chip::Callback::Callback mOnFailureCallback_8{ OnFailureCallback_8, this }; - chip::Callback::Callback mOnSuccessCallback_8{ OnSuccessCallback_8, this }; - chip::Callback::Callback mOnFailureCallback_9{ OnFailureCallback_9, this }; - chip::Callback::Callback mOnSuccessCallback_9{ OnSuccessCallback_9, this }; - chip::Callback::Callback mOnFailureCallback_10{ OnFailureCallback_10, this }; - chip::Callback::Callback mOnSuccessCallback_10{ OnSuccessCallback_10, - this }; - chip::Callback::Callback mOnFailureCallback_11{ OnFailureCallback_11, this }; - chip::Callback::Callback mOnSuccessCallback_11{ OnSuccessCallback_11, this }; - chip::Callback::Callback mOnFailureCallback_12{ OnFailureCallback_12, this }; - chip::Callback::Callback mOnSuccessCallback_12{ OnSuccessCallback_12, this }; - chip::Callback::Callback mOnFailureCallback_13{ OnFailureCallback_13, this }; - chip::Callback::Callback mOnSuccessCallback_13{ OnSuccessCallback_13, - this }; - chip::Callback::Callback mOnFailureCallback_14{ OnFailureCallback_14, this }; - chip::Callback::Callback mOnSuccessCallback_14{ OnSuccessCallback_14, this }; - chip::Callback::Callback mOnFailureCallback_15{ OnFailureCallback_15, this }; - chip::Callback::Callback mOnSuccessCallback_15{ OnSuccessCallback_15, this }; - - static void OnFailureCallback_0(void * context, uint8_t status) - { - (static_cast(context))->OnFailureResponse_0(status); - } - - static void OnSuccessCallback_0(void * context) { (static_cast(context))->OnSuccessResponse_0(); } - - static void OnFailureCallback_1(void * context, uint8_t status) - { - (static_cast(context))->OnFailureResponse_1(status); - } - - static void OnSuccessCallback_1(void * context, bool onOff) - { - (static_cast(context))->OnSuccessResponse_1(onOff); - } - - static void OnFailureCallback_2(void * context, uint8_t status) - { - (static_cast(context))->OnFailureResponse_2(status); - } - - static void OnSuccessCallback_2(void * context) { (static_cast(context))->OnSuccessResponse_2(); } - - static void OnFailureCallback_3(void * context, uint8_t status) - { - (static_cast(context))->OnFailureResponse_3(status); - } - - static void OnSuccessCallback_3(void * context, uint8_t colorLoopDirection) - { - (static_cast(context))->OnSuccessResponse_3(colorLoopDirection); - } - - static void OnFailureCallback_4(void * context, uint8_t status) - { - (static_cast(context))->OnFailureResponse_4(status); - } - - static void OnSuccessCallback_4(void * context, uint16_t colorLoopTime) - { - (static_cast(context))->OnSuccessResponse_4(colorLoopTime); - } - - static void OnFailureCallback_5(void * context, uint8_t status) - { - (static_cast(context))->OnFailureResponse_5(status); - } - - static void OnSuccessCallback_5(void * context, uint16_t colorLoopStartEnhancedHue) - { - (static_cast(context))->OnSuccessResponse_5(colorLoopStartEnhancedHue); - } - - static void OnFailureCallback_6(void * context, uint8_t status) - { - (static_cast(context))->OnFailureResponse_6(status); - } - - static void OnSuccessCallback_6(void * context, uint8_t colorLoopActive) - { - (static_cast(context))->OnSuccessResponse_6(colorLoopActive); + SetCommandExitStatus(err); + } } - static void OnFailureCallback_7(void * context, uint8_t status) - { - (static_cast(context))->OnFailureResponse_7(status); - } +private: + std::atomic_uint16_t mTestIndex; + const uint16_t mTestCount = 4; - static void OnSuccessCallback_7(void * context) { (static_cast(context))->OnSuccessResponse_7(); } + chip::Callback::Callback mOnFailureCallback_0{ OnFailureCallback_0, this }; + chip::Callback::Callback mOnSuccessCallback_0{ OnSuccessCallback_0, this }; + chip::Callback::Callback mOnFailureCallback_1{ OnFailureCallback_1, this }; + chip::Callback::Callback mOnSuccessCallback_1{ OnSuccessCallback_1, this }; + chip::Callback::Callback mOnFailureCallback_2{ OnFailureCallback_2, this }; + chip::Callback::Callback mOnSuccessCallback_2{ OnSuccessCallback_2, this }; + chip::Callback::Callback mOnFailureCallback_3{ OnFailureCallback_3, this }; + chip::Callback::Callback mOnSuccessCallback_3{ OnSuccessCallback_3, this }; - static void OnFailureCallback_8(void * context, uint8_t status) + static void OnFailureCallback_0(void * context, uint8_t status) { - (static_cast(context))->OnFailureResponse_8(status); + (static_cast(context))->OnFailureResponse_0(status); } - static void OnSuccessCallback_8(void * context, uint8_t colorLoopActive) + static void OnSuccessCallback_0(void * context, uint32_t int32u) { - (static_cast(context))->OnSuccessResponse_8(colorLoopActive); + (static_cast(context))->OnSuccessResponse_0(int32u); } - static void OnFailureCallback_9(void * context, uint8_t status) + static void OnFailureCallback_1(void * context, uint8_t status) { - (static_cast(context))->OnFailureResponse_9(status); + (static_cast(context))->OnFailureResponse_1(status); } - static void OnSuccessCallback_9(void * context) { (static_cast(context))->OnSuccessResponse_9(); } - - static void OnFailureCallback_10(void * context, uint8_t status) + static void OnSuccessCallback_1(void * context, uint32_t int32u) { - (static_cast(context))->OnFailureResponse_10(status); + (static_cast(context))->OnSuccessResponse_1(int32u); } - static void OnSuccessCallback_10(void * context, uint8_t colorLoopDirection) + static void OnFailureCallback_2(void * context, uint8_t status) { - (static_cast(context))->OnSuccessResponse_10(colorLoopDirection); + (static_cast(context))->OnFailureResponse_2(status); } - static void OnFailureCallback_11(void * context, uint8_t status) + static void OnSuccessCallback_2(void * context, uint32_t int32u) { - (static_cast(context))->OnFailureResponse_11(status); + (static_cast(context))->OnSuccessResponse_2(int32u); } - static void OnSuccessCallback_11(void * context, uint16_t colorLoopTime) + static void OnFailureCallback_3(void * context, uint8_t status) { - (static_cast(context))->OnSuccessResponse_11(colorLoopTime); + (static_cast(context))->OnFailureResponse_3(status); } - static void OnFailureCallback_12(void * context, uint8_t status) + static void OnSuccessCallback_3(void * context, uint32_t int32u) { - (static_cast(context))->OnFailureResponse_12(status); + (static_cast(context))->OnSuccessResponse_3(int32u); } - static void OnSuccessCallback_12(void * context) { (static_cast(context))->OnSuccessResponse_12(); } + // + // Tests methods + // - static void OnFailureCallback_13(void * context, uint8_t status) + CHIP_ERROR TestWriteAttributeInt32uValue_0() { - (static_cast(context))->OnFailureResponse_13(status); - } + chip::Controller::TestClusterClusterTest cluster; + cluster.Associate(mDevice, 1); - static void OnSuccessCallback_13(void * context, uint8_t colorLoopDirection) - { - (static_cast(context))->OnSuccessResponse_13(colorLoopDirection); - } + uint32_t int32uArgument = 5UL; - static void OnFailureCallback_14(void * context, uint8_t status) - { - (static_cast(context))->OnFailureResponse_14(status); + return cluster.WriteAttributeInt32u(mOnSuccessCallback_0.Cancel(), mOnFailureCallback_0.Cancel(), int32uArgument); } - static void OnSuccessCallback_14(void * context) { (static_cast(context))->OnSuccessResponse_14(); } + void OnFailureResponse_0(uint8_t status) { ThrowFailureResponse(); } - static void OnFailureCallback_15(void * context, uint8_t status) + void OnSuccessResponse_0(uint32_t int32u) { NextTest(); } + + CHIP_ERROR TestReadAttributeInt32uValueMinValueConstraints_1() { - (static_cast(context))->OnFailureResponse_15(status); + chip::Controller::TestClusterClusterTest cluster; + cluster.Associate(mDevice, 1); + + return cluster.ReadAttributeInt32u(mOnSuccessCallback_1.Cancel(), mOnFailureCallback_1.Cancel()); } - static void OnSuccessCallback_15(void * context, bool onOff) + void OnFailureResponse_1(uint8_t status) { ThrowFailureResponse(); } + + void OnSuccessResponse_1(uint32_t int32u) { - (static_cast(context))->OnSuccessResponse_15(onOff); + VerifyOrReturn(CheckConstraintMinValue("int32u", int32u, 5)); + NextTest(); } - // - // Tests methods - // - - CHIP_ERROR TestTurnOnLightForColorControlTests_0() + CHIP_ERROR TestReadAttributeInt32uValueMaxValueConstraints_2() { - chip::Controller::OnOffClusterTest cluster; + chip::Controller::TestClusterClusterTest cluster; cluster.Associate(mDevice, 1); - return cluster.On(mOnSuccessCallback_0.Cancel(), mOnFailureCallback_0.Cancel()); + return cluster.ReadAttributeInt32u(mOnSuccessCallback_2.Cancel(), mOnFailureCallback_2.Cancel()); } - void OnFailureResponse_0(uint8_t status) { ThrowFailureResponse(); } + void OnFailureResponse_2(uint8_t status) { ThrowFailureResponse(); } - void OnSuccessResponse_0() { NextTest(); } + void OnSuccessResponse_2(uint32_t int32u) + { + VerifyOrReturn(CheckConstraintMaxValue("int32u", int32u, 5)); + NextTest(); + } - CHIP_ERROR TestCheckOnOffAttributeValueIsTrueAfterOnCommand_1() + CHIP_ERROR TestReadAttributeInt32uValueNotValueConstraints_3() { - chip::Controller::OnOffClusterTest cluster; + chip::Controller::TestClusterClusterTest cluster; cluster.Associate(mDevice, 1); - return cluster.ReadAttributeOnOff(mOnSuccessCallback_1.Cancel(), mOnFailureCallback_1.Cancel()); + return cluster.ReadAttributeInt32u(mOnSuccessCallback_3.Cancel(), mOnFailureCallback_3.Cancel()); } - void OnFailureResponse_1(uint8_t status) { ThrowFailureResponse(); } + void OnFailureResponse_3(uint8_t status) { ThrowFailureResponse(); } - void OnSuccessResponse_1(bool onOff) + void OnSuccessResponse_3(uint32_t int32u) { - VerifyOrReturn(CheckValue("onOff", onOff, 1)); + VerifyOrReturn(CheckConstraintNotValue("int32u", int32u, 6)); NextTest(); } +}; - CHIP_ERROR TestColorLoopSetCommandSetAllAttributs_2() +class TestDelayCommands : public TestCommand +{ +public: + TestDelayCommands() : TestCommand("TestDelayCommands"), mTestIndex(0) {} + + /////////// TestCommand Interface ///////// + void NextTest() override { - chip::Controller::ColorControlClusterTest cluster; - cluster.Associate(mDevice, 1); + CHIP_ERROR err = CHIP_NO_ERROR; - uint8_t updateFlagsArgument = 14; - uint8_t actionArgument = 0; - uint8_t directionArgument = 1; - uint16_t timeArgument = 100U; - uint16_t startHueArgument = 500U; - uint8_t optionsMaskArgument = 0; - uint8_t optionsOverrideArgument = 0; + if (0 == mTestIndex) + { + ChipLogProgress(chipTool, " **** Test Start: TestDelayCommands\n"); + } - return cluster.ColorLoopSet(mOnSuccessCallback_2.Cancel(), mOnFailureCallback_2.Cancel(), updateFlagsArgument, - actionArgument, directionArgument, timeArgument, startHueArgument, optionsMaskArgument, - optionsOverrideArgument); + if (mTestCount == mTestIndex) + { + ChipLogProgress(chipTool, " **** Test Complete: TestDelayCommands\n"); + SetCommandExitStatus(CHIP_NO_ERROR); + return; + } + + // Ensure we increment mTestIndex before we start running the relevant + // command. That way if we lose the timeslice after we send the message + // but before our function call returns, we won't end up with an + // incorrect mTestIndex value observed when we get the response. + switch (mTestIndex++) + { + case 0: + ChipLogProgress(chipTool, " ***** Test Step 0 : Wait 100ms\n"); + err = TestWait100ms_0(); + break; + } + + if (CHIP_NO_ERROR != err) + { + ChipLogError(chipTool, " ***** Test Failure: %s\n", chip::ErrorStr(err)); + SetCommandExitStatus(err); + } } - void OnFailureResponse_2(uint8_t status) { ThrowFailureResponse(); } +private: + std::atomic_uint16_t mTestIndex; + const uint16_t mTestCount = 1; - void OnSuccessResponse_2() { NextTest(); } + // + // Tests methods + // - CHIP_ERROR TestCheckColorLoopDirectionValue_3() + CHIP_ERROR TestWait100ms_0() { return WaitForMs(100); } +}; + +class TestDescriptorCluster : public TestCommand +{ +public: + TestDescriptorCluster() : TestCommand("TestDescriptorCluster"), mTestIndex(0) {} + + /////////// TestCommand Interface ///////// + void NextTest() override { - chip::Controller::ColorControlClusterTest cluster; - cluster.Associate(mDevice, 1); + CHIP_ERROR err = CHIP_NO_ERROR; - return cluster.ReadAttributeColorLoopDirection(mOnSuccessCallback_3.Cancel(), mOnFailureCallback_3.Cancel()); + if (0 == mTestIndex) + { + ChipLogProgress(chipTool, " **** Test Start: TestDescriptorCluster\n"); + } + + if (mTestCount == mTestIndex) + { + ChipLogProgress(chipTool, " **** Test Complete: TestDescriptorCluster\n"); + SetCommandExitStatus(CHIP_NO_ERROR); + return; + } + + // Ensure we increment mTestIndex before we start running the relevant + // command. That way if we lose the timeslice after we send the message + // but before our function call returns, we won't end up with an + // incorrect mTestIndex value observed when we get the response. + switch (mTestIndex++) + { + case 0: + ChipLogProgress(chipTool, " ***** Test Step 0 : Read attribute Device list\n"); + err = TestReadAttributeDeviceList_0(); + break; + case 1: + ChipLogProgress(chipTool, " ***** Test Step 1 : Read attribute Server list\n"); + err = TestReadAttributeServerList_1(); + break; + case 2: + ChipLogProgress(chipTool, " ***** Test Step 2 : Read attribute Client list\n"); + err = TestReadAttributeClientList_2(); + break; + case 3: + ChipLogProgress(chipTool, " ***** Test Step 3 : Read attribute Parts list\n"); + err = TestReadAttributePartsList_3(); + break; + } + + if (CHIP_NO_ERROR != err) + { + ChipLogError(chipTool, " ***** Test Failure: %s\n", chip::ErrorStr(err)); + SetCommandExitStatus(err); + } } - void OnFailureResponse_3(uint8_t status) { ThrowFailureResponse(); } +private: + std::atomic_uint16_t mTestIndex; + const uint16_t mTestCount = 4; - void OnSuccessResponse_3(uint8_t colorLoopDirection) + chip::Callback::Callback mOnFailureCallback_0{ OnFailureCallback_0, this }; + chip::Callback::Callback mOnSuccessCallback_0{ + OnSuccessCallback_0, this + }; + chip::Callback::Callback mOnFailureCallback_1{ OnFailureCallback_1, this }; + chip::Callback::Callback mOnSuccessCallback_1{ + OnSuccessCallback_1, this + }; + chip::Callback::Callback mOnFailureCallback_2{ OnFailureCallback_2, this }; + chip::Callback::Callback mOnSuccessCallback_2{ + OnSuccessCallback_2, this + }; + chip::Callback::Callback mOnFailureCallback_3{ OnFailureCallback_3, this }; + chip::Callback::Callback mOnSuccessCallback_3{ + OnSuccessCallback_3, this + }; + + static void OnFailureCallback_0(void * context, uint8_t status) { - VerifyOrReturn(CheckValue("colorLoopDirection", colorLoopDirection, 1)); - NextTest(); + (static_cast(context))->OnFailureResponse_0(status); } - CHIP_ERROR TestCheckColorLoopTimeValue_4() + static void OnSuccessCallback_0(void * context, uint16_t count, _DeviceType * deviceList) { - chip::Controller::ColorControlClusterTest cluster; - cluster.Associate(mDevice, 1); - - return cluster.ReadAttributeColorLoopTime(mOnSuccessCallback_4.Cancel(), mOnFailureCallback_4.Cancel()); + (static_cast(context))->OnSuccessResponse_0(count, deviceList); } - void OnFailureResponse_4(uint8_t status) { ThrowFailureResponse(); } - - void OnSuccessResponse_4(uint16_t colorLoopTime) + static void OnFailureCallback_1(void * context, uint8_t status) { - VerifyOrReturn(CheckValue("colorLoopTime", colorLoopTime, 100U)); - NextTest(); + (static_cast(context))->OnFailureResponse_1(status); } - CHIP_ERROR TestCheckColorLoopStartEnhancedHueValue_5() + static void OnSuccessCallback_1(void * context, uint16_t count, chip::ClusterId * serverList) { - chip::Controller::ColorControlClusterTest cluster; - cluster.Associate(mDevice, 1); - - return cluster.ReadAttributeColorLoopStartEnhancedHue(mOnSuccessCallback_5.Cancel(), mOnFailureCallback_5.Cancel()); + (static_cast(context))->OnSuccessResponse_1(count, serverList); } - void OnFailureResponse_5(uint8_t status) { ThrowFailureResponse(); } - - void OnSuccessResponse_5(uint16_t colorLoopStartEnhancedHue) + static void OnFailureCallback_2(void * context, uint8_t status) { - VerifyOrReturn(CheckValue("colorLoopStartEnhancedHue", colorLoopStartEnhancedHue, 500U)); - NextTest(); + (static_cast(context))->OnFailureResponse_2(status); } - CHIP_ERROR TestCheckColorLoopActiveValue_6() + static void OnSuccessCallback_2(void * context, uint16_t count, chip::ClusterId * clientList) { - chip::Controller::ColorControlClusterTest cluster; - cluster.Associate(mDevice, 1); - - return cluster.ReadAttributeColorLoopActive(mOnSuccessCallback_6.Cancel(), mOnFailureCallback_6.Cancel()); + (static_cast(context))->OnSuccessResponse_2(count, clientList); } - void OnFailureResponse_6(uint8_t status) { ThrowFailureResponse(); } - - void OnSuccessResponse_6(uint8_t colorLoopActive) + static void OnFailureCallback_3(void * context, uint8_t status) { - VerifyOrReturn(CheckValue("colorLoopActive", colorLoopActive, 0)); - NextTest(); + (static_cast(context))->OnFailureResponse_3(status); } - CHIP_ERROR TestColorLoopSetCommandStartColorLoop_7() + static void OnSuccessCallback_3(void * context, uint16_t count, chip::EndpointId * partsList) { - chip::Controller::ColorControlClusterTest cluster; - cluster.Associate(mDevice, 1); - - uint8_t updateFlagsArgument = 1; - uint8_t actionArgument = 1; - uint8_t directionArgument = 0; - uint16_t timeArgument = 0U; - uint16_t startHueArgument = 0U; - uint8_t optionsMaskArgument = 0; - uint8_t optionsOverrideArgument = 0; - - return cluster.ColorLoopSet(mOnSuccessCallback_7.Cancel(), mOnFailureCallback_7.Cancel(), updateFlagsArgument, - actionArgument, directionArgument, timeArgument, startHueArgument, optionsMaskArgument, - optionsOverrideArgument); + (static_cast(context))->OnSuccessResponse_3(count, partsList); } - void OnFailureResponse_7(uint8_t status) { ThrowFailureResponse(); } - - void OnSuccessResponse_7() { NextTest(); } + // + // Tests methods + // - CHIP_ERROR TestCheckColorLoopActiveValue_8() + CHIP_ERROR TestReadAttributeDeviceList_0() { - chip::Controller::ColorControlClusterTest cluster; - cluster.Associate(mDevice, 1); + chip::Controller::DescriptorClusterTest cluster; + cluster.Associate(mDevice, 0); - return cluster.ReadAttributeColorLoopActive(mOnSuccessCallback_8.Cancel(), mOnFailureCallback_8.Cancel()); + return cluster.ReadAttributeDeviceList(mOnSuccessCallback_0.Cancel(), mOnFailureCallback_0.Cancel()); } - void OnFailureResponse_8(uint8_t status) { ThrowFailureResponse(); } + void OnFailureResponse_0(uint8_t status) { ThrowFailureResponse(); } - void OnSuccessResponse_8(uint8_t colorLoopActive) + void OnSuccessResponse_0(uint16_t count, _DeviceType * deviceList) { - VerifyOrReturn(CheckValue("colorLoopActive", colorLoopActive, 1)); + VerifyOrReturn(CheckValueAsList("deviceList", count, 1)); NextTest(); } - CHIP_ERROR TestColorLoopSetCommandSetDirectionAndTimeWhileRunning_9() + CHIP_ERROR TestReadAttributeServerList_1() { - chip::Controller::ColorControlClusterTest cluster; - cluster.Associate(mDevice, 1); - - uint8_t updateFlagsArgument = 6; - uint8_t actionArgument = 0; - uint8_t directionArgument = 0; - uint16_t timeArgument = 3500U; - uint16_t startHueArgument = 0U; - uint8_t optionsMaskArgument = 0; - uint8_t optionsOverrideArgument = 0; + chip::Controller::DescriptorClusterTest cluster; + cluster.Associate(mDevice, 0); - return cluster.ColorLoopSet(mOnSuccessCallback_9.Cancel(), mOnFailureCallback_9.Cancel(), updateFlagsArgument, - actionArgument, directionArgument, timeArgument, startHueArgument, optionsMaskArgument, - optionsOverrideArgument); + return cluster.ReadAttributeServerList(mOnSuccessCallback_1.Cancel(), mOnFailureCallback_1.Cancel()); } - void OnFailureResponse_9(uint8_t status) { ThrowFailureResponse(); } + void OnFailureResponse_1(uint8_t status) { ThrowFailureResponse(); } - void OnSuccessResponse_9() { NextTest(); } + void OnSuccessResponse_1(uint16_t count, chip::ClusterId * serverList) + { + VerifyOrReturn(CheckValueAsList("serverList", count, 18)); + NextTest(); + } - CHIP_ERROR TestCheckColorLoopDirectionValue_10() + CHIP_ERROR TestReadAttributeClientList_2() { - chip::Controller::ColorControlClusterTest cluster; - cluster.Associate(mDevice, 1); + chip::Controller::DescriptorClusterTest cluster; + cluster.Associate(mDevice, 0); - return cluster.ReadAttributeColorLoopDirection(mOnSuccessCallback_10.Cancel(), mOnFailureCallback_10.Cancel()); + return cluster.ReadAttributeClientList(mOnSuccessCallback_2.Cancel(), mOnFailureCallback_2.Cancel()); } - void OnFailureResponse_10(uint8_t status) { ThrowFailureResponse(); } + void OnFailureResponse_2(uint8_t status) { ThrowFailureResponse(); } - void OnSuccessResponse_10(uint8_t colorLoopDirection) + void OnSuccessResponse_2(uint16_t count, chip::ClusterId * clientList) { - VerifyOrReturn(CheckValue("colorLoopDirection", colorLoopDirection, 0)); + VerifyOrReturn(CheckValueAsList("clientList", count, 0)); NextTest(); } - CHIP_ERROR TestCheckColorLoopTimeValue_11() + CHIP_ERROR TestReadAttributePartsList_3() { - chip::Controller::ColorControlClusterTest cluster; - cluster.Associate(mDevice, 1); + chip::Controller::DescriptorClusterTest cluster; + cluster.Associate(mDevice, 0); - return cluster.ReadAttributeColorLoopTime(mOnSuccessCallback_11.Cancel(), mOnFailureCallback_11.Cancel()); + return cluster.ReadAttributePartsList(mOnSuccessCallback_3.Cancel(), mOnFailureCallback_3.Cancel()); } - void OnFailureResponse_11(uint8_t status) { ThrowFailureResponse(); } + void OnFailureResponse_3(uint8_t status) { ThrowFailureResponse(); } - void OnSuccessResponse_11(uint16_t colorLoopTime) + void OnSuccessResponse_3(uint16_t count, chip::EndpointId * partsList) { - VerifyOrReturn(CheckValue("colorLoopTime", colorLoopTime, 3500U)); + VerifyOrReturn(CheckValueAsList("partsList", count, 2)); NextTest(); } +}; - CHIP_ERROR TestColorLoopSetCommandSetDirectionWhileRunning_12() +class TestOperationalCredentialsCluster : public TestCommand +{ +public: + TestOperationalCredentialsCluster() : TestCommand("TestOperationalCredentialsCluster"), mTestIndex(0) {} + + /////////// TestCommand Interface ///////// + void NextTest() override { - chip::Controller::ColorControlClusterTest cluster; - cluster.Associate(mDevice, 1); + CHIP_ERROR err = CHIP_NO_ERROR; - uint8_t updateFlagsArgument = 2; - uint8_t actionArgument = 0; - uint8_t directionArgument = 1; - uint16_t timeArgument = 0U; - uint16_t startHueArgument = 0U; - uint8_t optionsMaskArgument = 0; - uint8_t optionsOverrideArgument = 0; + if (0 == mTestIndex) + { + ChipLogProgress(chipTool, " **** Test Start: TestOperationalCredentialsCluster\n"); + } - return cluster.ColorLoopSet(mOnSuccessCallback_12.Cancel(), mOnFailureCallback_12.Cancel(), updateFlagsArgument, - actionArgument, directionArgument, timeArgument, startHueArgument, optionsMaskArgument, - optionsOverrideArgument); + if (mTestCount == mTestIndex) + { + ChipLogProgress(chipTool, " **** Test Complete: TestOperationalCredentialsCluster\n"); + SetCommandExitStatus(CHIP_NO_ERROR); + return; + } + + // Ensure we increment mTestIndex before we start running the relevant + // command. That way if we lose the timeslice after we send the message + // but before our function call returns, we won't end up with an + // incorrect mTestIndex value observed when we get the response. + switch (mTestIndex++) + { + case 0: + ChipLogProgress(chipTool, " ***** Test Step 0 : Read number of supported fabrics\n"); + err = TestReadNumberOfSupportedFabrics_0(); + break; + case 1: + ChipLogProgress(chipTool, " ***** Test Step 1 : Read number of commissioned fabrics\n"); + err = TestReadNumberOfCommissionedFabrics_1(); + break; + } + + if (CHIP_NO_ERROR != err) + { + ChipLogError(chipTool, " ***** Test Failure: %s\n", chip::ErrorStr(err)); + SetCommandExitStatus(err); + } } - void OnFailureResponse_12(uint8_t status) { ThrowFailureResponse(); } +private: + std::atomic_uint16_t mTestIndex; + const uint16_t mTestCount = 2; - void OnSuccessResponse_12() { NextTest(); } + chip::Callback::Callback mOnFailureCallback_0{ OnFailureCallback_0, this }; + chip::Callback::Callback mOnSuccessCallback_0{ OnSuccessCallback_0, this }; + chip::Callback::Callback mOnFailureCallback_1{ OnFailureCallback_1, this }; + chip::Callback::Callback mOnSuccessCallback_1{ OnSuccessCallback_1, + this }; - CHIP_ERROR TestCheckColorLoopDirectionValue_13() + static void OnFailureCallback_0(void * context, uint8_t status) { - chip::Controller::ColorControlClusterTest cluster; - cluster.Associate(mDevice, 1); + (static_cast(context))->OnFailureResponse_0(status); + } - return cluster.ReadAttributeColorLoopDirection(mOnSuccessCallback_13.Cancel(), mOnFailureCallback_13.Cancel()); + static void OnSuccessCallback_0(void * context, uint8_t supportedFabrics) + { + (static_cast(context))->OnSuccessResponse_0(supportedFabrics); } - void OnFailureResponse_13(uint8_t status) { ThrowFailureResponse(); } + static void OnFailureCallback_1(void * context, uint8_t status) + { + (static_cast(context))->OnFailureResponse_1(status); + } - void OnSuccessResponse_13(uint8_t colorLoopDirection) + static void OnSuccessCallback_1(void * context, uint8_t commissionedFabrics) { - VerifyOrReturn(CheckValue("colorLoopDirection", colorLoopDirection, 1)); - NextTest(); + (static_cast(context))->OnSuccessResponse_1(commissionedFabrics); } - CHIP_ERROR TestTurnOffLightThatWeTurnedOn_14() + // + // Tests methods + // + + CHIP_ERROR TestReadNumberOfSupportedFabrics_0() { - chip::Controller::OnOffClusterTest cluster; - cluster.Associate(mDevice, 1); + chip::Controller::OperationalCredentialsClusterTest cluster; + cluster.Associate(mDevice, 0); - return cluster.Off(mOnSuccessCallback_14.Cancel(), mOnFailureCallback_14.Cancel()); + return cluster.ReadAttributeSupportedFabrics(mOnSuccessCallback_0.Cancel(), mOnFailureCallback_0.Cancel()); } - void OnFailureResponse_14(uint8_t status) { ThrowFailureResponse(); } + void OnFailureResponse_0(uint8_t status) { ThrowFailureResponse(); } - void OnSuccessResponse_14() { NextTest(); } + void OnSuccessResponse_0(uint8_t supportedFabrics) + { + VerifyOrReturn(CheckConstraintType("supportedFabrics", "", "uint8")); + VerifyOrReturn(CheckConstraintMinValue("supportedFabrics", supportedFabrics, 4)); + NextTest(); + } - CHIP_ERROR TestCheckOnOffAttributeValueIsFalseAfterOffCommand_15() + CHIP_ERROR TestReadNumberOfCommissionedFabrics_1() { - chip::Controller::OnOffClusterTest cluster; - cluster.Associate(mDevice, 1); + chip::Controller::OperationalCredentialsClusterTest cluster; + cluster.Associate(mDevice, 0); - return cluster.ReadAttributeOnOff(mOnSuccessCallback_15.Cancel(), mOnFailureCallback_15.Cancel()); + return cluster.ReadAttributeCommissionedFabrics(mOnSuccessCallback_1.Cancel(), mOnFailureCallback_1.Cancel()); } - void OnFailureResponse_15(uint8_t status) { ThrowFailureResponse(); } + void OnFailureResponse_1(uint8_t status) { ThrowFailureResponse(); } - void OnSuccessResponse_15(bool onOff) + void OnSuccessResponse_1(uint8_t commissionedFabrics) { - VerifyOrReturn(CheckValue("onOff", onOff, 0)); + VerifyOrReturn(CheckConstraintType("commissionedFabrics", "", "uint8")); + VerifyOrReturn(CheckConstraintMinValue("commissionedFabrics", commissionedFabrics, 1)); NextTest(); } }; @@ -15696,66 +15696,36 @@ void registerCommandsTests(Commands & commands) const char * clusterName = "Tests"; commands_list clusterCommands = { - make_unique(), - make_unique(), - make_unique(), - make_unique(), - make_unique(), - make_unique(), - make_unique(), - make_unique(), - make_unique(), - make_unique(), - make_unique(), - make_unique(), - make_unique(), - make_unique(), - make_unique(), - make_unique(), - make_unique(), - make_unique(), - make_unique(), - make_unique(), - make_unique(), - make_unique(), - make_unique(), - make_unique(), - make_unique(), - make_unique(), - make_unique(), - make_unique(), - make_unique(), - make_unique(), - make_unique(), - make_unique(), - make_unique(), - make_unique(), - make_unique(), - make_unique(), - make_unique(), - make_unique(), - make_unique(), - make_unique(), - make_unique(), - make_unique(), - make_unique(), - make_unique(), - make_unique(), - make_unique(), - make_unique(), - make_unique(), - make_unique(), - make_unique(), - make_unique(), - make_unique(), - make_unique(), - make_unique(), - make_unique(), - make_unique(), - make_unique(), - make_unique(), - make_unique(), - make_unique(), + make_unique(), make_unique(), + make_unique(), make_unique(), + make_unique(), make_unique(), + make_unique(), make_unique(), + make_unique(), make_unique(), + make_unique(), make_unique(), + make_unique(), make_unique(), + make_unique(), make_unique(), + make_unique(), make_unique(), + make_unique(), make_unique(), + make_unique(), make_unique(), + make_unique(), make_unique(), + make_unique(), make_unique(), + make_unique(), make_unique(), + make_unique(), make_unique(), + make_unique(), make_unique(), + make_unique(), make_unique(), + make_unique(), make_unique(), + make_unique(), make_unique(), + make_unique(), make_unique(), + make_unique(), make_unique(), + make_unique(), make_unique(), + make_unique(), make_unique(), + make_unique(), make_unique(), + make_unique(), make_unique(), + make_unique(), make_unique(), + make_unique(), make_unique(), + make_unique(), make_unique(), + make_unique(), make_unique(), + make_unique(), make_unique(), }; commands.Register(clusterName, clusterCommands);