From 5c69d25de69defbac3e036751d9874ea6469e9b0 Mon Sep 17 00:00:00 2001 From: Terence Hampson Date: Mon, 1 May 2023 14:24:05 +0000 Subject: [PATCH] Address PR comment --- .../chip-tool/zap-generated/test/Commands.h | 15 +++++----- .../zap-generated/test/Commands.h | 29 ++++++++++++++----- 2 files changed, 30 insertions(+), 14 deletions(-) diff --git a/zzz_generated/chip-tool/zap-generated/test/Commands.h b/zzz_generated/chip-tool/zap-generated/test/Commands.h index 1696aa2afc2543..74fe8807e0ca3a 100644 --- a/zzz_generated/chip-tool/zap-generated/test/Commands.h +++ b/zzz_generated/chip-tool/zap-generated/test/Commands.h @@ -37863,7 +37863,11 @@ class Test_TC_OO_2_4Suite : public TestCommand break; case 27: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - shouldContinue = true; + { + bool value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("onOff", value, 0)); + } break; case 28: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); @@ -38115,12 +38119,9 @@ class Test_TC_OO_2_4Suite : public TestCommand ); } case 27: { - LogStep(27, "Wait for send Off command to take affect"); - VerifyOrDo(!ShouldSkip("PICS_SDK_CI_ONLY"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); - ListFreer listFreer; - chip::app::Clusters::DelayCommands::Commands::WaitForMs::Type value; - value.ms = 10UL; - return WaitForMs(kIdentityAlpha, value); + LogStep(27, "TH reads the OnOff attribute from the DUT"); + VerifyOrDo(!ShouldSkip("OO.S.A0000"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), OnOff::Id, OnOff::Attributes::OnOff::Id, true, chip::NullOptional); } case 28: { LogStep(28, "Reboot target device"); diff --git a/zzz_generated/darwin-framework-tool/zap-generated/test/Commands.h b/zzz_generated/darwin-framework-tool/zap-generated/test/Commands.h index bfccaf83dbe46f..217820fc3a6d98 100644 --- a/zzz_generated/darwin-framework-tool/zap-generated/test/Commands.h +++ b/zzz_generated/darwin-framework-tool/zap-generated/test/Commands.h @@ -52823,12 +52823,12 @@ class Test_TC_OO_2_4 : public TestCommandBridge { err = TestThSendsOffCommandToDut_26(); break; case 27: - ChipLogProgress(chipTool, " ***** Test Step 27 : Wait for send Off command to take affect\n"); - if (ShouldSkip("PICS_SDK_CI_ONLY")) { + ChipLogProgress(chipTool, " ***** Test Step 27 : TH reads the OnOff attribute from the DUT\n"); + if (ShouldSkip("OO.S.A0000")) { NextTest(); return; } - err = TestWaitForSendOffCommandToTakeAffect_27(); + err = TestThReadsTheOnOffAttributeFromTheDut_27(); break; case 28: ChipLogProgress(chipTool, " ***** Test Step 28 : Reboot target device\n"); @@ -53358,12 +53358,27 @@ class Test_TC_OO_2_4 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestWaitForSendOffCommandToTakeAffect_27() + CHIP_ERROR TestThReadsTheOnOffAttributeFromTheDut_27() { - chip::app::Clusters::DelayCommands::Commands::WaitForMs::Type value; - value.ms = 10UL; - return WaitForMs("alpha", value); + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterOnOff alloc] initWithDevice:device endpointID:@(1) queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeOnOffWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"TH reads the OnOff attribute from the DUT Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + { + id actualValue = value; + VerifyOrReturn(CheckValue("OnOff", actualValue, 0)); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; } CHIP_ERROR TestRebootTargetDevice_28()