From 50dc18e0e7b6e45f7f641a773c56a9856d198281 Mon Sep 17 00:00:00 2001 From: Li-An Ding Date: Wed, 30 Mar 2022 10:14:16 -0700 Subject: [PATCH] Generated Changes. --- .../zap-generated/endpoint_config.h | 8 +- .../chip-tool/zap-generated/test/Commands.h | 395 +++++++++++++----- 2 files changed, 306 insertions(+), 97 deletions(-) diff --git a/zzz_generated/all-clusters-app/zap-generated/endpoint_config.h b/zzz_generated/all-clusters-app/zap-generated/endpoint_config.h index 8600d7fd70eb4a..d8c7a6a39a9294 100644 --- a/zzz_generated/all-clusters-app/zap-generated/endpoint_config.h +++ b/zzz_generated/all-clusters-app/zap-generated/endpoint_config.h @@ -966,7 +966,7 @@ { (uint16_t) 0x0, (uint16_t) 0x0, (uint16_t) 0x1 }, /* HourFormat */ \ \ /* Endpoint: 1, Cluster: On/Off (server) */ \ - { (uint16_t) 0xFF, (uint16_t) 0x0, (uint16_t) 0x2 }, /* StartUpOnOff */ \ + { (uint16_t) 0x0, (uint16_t) 0x0, (uint16_t) 0x2 }, /* StartUpOnOff */ \ \ /* Endpoint: 1, Cluster: On/off Switch Configuration (server) */ \ { (uint16_t) 0x0, (uint16_t) 0x0, (uint16_t) 0x2 }, /* switch actions */ \ @@ -1346,7 +1346,8 @@ { 0x00004001, ZAP_TYPE(INT16U), 2, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_SIMPLE_DEFAULT(0x0000) }, /* OnTime */ \ { 0x00004002, ZAP_TYPE(INT16U), 2, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_SIMPLE_DEFAULT(0x0000) }, /* OffWaitTime */ \ { 0x00004003, ZAP_TYPE(ENUM8), 1, \ - ZAP_ATTRIBUTE_MASK(MIN_MAX) | ZAP_ATTRIBUTE_MASK(WRITABLE) | ZAP_ATTRIBUTE_MASK(NULLABLE), \ + ZAP_ATTRIBUTE_MASK(MIN_MAX) | ZAP_ATTRIBUTE_MASK(TOKENIZE) | ZAP_ATTRIBUTE_MASK(WRITABLE) | \ + ZAP_ATTRIBUTE_MASK(NULLABLE), \ ZAP_MIN_MAX_DEFAULTS_INDEX(1) }, /* StartUpOnOff */ \ { 0x0000FFFC, ZAP_TYPE(BITMAP32), 4, 0, ZAP_LONG_DEFAULTS_INDEX(355) }, /* FeatureMap */ \ { 0x0000FFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(4) }, /* ClusterRevision */ \ @@ -1451,7 +1452,8 @@ { 0x00000004, ZAP_TYPE(INT8U), 1, \ ZAP_ATTRIBUTE_MASK(TOKENIZE) | ZAP_ATTRIBUTE_MASK(WRITABLE) | ZAP_ATTRIBUTE_MASK(NULLABLE), \ ZAP_SIMPLE_DEFAULT(0) }, /* StartUpMode */ \ - { 0x00000005, ZAP_TYPE(INT8U), 1, ZAP_ATTRIBUTE_MASK(WRITABLE) | ZAP_ATTRIBUTE_MASK(NULLABLE), \ + { 0x00000005, ZAP_TYPE(INT8U), 1, \ + ZAP_ATTRIBUTE_MASK(TOKENIZE) | ZAP_ATTRIBUTE_MASK(WRITABLE) | ZAP_ATTRIBUTE_MASK(NULLABLE), \ ZAP_SIMPLE_DEFAULT(255) }, /* OnMode */ \ { 0x0000FFFC, ZAP_TYPE(BITMAP32), 4, 0, ZAP_LONG_DEFAULTS_INDEX(386) }, /* FeatureMap */ \ { 0x0000FFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(1) }, /* ClusterRevision */ \ diff --git a/zzz_generated/chip-tool/zap-generated/test/Commands.h b/zzz_generated/chip-tool/zap-generated/test/Commands.h index 44fac80f1ce2ed..9c1d9689782268 100644 --- a/zzz_generated/chip-tool/zap-generated/test/Commands.h +++ b/zzz_generated/chip-tool/zap-generated/test/Commands.h @@ -91536,52 +91536,81 @@ class TestModeSelectClusterSuite : public TestCommand err = TestVerifyCurrentModeDoesNotChangeWhenOnModeIsNull_12(); break; case 13: - ChipLogProgress(chipTool, " ***** Test Step 13 : Change OnMode\n"); - err = TestChangeOnMode_13(); + ChipLogProgress(chipTool, " ***** Test Step 13 : Change to Unsupported OnMode\n"); + err = TestChangeToUnsupportedOnMode_13(); break; case 14: - ChipLogProgress(chipTool, " ***** Test Step 14 : Verify OnMode\n"); - err = TestVerifyOnMode_14(); + ChipLogProgress(chipTool, " ***** Test Step 14 : Change OnMode\n"); + err = TestChangeOnMode_14(); break; case 15: - ChipLogProgress(chipTool, " ***** Test Step 15 : Toggle OnOff\n"); - err = TestToggleOnOff_15(); + ChipLogProgress(chipTool, " ***** Test Step 15 : Verify OnMode\n"); + err = TestVerifyOnMode_15(); break; case 16: ChipLogProgress(chipTool, " ***** Test Step 16 : Toggle OnOff\n"); err = TestToggleOnOff_16(); break; case 17: - ChipLogProgress(chipTool, " ***** Test Step 17 : Verify Current Mode Changes if OnMode is not null\n"); - err = TestVerifyCurrentModeChangesIfOnModeIsNotNull_17(); + ChipLogProgress(chipTool, " ***** Test Step 17 : Toggle OnOff\n"); + err = TestToggleOnOff_17(); break; case 18: - ChipLogProgress(chipTool, " ***** Test Step 18 : Change to Unsupported StartUp Mode\n"); - err = TestChangeToUnsupportedStartUpMode_18(); + ChipLogProgress(chipTool, " ***** Test Step 18 : Verify Current Mode Changes if OnMode is not null\n"); + err = TestVerifyCurrentModeChangesIfOnModeIsNotNull_18(); break; case 19: - ChipLogProgress(chipTool, " ***** Test Step 19 : Change to Supported StartUp Mode\n"); - err = TestChangeToSupportedStartUpMode_19(); + ChipLogProgress(chipTool, " ***** Test Step 19 : Change to Unsupported StartUp Mode\n"); + err = TestChangeToUnsupportedStartUpMode_19(); break; case 20: - ChipLogProgress(chipTool, " ***** Test Step 20 : Verify StartUp Mode Change\n"); - err = TestVerifyStartUpModeChange_20(); + ChipLogProgress(chipTool, " ***** Test Step 20 : Change to Supported StartUp Mode\n"); + err = TestChangeToSupportedStartUpMode_20(); break; case 21: - ChipLogProgress(chipTool, " ***** Test Step 21 : Change CurrentMode to another value\n"); - err = TestChangeCurrentModeToAnotherValue_21(); + ChipLogProgress(chipTool, " ***** Test Step 21 : Verify StartUp Mode Change\n"); + err = TestVerifyStartUpModeChange_21(); break; case 22: - ChipLogProgress(chipTool, " ***** Test Step 22 : Reboot target device\n"); - err = TestRebootTargetDevice_22(); + ChipLogProgress(chipTool, " ***** Test Step 22 : Change CurrentMode to another value\n"); + err = TestChangeCurrentModeToAnotherValue_22(); break; case 23: - ChipLogProgress(chipTool, " ***** Test Step 23 : Wait for the commissioned device to be retrieved\n"); - err = TestWaitForTheCommissionedDeviceToBeRetrieved_23(); + ChipLogProgress(chipTool, " ***** Test Step 23 : Change On Mode\n"); + err = TestChangeOnMode_23(); break; case 24: - ChipLogProgress(chipTool, " ***** Test Step 24 : Verify Current Mode Change based on new StartUp Mode\n"); - err = TestVerifyCurrentModeChangeBasedOnNewStartUpMode_24(); + ChipLogProgress(chipTool, " ***** Test Step 24 : Set StartUpOnOff\n"); + err = TestSetStartUpOnOff_24(); + break; + case 25: + ChipLogProgress(chipTool, " ***** Test Step 25 : Reboot target device\n"); + err = TestRebootTargetDevice_25(); + break; + case 26: + ChipLogProgress(chipTool, " ***** Test Step 26 : Wait for the commissioned device to be retrieved\n"); + err = TestWaitForTheCommissionedDeviceToBeRetrieved_26(); + break; + case 27: + ChipLogProgress(chipTool, + " ***** Test Step 27 : Verify Current Mode Change based on OnMode, as it overwrites StartUpMode\n"); + err = TestVerifyCurrentModeChangeBasedOnOnModeAsItOverwritesStartUpMode_27(); + break; + case 28: + ChipLogProgress(chipTool, " ***** Test Step 28 : Change On Mode to Null\n"); + err = TestChangeOnModeToNull_28(); + break; + case 29: + ChipLogProgress(chipTool, " ***** Test Step 29 : Reboot target device\n"); + err = TestRebootTargetDevice_29(); + break; + case 30: + ChipLogProgress(chipTool, " ***** Test Step 30 : Wait for the commissioned device to be retrieved\n"); + err = TestWaitForTheCommissionedDeviceToBeRetrieved_30(); + break; + case 31: + ChipLogProgress(chipTool, " ***** Test Step 31 : Verify Current Mode Change based on new StartUp Mode\n"); + err = TestVerifyCurrentModeChangeBasedOnNewStartUpMode_31(); break; } @@ -91599,7 +91628,7 @@ class TestModeSelectClusterSuite : public TestCommand private: std::atomic_uint16_t mTestIndex; - const uint16_t mTestCount = 25; + const uint16_t mTestCount = 32; chip::Optional mNodeId; chip::Optional mCluster; @@ -91716,19 +91745,19 @@ class TestModeSelectClusterSuite : public TestCommand (static_cast(context))->OnFailureResponse_14(error); } - static void OnSuccessCallback_14(void * context, const chip::app::DataModel::Nullable & onMode) + static void OnSuccessCallback_14(void * context) { - (static_cast(context))->OnSuccessResponse_14(onMode); + (static_cast(context))->OnSuccessResponse_14(); } - static void OnFailureCallback_17(void * context, CHIP_ERROR error) + static void OnFailureCallback_15(void * context, CHIP_ERROR error) { - (static_cast(context))->OnFailureResponse_17(error); + (static_cast(context))->OnFailureResponse_15(error); } - static void OnSuccessCallback_17(void * context, uint8_t currentMode) + static void OnSuccessCallback_15(void * context, const chip::app::DataModel::Nullable & onMode) { - (static_cast(context))->OnSuccessResponse_17(currentMode); + (static_cast(context))->OnSuccessResponse_15(onMode); } static void OnFailureCallback_18(void * context, CHIP_ERROR error) @@ -91736,9 +91765,9 @@ class TestModeSelectClusterSuite : public TestCommand (static_cast(context))->OnFailureResponse_18(error); } - static void OnSuccessCallback_18(void * context) + static void OnSuccessCallback_18(void * context, uint8_t currentMode) { - (static_cast(context))->OnSuccessResponse_18(); + (static_cast(context))->OnSuccessResponse_18(currentMode); } static void OnFailureCallback_19(void * context, CHIP_ERROR error) @@ -91756,9 +91785,29 @@ class TestModeSelectClusterSuite : public TestCommand (static_cast(context))->OnFailureResponse_20(error); } - static void OnSuccessCallback_20(void * context, const chip::app::DataModel::Nullable & startUpMode) + static void OnSuccessCallback_20(void * context) + { + (static_cast(context))->OnSuccessResponse_20(); + } + + static void OnFailureCallback_21(void * context, CHIP_ERROR error) + { + (static_cast(context))->OnFailureResponse_21(error); + } + + static void OnSuccessCallback_21(void * context, const chip::app::DataModel::Nullable & startUpMode) + { + (static_cast(context))->OnSuccessResponse_21(startUpMode); + } + + static void OnFailureCallback_23(void * context, CHIP_ERROR error) + { + (static_cast(context))->OnFailureResponse_23(error); + } + + static void OnSuccessCallback_23(void * context) { - (static_cast(context))->OnSuccessResponse_20(startUpMode); + (static_cast(context))->OnSuccessResponse_23(); } static void OnFailureCallback_24(void * context, CHIP_ERROR error) @@ -91766,9 +91815,39 @@ class TestModeSelectClusterSuite : public TestCommand (static_cast(context))->OnFailureResponse_24(error); } - static void OnSuccessCallback_24(void * context, uint8_t currentMode) + static void OnSuccessCallback_24(void * context) { - (static_cast(context))->OnSuccessResponse_24(currentMode); + (static_cast(context))->OnSuccessResponse_24(); + } + + static void OnFailureCallback_27(void * context, CHIP_ERROR error) + { + (static_cast(context))->OnFailureResponse_27(error); + } + + static void OnSuccessCallback_27(void * context, uint8_t currentMode) + { + (static_cast(context))->OnSuccessResponse_27(currentMode); + } + + static void OnFailureCallback_28(void * context, CHIP_ERROR error) + { + (static_cast(context))->OnFailureResponse_28(error); + } + + static void OnSuccessCallback_28(void * context) + { + (static_cast(context))->OnSuccessResponse_28(); + } + + static void OnFailureCallback_31(void * context, CHIP_ERROR error) + { + (static_cast(context))->OnFailureResponse_31(error); + } + + static void OnSuccessCallback_31(void * context, uint8_t currentMode) + { + (static_cast(context))->OnSuccessResponse_31(currentMode); } // @@ -92105,7 +92184,7 @@ class TestModeSelectClusterSuite : public TestCommand NextTest(); } - CHIP_ERROR TestChangeOnMode_13() + CHIP_ERROR TestChangeToUnsupportedOnMode_13() { const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; chip::Controller::ModeSelectClusterTest cluster; @@ -92113,7 +92192,7 @@ class TestModeSelectClusterSuite : public TestCommand chip::app::DataModel::Nullable onModeArgument; onModeArgument.SetNonNull(); - onModeArgument.Value() = 7; + onModeArgument.Value() = 2; ReturnErrorOnFailure(cluster.WriteAttribute( onModeArgument, this, OnSuccessCallback_13, OnFailureCallback_13)); @@ -92121,31 +92200,55 @@ class TestModeSelectClusterSuite : public TestCommand } void OnFailureResponse_13(CHIP_ERROR error) + { + chip::app::StatusIB status(error); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); + NextTest(); + } + + void OnSuccessResponse_13() { ThrowSuccessResponse(); } + + CHIP_ERROR TestChangeOnMode_14() + { + const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; + chip::Controller::ModeSelectClusterTest cluster; + cluster.Associate(mDevices[kIdentityAlpha], endpoint); + + chip::app::DataModel::Nullable onModeArgument; + onModeArgument.SetNonNull(); + onModeArgument.Value() = 7; + + ReturnErrorOnFailure(cluster.WriteAttribute( + onModeArgument, this, OnSuccessCallback_14, OnFailureCallback_14)); + return CHIP_NO_ERROR; + } + + void OnFailureResponse_14(CHIP_ERROR error) { chip::app::StatusIB status(error); ThrowFailureResponse(); } - void OnSuccessResponse_13() { NextTest(); } + void OnSuccessResponse_14() { NextTest(); } - CHIP_ERROR TestVerifyOnMode_14() + CHIP_ERROR TestVerifyOnMode_15() { const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; chip::Controller::ModeSelectClusterTest cluster; cluster.Associate(mDevices[kIdentityAlpha], endpoint); ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_14, OnFailureCallback_14, true)); + this, OnSuccessCallback_15, OnFailureCallback_15, true)); return CHIP_NO_ERROR; } - void OnFailureResponse_14(CHIP_ERROR error) + void OnFailureResponse_15(CHIP_ERROR error) { chip::app::StatusIB status(error); ThrowFailureResponse(); } - void OnSuccessResponse_14(const chip::app::DataModel::Nullable & onMode) + void OnSuccessResponse_15(const chip::app::DataModel::Nullable & onMode) { VerifyOrReturn(CheckValueNonNull("onMode", onMode)); VerifyOrReturn(CheckValue("onMode.Value()", onMode.Value(), 7)); @@ -92154,7 +92257,7 @@ class TestModeSelectClusterSuite : public TestCommand NextTest(); } - CHIP_ERROR TestToggleOnOff_15() + CHIP_ERROR TestToggleOnOff_16() { const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; using RequestType = chip::app::Clusters::OnOff::Commands::Off::Type; @@ -92162,26 +92265,26 @@ class TestModeSelectClusterSuite : public TestCommand RequestType request; auto success = [](void * context, const typename RequestType::ResponseType & data) { - (static_cast(context))->OnSuccessResponse_15(); + (static_cast(context))->OnSuccessResponse_16(); }; auto failure = [](void * context, CHIP_ERROR error) { - (static_cast(context))->OnFailureResponse_15(error); + (static_cast(context))->OnFailureResponse_16(error); }; ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevices[kIdentityAlpha], this, success, failure, endpoint, request)); return CHIP_NO_ERROR; } - void OnFailureResponse_15(CHIP_ERROR error) + void OnFailureResponse_16(CHIP_ERROR error) { chip::app::StatusIB status(error); ThrowFailureResponse(); } - void OnSuccessResponse_15() { NextTest(); } + void OnSuccessResponse_16() { NextTest(); } - CHIP_ERROR TestToggleOnOff_16() + CHIP_ERROR TestToggleOnOff_17() { const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; using RequestType = chip::app::Clusters::OnOff::Commands::On::Type; @@ -92189,50 +92292,50 @@ class TestModeSelectClusterSuite : public TestCommand RequestType request; auto success = [](void * context, const typename RequestType::ResponseType & data) { - (static_cast(context))->OnSuccessResponse_16(); + (static_cast(context))->OnSuccessResponse_17(); }; auto failure = [](void * context, CHIP_ERROR error) { - (static_cast(context))->OnFailureResponse_16(error); + (static_cast(context))->OnFailureResponse_17(error); }; ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevices[kIdentityAlpha], this, success, failure, endpoint, request)); return CHIP_NO_ERROR; } - void OnFailureResponse_16(CHIP_ERROR error) + void OnFailureResponse_17(CHIP_ERROR error) { chip::app::StatusIB status(error); ThrowFailureResponse(); } - void OnSuccessResponse_16() { NextTest(); } + void OnSuccessResponse_17() { NextTest(); } - CHIP_ERROR TestVerifyCurrentModeChangesIfOnModeIsNotNull_17() + CHIP_ERROR TestVerifyCurrentModeChangesIfOnModeIsNotNull_18() { const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; chip::Controller::ModeSelectClusterTest cluster; cluster.Associate(mDevices[kIdentityAlpha], endpoint); ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_17, OnFailureCallback_17, true)); + this, OnSuccessCallback_18, OnFailureCallback_18, true)); return CHIP_NO_ERROR; } - void OnFailureResponse_17(CHIP_ERROR error) + void OnFailureResponse_18(CHIP_ERROR error) { chip::app::StatusIB status(error); ThrowFailureResponse(); } - void OnSuccessResponse_17(uint8_t currentMode) + void OnSuccessResponse_18(uint8_t currentMode) { VerifyOrReturn(CheckValue("currentMode", currentMode, OnModeValue)); NextTest(); } - CHIP_ERROR TestChangeToUnsupportedStartUpMode_18() + CHIP_ERROR TestChangeToUnsupportedStartUpMode_19() { const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; chip::Controller::ModeSelectClusterTest cluster; @@ -92243,20 +92346,20 @@ class TestModeSelectClusterSuite : public TestCommand startUpModeArgument.Value() = 2; ReturnErrorOnFailure(cluster.WriteAttribute( - startUpModeArgument, this, OnSuccessCallback_18, OnFailureCallback_18)); + startUpModeArgument, this, OnSuccessCallback_19, OnFailureCallback_19)); return CHIP_NO_ERROR; } - void OnFailureResponse_18(CHIP_ERROR error) + void OnFailureResponse_19(CHIP_ERROR error) { chip::app::StatusIB status(error); VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); NextTest(); } - void OnSuccessResponse_18() { ThrowSuccessResponse(); } + void OnSuccessResponse_19() { ThrowSuccessResponse(); } - CHIP_ERROR TestChangeToSupportedStartUpMode_19() + CHIP_ERROR TestChangeToSupportedStartUpMode_20() { const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; chip::Controller::ModeSelectClusterTest cluster; @@ -92267,36 +92370,36 @@ class TestModeSelectClusterSuite : public TestCommand startUpModeArgument.Value() = 7; ReturnErrorOnFailure(cluster.WriteAttribute( - startUpModeArgument, this, OnSuccessCallback_19, OnFailureCallback_19)); + startUpModeArgument, this, OnSuccessCallback_20, OnFailureCallback_20)); return CHIP_NO_ERROR; } - void OnFailureResponse_19(CHIP_ERROR error) + void OnFailureResponse_20(CHIP_ERROR error) { chip::app::StatusIB status(error); ThrowFailureResponse(); } - void OnSuccessResponse_19() { NextTest(); } + void OnSuccessResponse_20() { NextTest(); } - CHIP_ERROR TestVerifyStartUpModeChange_20() + CHIP_ERROR TestVerifyStartUpModeChange_21() { const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; chip::Controller::ModeSelectClusterTest cluster; cluster.Associate(mDevices[kIdentityAlpha], endpoint); ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_20, OnFailureCallback_20, true)); + this, OnSuccessCallback_21, OnFailureCallback_21, true)); return CHIP_NO_ERROR; } - void OnFailureResponse_20(CHIP_ERROR error) + void OnFailureResponse_21(CHIP_ERROR error) { chip::app::StatusIB status(error); ThrowFailureResponse(); } - void OnSuccessResponse_20(const chip::app::DataModel::Nullable & startUpMode) + void OnSuccessResponse_21(const chip::app::DataModel::Nullable & startUpMode) { VerifyOrReturn(CheckValueNonNull("startUpMode", startUpMode)); VerifyOrReturn(CheckValue("startUpMode.Value()", startUpMode.Value(), 7)); @@ -92304,7 +92407,7 @@ class TestModeSelectClusterSuite : public TestCommand NextTest(); } - CHIP_ERROR TestChangeCurrentModeToAnotherValue_21() + CHIP_ERROR TestChangeCurrentModeToAnotherValue_22() { const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; using RequestType = chip::app::Clusters::ModeSelect::Commands::ChangeToMode::Type; @@ -92313,55 +92416,159 @@ class TestModeSelectClusterSuite : public TestCommand request.newMode = 0; auto success = [](void * context, const typename RequestType::ResponseType & data) { - (static_cast(context))->OnSuccessResponse_21(); + (static_cast(context))->OnSuccessResponse_22(); }; auto failure = [](void * context, CHIP_ERROR error) { - (static_cast(context))->OnFailureResponse_21(error); + (static_cast(context))->OnFailureResponse_22(error); }; ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevices[kIdentityAlpha], this, success, failure, endpoint, request)); return CHIP_NO_ERROR; } - void OnFailureResponse_21(CHIP_ERROR error) + void OnFailureResponse_22(CHIP_ERROR error) { chip::app::StatusIB status(error); ThrowFailureResponse(); } - void OnSuccessResponse_21() { NextTest(); } + void OnSuccessResponse_22() { NextTest(); } - CHIP_ERROR TestRebootTargetDevice_22() + CHIP_ERROR TestChangeOnMode_23() + { + const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; + chip::Controller::ModeSelectClusterTest cluster; + cluster.Associate(mDevices[kIdentityAlpha], endpoint); + + chip::app::DataModel::Nullable onModeArgument; + onModeArgument.SetNonNull(); + onModeArgument.Value() = 4; + + ReturnErrorOnFailure(cluster.WriteAttribute( + onModeArgument, this, OnSuccessCallback_23, OnFailureCallback_23)); + return CHIP_NO_ERROR; + } + + void OnFailureResponse_23(CHIP_ERROR error) + { + chip::app::StatusIB status(error); + ThrowFailureResponse(); + } + + void OnSuccessResponse_23() { NextTest(); } + + CHIP_ERROR TestSetStartUpOnOff_24() + { + const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; + chip::Controller::OnOffClusterTest cluster; + cluster.Associate(mDevices[kIdentityAlpha], endpoint); + + chip::app::DataModel::Nullable startUpOnOffArgument; + startUpOnOffArgument.SetNonNull(); + startUpOnOffArgument.Value() = static_cast(1); + + ReturnErrorOnFailure(cluster.WriteAttribute( + startUpOnOffArgument, this, OnSuccessCallback_24, OnFailureCallback_24)); + return CHIP_NO_ERROR; + } + + void OnFailureResponse_24(CHIP_ERROR error) + { + chip::app::StatusIB status(error); + ThrowFailureResponse(); + } + + void OnSuccessResponse_24() { NextTest(); } + + CHIP_ERROR TestRebootTargetDevice_25() { SetIdentity(kIdentityAlpha); return Reboot(mDiscriminator.HasValue() ? mDiscriminator.Value() : 3840U); } - CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrieved_23() + CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrieved_26() { SetIdentity(kIdentityAlpha); return WaitForCommissionee(mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL); } - CHIP_ERROR TestVerifyCurrentModeChangeBasedOnNewStartUpMode_24() + CHIP_ERROR TestVerifyCurrentModeChangeBasedOnOnModeAsItOverwritesStartUpMode_27() { const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; chip::Controller::ModeSelectClusterTest cluster; cluster.Associate(mDevices[kIdentityAlpha], endpoint); ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_24, OnFailureCallback_24, true)); + this, OnSuccessCallback_27, OnFailureCallback_27, true)); return CHIP_NO_ERROR; } - void OnFailureResponse_24(CHIP_ERROR error) + void OnFailureResponse_27(CHIP_ERROR error) + { + chip::app::StatusIB status(error); + ThrowFailureResponse(); + } + + void OnSuccessResponse_27(uint8_t currentMode) + { + VerifyOrReturn(CheckValue("currentMode", currentMode, 4)); + + NextTest(); + } + + CHIP_ERROR TestChangeOnModeToNull_28() + { + const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; + chip::Controller::ModeSelectClusterTest cluster; + cluster.Associate(mDevices[kIdentityAlpha], endpoint); + + chip::app::DataModel::Nullable onModeArgument; + onModeArgument.SetNull(); + + ReturnErrorOnFailure(cluster.WriteAttribute( + onModeArgument, this, OnSuccessCallback_28, OnFailureCallback_28)); + return CHIP_NO_ERROR; + } + + void OnFailureResponse_28(CHIP_ERROR error) + { + chip::app::StatusIB status(error); + ThrowFailureResponse(); + } + + void OnSuccessResponse_28() { NextTest(); } + + CHIP_ERROR TestRebootTargetDevice_29() + { + SetIdentity(kIdentityAlpha); + return Reboot(mDiscriminator.HasValue() ? mDiscriminator.Value() : 3840U); + } + + CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrieved_30() + { + SetIdentity(kIdentityAlpha); + return WaitForCommissionee(mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL); + } + + CHIP_ERROR TestVerifyCurrentModeChangeBasedOnNewStartUpMode_31() + { + const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; + chip::Controller::ModeSelectClusterTest cluster; + cluster.Associate(mDevices[kIdentityAlpha], endpoint); + + ReturnErrorOnFailure(cluster.ReadAttribute( + this, OnSuccessCallback_31, OnFailureCallback_31, true)); + return CHIP_NO_ERROR; + } + + void OnFailureResponse_31(CHIP_ERROR error) { chip::app::StatusIB status(error); ThrowFailureResponse(); } - void OnSuccessResponse_24(uint8_t currentMode) + void OnSuccessResponse_31(uint8_t currentMode) { VerifyOrReturn(CheckValue("currentMode", currentMode, 7)); @@ -113170,11 +113377,11 @@ class Test_TC_MF_1_3Suite : public TestCommand RequestType request; request.commissioningTimeout = 120U; request.PAKEVerifier = chip::ByteSpan( - chip::Uint8::from_const_char("\006\307V\337\374\327\042e4R\241-\315\224]\214T\332+\017<\275\033M\303\361\255\262#" - "\256\262k\004|\322L\226\206o\227\233\035\203\354P\342\264\2560\315\362\375\263+" - "\330\242\021\2707\334\224\355\315V\364\321Cw\031\020v\277\305\235\231\267\3350S\357\326" - "\360,D4\362\275\322z\244\371\316\247\015s\216Lgarbage: not in length on purpose"), - 97); + chip::Uint8::from_const_char("\006\307V\337\374\327\042e4R\241-\315\224]\214T\332+\017<\275\033M\303\361\255\262#" + "\256\262k\004|\322L\226\206o\227\233\035\203\354P\342\264\2560\315\362\375\263+" + "\330\242\021\2707\334\224\355\315V\364\321Cw\031\020v\277\305\235\231\267\3350S\357\326" + "\360,D4\362\275\322z\244\371\316\247\015s\216Lgarbage: not in length on purpose"), + 97); request.discriminator = 3840U; request.iterations = 1000UL; request.salt = chip::ByteSpan(chip::Uint8::from_const_char("SPAKE2P Key Saltgarbage: not in length on purpose"), 16); @@ -113209,11 +113416,11 @@ class Test_TC_MF_1_3Suite : public TestCommand RequestType request; request.commissioningTimeout = 1000U; request.PAKEVerifier = chip::ByteSpan( - chip::Uint8::from_const_char("\006\307V\337\374\327\042e4R\241-\315\224]\214T\332+\017<\275\033M\303\361\255\262#" - "\256\262k\004|\322L\226\206o\227\233\035\203\354P\342\264\2560\315\362\375\263+" - "\330\242\021\2707\334\224\355\315V\364\321Cw\031\020v\277\305\235\231\267\3350S\357\326" - "\360,D4\362\275\322z\244\371\316\247\015s\216Lgarbage: not in length on purpose"), - 97); + chip::Uint8::from_const_char("\006\307V\337\374\327\042e4R\241-\315\224]\214T\332+\017<\275\033M\303\361\255\262#" + "\256\262k\004|\322L\226\206o\227\233\035\203\354P\342\264\2560\315\362\375\263+" + "\330\242\021\2707\334\224\355\315V\364\321Cw\031\020v\277\305\235\231\267\3350S\357\326" + "\360,D4\362\275\322z\244\371\316\247\015s\216Lgarbage: not in length on purpose"), + 97); request.discriminator = 3840U; request.iterations = 1000UL; request.salt = chip::ByteSpan(chip::Uint8::from_const_char("SPAKE2P Key Saltgarbage: not in length on purpose"), 16); @@ -113248,11 +113455,11 @@ class Test_TC_MF_1_3Suite : public TestCommand RequestType request; request.commissioningTimeout = 180U; request.PAKEVerifier = chip::ByteSpan( - chip::Uint8::from_const_char("\006\307V\337\374\327\042e4R\241-\315\224]\214T\332+\017<\275\033M\303\361\255\262#" - "\256\262k\004|\322L\226\206o\227\233\035\203\354P\342\264\2560\315\362\375\263+" - "\330\242\021\2707\334\224\355\315V\364\321Cw\031\020v\277\305\235\231\267\3350S\357\326" - "\360,D4\362\275\322z\244\371\316\247\015s\216Lgarbage: not in length on purpose"), - 97); + chip::Uint8::from_const_char("\006\307V\337\374\327\042e4R\241-\315\224]\214T\332+\017<\275\033M\303\361\255\262#" + "\256\262k\004|\322L\226\206o\227\233\035\203\354P\342\264\2560\315\362\375\263+" + "\330\242\021\2707\334\224\355\315V\364\321Cw\031\020v\277\305\235\231\267\3350S\357\326" + "\360,D4\362\275\322z\244\371\316\247\015s\216Lgarbage: not in length on purpose"), + 97); request.discriminator = 3840U; request.iterations = 1000UL; request.salt = chip::ByteSpan(chip::Uint8::from_const_char("SPAKE2P Key Saltgarbage: not in length on purpose"), 16);