From 6201887794fccd2abbb940ce623865dc711cc28c Mon Sep 17 00:00:00 2001 From: Vivien Nicolas Date: Thu, 21 Oct 2021 15:09:29 +0200 Subject: [PATCH] =?UTF-8?q?Move=20the=20list=20of=20YAML=20tests=20runned?= =?UTF-8?q?=20with=20darwin=20under=20src/darwin/Frame=E2=80=A6=20(#10755)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Move the list of YAML tests runned with darwin under src/darwin/Framework/templates/tests.js * Updage generated tests for Darwin --- .../CHIP/templates/clusters-tests.zapt | 2 +- .../Framework/CHIP/templates/templates.json | 3 +- src/darwin/Framework/CHIP/templates/tests.js | 147 + .../Framework/CHIPTests/CHIPClustersTests.m | 7458 ++++++++--------- 4 files changed, 3879 insertions(+), 3731 deletions(-) create mode 100644 src/darwin/Framework/CHIP/templates/tests.js diff --git a/src/darwin/Framework/CHIP/templates/clusters-tests.zapt b/src/darwin/Framework/CHIP/templates/clusters-tests.zapt index 9c776cf2e8565f..74068b5817b2bf 100644 --- a/src/darwin/Framework/CHIP/templates/clusters-tests.zapt +++ b/src/darwin/Framework/CHIP/templates/clusters-tests.zapt @@ -166,7 +166,7 @@ CHIPDevice * GetConnectedDevice() [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -{{>test_cluster tests="TestCluster, TestConstraints, TestDelayCommands, TestDescriptorCluster, TestSubscribe_OnOff, Test_TC_OO_1_1, Test_TC_OO_2_1, Test_TC_OO_2_2, Test_TC_DM_1_1, Test_TC_DM_3_1, Test_TC_WNCV_1_1, Test_TC_WNCV_2_1, Test_TC_WNCV_3_1, Test_TC_WNCV_3_2, Test_TC_WNCV_3_3, Test_TC_BI_1_1, Test_TC_FLW_1_1, Test_TC_TM_1_1, Test_TC_OCC_1_1, TestOperationalCredentialsCluster, Test_TC_LVL_1_1, Test_TC_LVL_2_1, Test_TC_LVL_3_1, Test_TC_CC_1_1, Test_TC_RH_1_1, Test_TC_MC_1_1, Test_TC_TSTAT_1_1, Test_TC_PCC_1_1, Test_TC_TSUIC_1_1, Test_TC_DIAGTH_1_1, Test_TC_TM_2_1, Test_TC_TSUIC_2_1, Test_TC_PCC_2_1, Test_TC_CC_3_1, Test_TC_CC_3_2, Test_TC_CC_3_3, Test_TC_CC_4_1, Test_TC_CC_4_2, Test_TC_CC_4_3, Test_TC_CC_4_4, Test_TC_CC_5_1, Test_TC_CC_5_2, Test_TC_CC_5_3, Test_TC_CC_6_1, Test_TC_CC_6_2, Test_TC_CC_6_3, Test_TC_CC_7_1, Test_TC_CC_7_2, Test_TC_CC_7_3, Test_TC_CC_7_4, Test_TC_CC_8_1"}} +{{>test_cluster tests=(getTests)}} {{#chip_client_clusters}} {{#unless (isStrEqual "Test Cluster" name)}} diff --git a/src/darwin/Framework/CHIP/templates/templates.json b/src/darwin/Framework/CHIP/templates/templates.json index 90a828b0231a81..f80a0fb0b1879b 100644 --- a/src/darwin/Framework/CHIP/templates/templates.json +++ b/src/darwin/Framework/CHIP/templates/templates.json @@ -7,7 +7,8 @@ "../../../../../src/app/zap-templates/templates/app/helper.js", "../../../../../src/app/zap-templates/templates/chip/helper.js", "../../../../../src/app/zap-templates/common/ClusterTestGeneration.js", - "helper.js" + "helper.js", + "tests.js" ], "override": "../../../../../src/app/zap-templates/common/override.js", "partials": [ diff --git a/src/darwin/Framework/CHIP/templates/tests.js b/src/darwin/Framework/CHIP/templates/tests.js new file mode 100644 index 00000000000000..d69dffc35581f9 --- /dev/null +++ b/src/darwin/Framework/CHIP/templates/tests.js @@ -0,0 +1,147 @@ +/* + * + * Copyright (c) 2021 Project CHIP Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +function getTests() +{ + const BinaryInput = [ + 'Test_TC_BI_1_1', + ]; + + const ColorControl = [ + 'Test_TC_CC_1_1', + 'Test_TC_CC_3_1', + 'Test_TC_CC_3_2', + 'Test_TC_CC_3_3', + 'Test_TC_CC_4_1', + 'Test_TC_CC_4_2', + 'Test_TC_CC_4_3', + 'Test_TC_CC_4_4', + 'Test_TC_CC_5_1', + 'Test_TC_CC_5_2', + 'Test_TC_CC_5_3', + 'Test_TC_CC_6_1', + 'Test_TC_CC_6_2', + 'Test_TC_CC_6_3', + 'Test_TC_CC_7_1', + 'Test_TC_CC_7_2', + 'Test_TC_CC_7_3', + 'Test_TC_CC_7_4', + 'Test_TC_CC_8_1', + ]; + + const DeviceManagement = [ + 'Test_TC_DM_1_1', + 'Test_TC_DM_3_1', + ]; + + const FlowMeasurement = [ + 'Test_TC_FLW_1_1', + ]; + + const OccupancySensing = [ + 'Test_TC_OCC_1_1', + ]; + + const LevelControl = [ + 'Test_TC_LVL_1_1', + 'Test_TC_LVL_2_1', + 'Test_TC_LVL_3_1', + ]; + + const MediaControl = [ + 'Test_TC_MC_1_1', + ]; + + const OnOff = [ + 'Test_TC_OO_1_1', + 'Test_TC_OO_2_1', + 'Test_TC_OO_2_2', + ]; + + const PumpConfigurationControl = [ + 'Test_TC_PCC_1_1', + 'Test_TC_PCC_2_1', + ]; + + const RelativeHumidityMeasurement = [ + 'Test_TC_RH_1_1', + ]; + + const TemperatureMeasurement = [ + 'Test_TC_TM_1_1', + 'Test_TC_TM_2_1', + ]; + + const Thermostat = [ + 'Test_TC_TSTAT_1_1', + ]; + + const ThermostatUserConfiguration = [ + 'Test_TC_TSUIC_1_1', + 'Test_TC_TSUIC_2_1', + ]; + + const ThreadNetworkDiagnostics = [ + 'Test_TC_DIAGTH_1_1', + ]; + + const WindowCovering = [ + 'Test_TC_WNCV_1_1', + 'Test_TC_WNCV_2_1', + 'Test_TC_WNCV_3_1', + 'Test_TC_WNCV_3_2', + 'Test_TC_WNCV_3_3', + ]; + + const Others = [ + 'TestCluster', + 'TestConstraints', + 'TestDelayCommands', + 'TestDescriptorCluster', + 'TestOperationalCredentialsCluster', + ]; + + const Subscriptions = [ + 'TestSubscribe_OnOff', + ]; + + const tests = [ + BinaryInput, // + ColorControl, // + DeviceManagement, // + FlowMeasurement, // + LevelControl, // + MediaControl, // + OccupancySensing, // + OnOff, // + PumpConfigurationControl, // + RelativeHumidityMeasurement, // + TemperatureMeasurement, // + Thermostat, // + ThermostatUserConfiguration, // + ThreadNetworkDiagnostics, // + WindowCovering, // + Others, // + Subscriptions, // + ]; + return tests.flat(1); +} + +// +// Module exports +// +exports.getTests = getTests; diff --git a/src/darwin/Framework/CHIPTests/CHIPClustersTests.m b/src/darwin/Framework/CHIPTests/CHIPClustersTests.m index 03a03e00fce559..c71ab1372cb068 100644 --- a/src/darwin/Framework/CHIPTests/CHIPClustersTests.m +++ b/src/darwin/Framework/CHIPTests/CHIPClustersTests.m @@ -184,2682 +184,2836 @@ - (void)testReuseChipClusterObject [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTestCluster_000000_Test +- (void)testSendClusterTest_TC_BI_1_1_000000_ReadAttribute { - XCTestExpectation * expectation = [self expectationWithDescription:@"Send Test Command"]; + XCTestExpectation * expectation = [self expectationWithDescription:@"read the global attribute: ClusterRevision"]; CHIPDevice * device = GetConnectedDevice(); dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; + CHIPTestBinaryInputBasic * cluster = [[CHIPTestBinaryInputBasic alloc] initWithDevice:device endpoint:1 queue:queue]; XCTAssertNotNil(cluster); - [cluster test:^(NSError * err, NSDictionary * values) { - NSLog(@"Send Test Command Error: %@", err); + [cluster readAttributeClusterRevisionWithResponseHandler:^(NSError * err, NSDictionary * values) { + NSLog(@"read the global attribute: ClusterRevision Error: %@", err); XCTAssertEqual(err.code, 0); + XCTAssertEqual([values[@"value"] unsignedShortValue], 1U); + [expectation fulfill]; }]; [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTestCluster_000001_TestNotHandled +- (void)testSendClusterTest_TC_BI_1_1_000001_WriteAttribute { - XCTestExpectation * expectation = [self expectationWithDescription:@"Send Test Not Handled Command"]; + XCTestExpectation * expectation = + [self expectationWithDescription:@"write the default values to mandatory global attribute: ClusterRevision"]; CHIPDevice * device = GetConnectedDevice(); dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; + CHIPTestBinaryInputBasic * cluster = [[CHIPTestBinaryInputBasic alloc] initWithDevice:device endpoint:1 queue:queue]; XCTAssertNotNil(cluster); - [cluster testNotHandled:^(NSError * err, NSDictionary * values) { - NSLog(@"Send Test Not Handled Command Error: %@", err); + uint16_t clusterRevisionArgument = 1U; + [cluster + writeAttributeClusterRevisionWithValue:clusterRevisionArgument + responseHandler:^(NSError * err, NSDictionary * values) { + NSLog(@"write the default values to mandatory global attribute: ClusterRevision Error: %@", err); - XCTAssertEqual(err.code, 1); - [expectation fulfill]; - }]; + XCTAssertEqual(err.code, 1); + [expectation fulfill]; + }]; [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTestCluster_000002_TestSpecific +- (void)testSendClusterTest_TC_BI_1_1_000002_ReadAttribute { - XCTestExpectation * expectation = [self expectationWithDescription:@"Send Test Specific Command"]; + XCTestExpectation * expectation = [self expectationWithDescription:@"reads back global attribute: ClusterRevision"]; CHIPDevice * device = GetConnectedDevice(); dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; + CHIPTestBinaryInputBasic * cluster = [[CHIPTestBinaryInputBasic alloc] initWithDevice:device endpoint:1 queue:queue]; XCTAssertNotNil(cluster); - [cluster testSpecific:^(NSError * err, NSDictionary * values) { - NSLog(@"Send Test Specific Command Error: %@", err); + [cluster readAttributeClusterRevisionWithResponseHandler:^(NSError * err, NSDictionary * values) { + NSLog(@"reads back global attribute: ClusterRevision Error: %@", err); XCTAssertEqual(err.code, 0); - XCTAssertEqual([values[@"returnValue"] unsignedCharValue], 7); + XCTAssertEqual([values[@"value"] unsignedShortValue], 1U); [expectation fulfill]; }]; [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTestCluster_000003_TestAddArguments + +- (void)testSendClusterTest_TC_CC_1_1_000000_WriteAttribute { - XCTestExpectation * expectation = [self expectationWithDescription:@"Send Test Add Arguments Command"]; + XCTestExpectation * expectation = + [self expectationWithDescription:@"write the default values to mandatory global attribute: ClusterRevision"]; CHIPDevice * device = GetConnectedDevice(); dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; + CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; XCTAssertNotNil(cluster); - uint8_t arg1Argument = 3; - uint8_t arg2Argument = 17; - [cluster testAddArguments:arg1Argument - arg2:arg2Argument - responseHandler:^(NSError * err, NSDictionary * values) { - NSLog(@"Send Test Add Arguments Command Error: %@", err); - - XCTAssertEqual(err.code, 0); - - XCTAssertEqual([values[@"returnValue"] unsignedCharValue], 20); + uint16_t clusterRevisionArgument = 4U; + [cluster + writeAttributeClusterRevisionWithValue:clusterRevisionArgument + responseHandler:^(NSError * err, NSDictionary * values) { + NSLog(@"write the default values to mandatory global attribute: ClusterRevision Error: %@", err); - [expectation fulfill]; - }]; + XCTAssertEqual(err.code, 1); + [expectation fulfill]; + }]; [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTestCluster_000004_TestAddArguments + +- (void)testSendClusterTest_TC_CC_3_1_000000_On { - XCTestExpectation * expectation = [self expectationWithDescription:@"Send failing Test Add Arguments Command"]; + XCTestExpectation * expectation = [self expectationWithDescription:@"Turn on light for color control tests"]; CHIPDevice * device = GetConnectedDevice(); dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; + CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:queue]; XCTAssertNotNil(cluster); - uint8_t arg1Argument = 250; - uint8_t arg2Argument = 6; - [cluster testAddArguments:arg1Argument - arg2:arg2Argument - responseHandler:^(NSError * err, NSDictionary * values) { - NSLog(@"Send failing Test Add Arguments Command Error: %@", err); + [cluster on:^(NSError * err, NSDictionary * values) { + NSLog(@"Turn on light for color control tests Error: %@", err); - XCTAssertEqual(err.code, 1); - [expectation fulfill]; - }]; + XCTAssertEqual(err.code, 0); + + [expectation fulfill]; + }]; [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTestCluster_000005_ReadAttribute +- (void)testSendClusterTest_TC_CC_3_1_000001_ReadAttribute { - XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute BOOLEAN Default Value"]; + XCTestExpectation * expectation = [self expectationWithDescription:@"Check on/off attribute value is true after on command"]; CHIPDevice * device = GetConnectedDevice(); dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; + CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:queue]; XCTAssertNotNil(cluster); - [cluster readAttributeBooleanWithResponseHandler:^(NSError * err, NSDictionary * values) { - NSLog(@"Read attribute BOOLEAN Default Value Error: %@", err); + [cluster readAttributeOnOffWithResponseHandler:^(NSError * err, NSDictionary * values) { + NSLog(@"Check on/off attribute value is true after on command Error: %@", err); XCTAssertEqual(err.code, 0); - XCTAssertEqual([values[@"value"] boolValue], 0); + XCTAssertEqual([values[@"value"] boolValue], 1); [expectation fulfill]; }]; [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTestCluster_000006_WriteAttribute +- (void)testSendClusterTest_TC_CC_3_1_000002_MoveToHue { - XCTestExpectation * expectation = [self expectationWithDescription:@"Write attribute BOOLEAN True"]; + XCTestExpectation * expectation = [self expectationWithDescription:@"Move to hue shortest distance command"]; CHIPDevice * device = GetConnectedDevice(); dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; + CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; XCTAssertNotNil(cluster); - bool booleanArgument = 1; - [cluster writeAttributeBooleanWithValue:booleanArgument - responseHandler:^(NSError * err, NSDictionary * values) { - NSLog(@"Write attribute BOOLEAN True Error: %@", err); + uint8_t hueArgument = 150; + uint8_t directionArgument = 0; + uint16_t transitionTimeArgument = 100U; + uint8_t optionsMaskArgument = 0; + uint8_t optionsOverrideArgument = 0; + [cluster moveToHue:hueArgument + direction:directionArgument + transitionTime:transitionTimeArgument + optionsMask:optionsMaskArgument + optionsOverride:optionsOverrideArgument + responseHandler:^(NSError * err, NSDictionary * values) { + NSLog(@"Move to hue shortest distance command Error: %@", err); - XCTAssertEqual(err.code, 0); + XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; + [expectation fulfill]; + }]; [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTestCluster_000007_ReadAttribute +- (void)testSendClusterTest_TC_CC_3_1_000003_MoveToHue { - XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute BOOLEAN True"]; + XCTestExpectation * expectation = [self expectationWithDescription:@"Move to hue longest distance command"]; CHIPDevice * device = GetConnectedDevice(); dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; + CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; XCTAssertNotNil(cluster); - [cluster readAttributeBooleanWithResponseHandler:^(NSError * err, NSDictionary * values) { - NSLog(@"Read attribute BOOLEAN True Error: %@", err); - - XCTAssertEqual(err.code, 0); + uint8_t hueArgument = 200; + uint8_t directionArgument = 1; + uint16_t transitionTimeArgument = 100U; + uint8_t optionsMaskArgument = 0; + uint8_t optionsOverrideArgument = 0; + [cluster moveToHue:hueArgument + direction:directionArgument + transitionTime:transitionTimeArgument + optionsMask:optionsMaskArgument + optionsOverride:optionsOverrideArgument + responseHandler:^(NSError * err, NSDictionary * values) { + NSLog(@"Move to hue longest distance command Error: %@", err); - XCTAssertEqual([values[@"value"] boolValue], 1); + XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; + [expectation fulfill]; + }]; [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTestCluster_000008_WriteAttribute +- (void)testSendClusterTest_TC_CC_3_1_000004_MoveToHue { - XCTestExpectation * expectation = [self expectationWithDescription:@"Write attribute BOOLEAN False"]; + XCTestExpectation * expectation = [self expectationWithDescription:@"Move to hue up command"]; CHIPDevice * device = GetConnectedDevice(); dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; + CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; XCTAssertNotNil(cluster); - bool booleanArgument = 0; - [cluster writeAttributeBooleanWithValue:booleanArgument - responseHandler:^(NSError * err, NSDictionary * values) { - NSLog(@"Write attribute BOOLEAN False Error: %@", err); + uint8_t hueArgument = 250; + uint8_t directionArgument = 2; + uint16_t transitionTimeArgument = 100U; + uint8_t optionsMaskArgument = 0; + uint8_t optionsOverrideArgument = 0; + [cluster moveToHue:hueArgument + direction:directionArgument + transitionTime:transitionTimeArgument + optionsMask:optionsMaskArgument + optionsOverride:optionsOverrideArgument + responseHandler:^(NSError * err, NSDictionary * values) { + NSLog(@"Move to hue up command Error: %@", err); - XCTAssertEqual(err.code, 0); + XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; + [expectation fulfill]; + }]; [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTestCluster_000009_ReadAttribute +- (void)testSendClusterTest_TC_CC_3_1_000005_MoveToHue { - XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute BOOLEAN False"]; + XCTestExpectation * expectation = [self expectationWithDescription:@"Move to hue down command"]; CHIPDevice * device = GetConnectedDevice(); dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; + CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; XCTAssertNotNil(cluster); - [cluster readAttributeBooleanWithResponseHandler:^(NSError * err, NSDictionary * values) { - NSLog(@"Read attribute BOOLEAN False Error: %@", err); - - XCTAssertEqual(err.code, 0); + uint8_t hueArgument = 225; + uint8_t directionArgument = 3; + uint16_t transitionTimeArgument = 100U; + uint8_t optionsMaskArgument = 0; + uint8_t optionsOverrideArgument = 0; + [cluster moveToHue:hueArgument + direction:directionArgument + transitionTime:transitionTimeArgument + optionsMask:optionsMaskArgument + optionsOverride:optionsOverrideArgument + responseHandler:^(NSError * err, NSDictionary * values) { + NSLog(@"Move to hue down command Error: %@", err); - XCTAssertEqual([values[@"value"] boolValue], 0); + XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; + [expectation fulfill]; + }]; [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTestCluster_000010_ReadAttribute +- (void)testSendClusterTest_TC_CC_3_1_000006_Off { - XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute BITMAP8 Default Value"]; + XCTestExpectation * expectation = [self expectationWithDescription:@"Turn off light that we turned on"]; CHIPDevice * device = GetConnectedDevice(); dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; + CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:queue]; XCTAssertNotNil(cluster); - [cluster readAttributeBitmap8WithResponseHandler:^(NSError * err, NSDictionary * values) { - NSLog(@"Read attribute BITMAP8 Default Value Error: %@", err); + [cluster off:^(NSError * err, NSDictionary * values) { + NSLog(@"Turn off light that we turned on Error: %@", err); XCTAssertEqual(err.code, 0); - XCTAssertEqual([values[@"value"] unsignedCharValue], 0); - [expectation fulfill]; }]; [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTestCluster_000011_WriteAttribute +- (void)testSendClusterTest_TC_CC_3_1_000007_ReadAttribute { - XCTestExpectation * expectation = [self expectationWithDescription:@"Write attribute BITMAP8 Max Value"]; + XCTestExpectation * expectation = [self expectationWithDescription:@"Check on/off attribute value is false after off command"]; CHIPDevice * device = GetConnectedDevice(); dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; + CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:queue]; XCTAssertNotNil(cluster); - uint8_t bitmap8Argument = 255; - [cluster writeAttributeBitmap8WithValue:bitmap8Argument - responseHandler:^(NSError * err, NSDictionary * values) { - NSLog(@"Write attribute BITMAP8 Max Value Error: %@", err); + [cluster readAttributeOnOffWithResponseHandler:^(NSError * err, NSDictionary * values) { + NSLog(@"Check on/off attribute value is false after off command Error: %@", err); - XCTAssertEqual(err.code, 0); + XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; + XCTAssertEqual([values[@"value"] boolValue], 0); + + [expectation fulfill]; + }]; [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTestCluster_000012_ReadAttribute + +- (void)testSendClusterTest_TC_CC_3_2_000000_On { - XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute BITMAP8 Max Value"]; + XCTestExpectation * expectation = [self expectationWithDescription:@"Turn on light for color control tests"]; CHIPDevice * device = GetConnectedDevice(); dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; + CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:queue]; XCTAssertNotNil(cluster); - [cluster readAttributeBitmap8WithResponseHandler:^(NSError * err, NSDictionary * values) { - NSLog(@"Read attribute BITMAP8 Max Value Error: %@", err); + [cluster on:^(NSError * err, NSDictionary * values) { + NSLog(@"Turn on light for color control tests Error: %@", err); XCTAssertEqual(err.code, 0); - XCTAssertEqual([values[@"value"] unsignedCharValue], 255); - [expectation fulfill]; }]; [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTestCluster_000013_WriteAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Write attribute BITMAP8 Min Value"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - uint8_t bitmap8Argument = 0; - [cluster writeAttributeBitmap8WithValue:bitmap8Argument - responseHandler:^(NSError * err, NSDictionary * values) { - NSLog(@"Write attribute BITMAP8 Min Value Error: %@", err); - - XCTAssertEqual(err.code, 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestCluster_000014_ReadAttribute +- (void)testSendClusterTest_TC_CC_3_2_000001_ReadAttribute { - XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute BITMAP8 Min Value"]; + XCTestExpectation * expectation = [self expectationWithDescription:@"Check on/off attribute value is true after on command"]; CHIPDevice * device = GetConnectedDevice(); dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; + CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:queue]; XCTAssertNotNil(cluster); - [cluster readAttributeBitmap8WithResponseHandler:^(NSError * err, NSDictionary * values) { - NSLog(@"Read attribute BITMAP8 Min Value Error: %@", err); + [cluster readAttributeOnOffWithResponseHandler:^(NSError * err, NSDictionary * values) { + NSLog(@"Check on/off attribute value is true after on command Error: %@", err); XCTAssertEqual(err.code, 0); - XCTAssertEqual([values[@"value"] unsignedCharValue], 0); + XCTAssertEqual([values[@"value"] boolValue], 1); [expectation fulfill]; }]; [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTestCluster_000015_ReadAttribute +- (void)testSendClusterTest_TC_CC_3_2_000002_MoveHue { - XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute BITMAP16 Default Value"]; + XCTestExpectation * expectation = [self expectationWithDescription:@"Move hue up command"]; CHIPDevice * device = GetConnectedDevice(); dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; + CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; XCTAssertNotNil(cluster); - [cluster readAttributeBitmap16WithResponseHandler:^(NSError * err, NSDictionary * values) { - NSLog(@"Read attribute BITMAP16 Default Value Error: %@", err); - - XCTAssertEqual(err.code, 0); + uint8_t moveModeArgument = 1; + uint8_t rateArgument = 50; + uint8_t optionsMaskArgument = 0; + uint8_t optionsOverrideArgument = 0; + [cluster moveHue:moveModeArgument + rate:rateArgument + optionsMask:optionsMaskArgument + optionsOverride:optionsOverrideArgument + responseHandler:^(NSError * err, NSDictionary * values) { + NSLog(@"Move hue up command Error: %@", err); - XCTAssertEqual([values[@"value"] unsignedShortValue], 0U); + XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; + [expectation fulfill]; + }]; [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTestCluster_000016_WriteAttribute +- (void)testSendClusterTest_TC_CC_3_2_000003_MoveHue { - XCTestExpectation * expectation = [self expectationWithDescription:@"Write attribute BITMAP16 Max Value"]; + XCTestExpectation * expectation = [self expectationWithDescription:@"Move hue stop command"]; CHIPDevice * device = GetConnectedDevice(); dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; + CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; XCTAssertNotNil(cluster); - uint16_t bitmap16Argument = 65535U; - [cluster writeAttributeBitmap16WithValue:bitmap16Argument - responseHandler:^(NSError * err, NSDictionary * values) { - NSLog(@"Write attribute BITMAP16 Max Value Error: %@", err); + uint8_t moveModeArgument = 0; + uint8_t rateArgument = 50; + uint8_t optionsMaskArgument = 0; + uint8_t optionsOverrideArgument = 0; + [cluster moveHue:moveModeArgument + rate:rateArgument + optionsMask:optionsMaskArgument + optionsOverride:optionsOverrideArgument + responseHandler:^(NSError * err, NSDictionary * values) { + NSLog(@"Move hue stop command Error: %@", err); - XCTAssertEqual(err.code, 0); + XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; + [expectation fulfill]; + }]; [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTestCluster_000017_ReadAttribute +- (void)testSendClusterTest_TC_CC_3_2_000004_MoveHue { - XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute BITMAP16 Max Value"]; + XCTestExpectation * expectation = [self expectationWithDescription:@"Move hue down command"]; CHIPDevice * device = GetConnectedDevice(); dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; + CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; XCTAssertNotNil(cluster); - [cluster readAttributeBitmap16WithResponseHandler:^(NSError * err, NSDictionary * values) { - NSLog(@"Read attribute BITMAP16 Max Value Error: %@", err); - - XCTAssertEqual(err.code, 0); + uint8_t moveModeArgument = 3; + uint8_t rateArgument = 50; + uint8_t optionsMaskArgument = 0; + uint8_t optionsOverrideArgument = 0; + [cluster moveHue:moveModeArgument + rate:rateArgument + optionsMask:optionsMaskArgument + optionsOverride:optionsOverrideArgument + responseHandler:^(NSError * err, NSDictionary * values) { + NSLog(@"Move hue down command Error: %@", err); - XCTAssertEqual([values[@"value"] unsignedShortValue], 65535U); + XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; + [expectation fulfill]; + }]; [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTestCluster_000018_WriteAttribute +- (void)testSendClusterTest_TC_CC_3_2_000005_MoveHue { - XCTestExpectation * expectation = [self expectationWithDescription:@"Write attribute BITMAP16 Min Value"]; + XCTestExpectation * expectation = [self expectationWithDescription:@"Move hue stop command"]; CHIPDevice * device = GetConnectedDevice(); dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; + CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; XCTAssertNotNil(cluster); - uint16_t bitmap16Argument = 0U; - [cluster writeAttributeBitmap16WithValue:bitmap16Argument - responseHandler:^(NSError * err, NSDictionary * values) { - NSLog(@"Write attribute BITMAP16 Min Value Error: %@", err); + uint8_t moveModeArgument = 0; + uint8_t rateArgument = 50; + uint8_t optionsMaskArgument = 0; + uint8_t optionsOverrideArgument = 0; + [cluster moveHue:moveModeArgument + rate:rateArgument + optionsMask:optionsMaskArgument + optionsOverride:optionsOverrideArgument + responseHandler:^(NSError * err, NSDictionary * values) { + NSLog(@"Move hue stop command Error: %@", err); - XCTAssertEqual(err.code, 0); + XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; + [expectation fulfill]; + }]; [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTestCluster_000019_ReadAttribute +- (void)testSendClusterTest_TC_CC_3_2_000006_Off { - XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute BITMAP16 Min Value"]; + XCTestExpectation * expectation = [self expectationWithDescription:@"Turn off light that we turned on"]; CHIPDevice * device = GetConnectedDevice(); dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; + CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:queue]; XCTAssertNotNil(cluster); - [cluster readAttributeBitmap16WithResponseHandler:^(NSError * err, NSDictionary * values) { - NSLog(@"Read attribute BITMAP16 Min Value Error: %@", err); + [cluster off:^(NSError * err, NSDictionary * values) { + NSLog(@"Turn off light that we turned on Error: %@", err); XCTAssertEqual(err.code, 0); - XCTAssertEqual([values[@"value"] unsignedShortValue], 0U); - [expectation fulfill]; }]; [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTestCluster_000020_ReadAttribute +- (void)testSendClusterTest_TC_CC_3_2_000007_ReadAttribute { - XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute BITMAP32 Default Value"]; + XCTestExpectation * expectation = [self expectationWithDescription:@"Check on/off attribute value is false after off command"]; CHIPDevice * device = GetConnectedDevice(); dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; + CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:queue]; XCTAssertNotNil(cluster); - [cluster readAttributeBitmap32WithResponseHandler:^(NSError * err, NSDictionary * values) { - NSLog(@"Read attribute BITMAP32 Default Value Error: %@", err); + [cluster readAttributeOnOffWithResponseHandler:^(NSError * err, NSDictionary * values) { + NSLog(@"Check on/off attribute value is false after off command Error: %@", err); XCTAssertEqual(err.code, 0); - XCTAssertEqual([values[@"value"] unsignedLongValue], 0UL); + XCTAssertEqual([values[@"value"] boolValue], 0); [expectation fulfill]; }]; [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTestCluster_000021_WriteAttribute + +- (void)testSendClusterTest_TC_CC_3_3_000000_On { - XCTestExpectation * expectation = [self expectationWithDescription:@"Write attribute BITMAP32 Max Value"]; + XCTestExpectation * expectation = [self expectationWithDescription:@"Turn on light for color control tests"]; CHIPDevice * device = GetConnectedDevice(); dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; + CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:queue]; XCTAssertNotNil(cluster); - uint32_t bitmap32Argument = 4294967295UL; - [cluster writeAttributeBitmap32WithValue:bitmap32Argument - responseHandler:^(NSError * err, NSDictionary * values) { - NSLog(@"Write attribute BITMAP32 Max Value Error: %@", err); + [cluster on:^(NSError * err, NSDictionary * values) { + NSLog(@"Turn on light for color control tests Error: %@", err); - XCTAssertEqual(err.code, 0); + XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; + [expectation fulfill]; + }]; [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTestCluster_000022_ReadAttribute +- (void)testSendClusterTest_TC_CC_3_3_000001_ReadAttribute { - XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute BITMAP32 Max Value"]; + XCTestExpectation * expectation = [self expectationWithDescription:@"Check on/off attribute value is true after on command"]; CHIPDevice * device = GetConnectedDevice(); dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; + CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:queue]; XCTAssertNotNil(cluster); - [cluster readAttributeBitmap32WithResponseHandler:^(NSError * err, NSDictionary * values) { - NSLog(@"Read attribute BITMAP32 Max Value Error: %@", err); + [cluster readAttributeOnOffWithResponseHandler:^(NSError * err, NSDictionary * values) { + NSLog(@"Check on/off attribute value is true after on command Error: %@", err); XCTAssertEqual(err.code, 0); - XCTAssertEqual([values[@"value"] unsignedLongValue], 4294967295UL); + XCTAssertEqual([values[@"value"] boolValue], 1); [expectation fulfill]; }]; [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTestCluster_000023_WriteAttribute +- (void)testSendClusterTest_TC_CC_3_3_000002_StepHue { - XCTestExpectation * expectation = [self expectationWithDescription:@"Write attribute BITMAP32 Min Value"]; + XCTestExpectation * expectation = [self expectationWithDescription:@"Step hue up command"]; CHIPDevice * device = GetConnectedDevice(); dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; + CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; XCTAssertNotNil(cluster); - uint32_t bitmap32Argument = 0UL; - [cluster writeAttributeBitmap32WithValue:bitmap32Argument - responseHandler:^(NSError * err, NSDictionary * values) { - NSLog(@"Write attribute BITMAP32 Min Value Error: %@", err); + uint8_t stepModeArgument = 1; + uint8_t stepSizeArgument = 5; + uint8_t transitionTimeArgument = 25; + uint8_t optionsMaskArgument = 0; + uint8_t optionsOverrideArgument = 0; + [cluster stepHue:stepModeArgument + stepSize:stepSizeArgument + transitionTime:transitionTimeArgument + optionsMask:optionsMaskArgument + optionsOverride:optionsOverrideArgument + responseHandler:^(NSError * err, NSDictionary * values) { + NSLog(@"Step hue up command Error: %@", err); - XCTAssertEqual(err.code, 0); + XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; + [expectation fulfill]; + }]; [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTestCluster_000024_ReadAttribute +- (void)testSendClusterTest_TC_CC_3_3_000003_StepHue { - XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute BITMAP32 Min Value"]; + XCTestExpectation * expectation = [self expectationWithDescription:@"Step hue down command"]; CHIPDevice * device = GetConnectedDevice(); dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; + CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; XCTAssertNotNil(cluster); - [cluster readAttributeBitmap32WithResponseHandler:^(NSError * err, NSDictionary * values) { - NSLog(@"Read attribute BITMAP32 Min Value Error: %@", err); - - XCTAssertEqual(err.code, 0); + uint8_t stepModeArgument = 3; + uint8_t stepSizeArgument = 5; + uint8_t transitionTimeArgument = 25; + uint8_t optionsMaskArgument = 0; + uint8_t optionsOverrideArgument = 0; + [cluster stepHue:stepModeArgument + stepSize:stepSizeArgument + transitionTime:transitionTimeArgument + optionsMask:optionsMaskArgument + optionsOverride:optionsOverrideArgument + responseHandler:^(NSError * err, NSDictionary * values) { + NSLog(@"Step hue down command Error: %@", err); - XCTAssertEqual([values[@"value"] unsignedLongValue], 0UL); + XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; + [expectation fulfill]; + }]; [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTestCluster_000025_ReadAttribute +- (void)testSendClusterTest_TC_CC_3_3_000004_Off { - XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute BITMAP64 Default Value"]; + XCTestExpectation * expectation = [self expectationWithDescription:@"Turn off light that we turned on"]; CHIPDevice * device = GetConnectedDevice(); dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; + CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:queue]; XCTAssertNotNil(cluster); - [cluster readAttributeBitmap64WithResponseHandler:^(NSError * err, NSDictionary * values) { - NSLog(@"Read attribute BITMAP64 Default Value Error: %@", err); + [cluster off:^(NSError * err, NSDictionary * values) { + NSLog(@"Turn off light that we turned on Error: %@", err); XCTAssertEqual(err.code, 0); - XCTAssertEqual([values[@"value"] unsignedLongLongValue], 0ULL); + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} +- (void)testSendClusterTest_TC_CC_3_3_000005_ReadAttribute +{ + XCTestExpectation * expectation = [self expectationWithDescription:@"Check on/off attribute value is false after off command"]; + + CHIPDevice * device = GetConnectedDevice(); + dispatch_queue_t queue = dispatch_get_main_queue(); + CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:queue]; + XCTAssertNotNil(cluster); + + [cluster readAttributeOnOffWithResponseHandler:^(NSError * err, NSDictionary * values) { + NSLog(@"Check on/off attribute value is false after off command Error: %@", err); + + XCTAssertEqual(err.code, 0); + + XCTAssertEqual([values[@"value"] boolValue], 0); [expectation fulfill]; }]; [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTestCluster_000026_WriteAttribute + +- (void)testSendClusterTest_TC_CC_4_1_000000_On { - XCTestExpectation * expectation = [self expectationWithDescription:@"Write attribute BITMAP64 Max Value"]; + XCTestExpectation * expectation = [self expectationWithDescription:@"Turn on light for color control tests"]; CHIPDevice * device = GetConnectedDevice(); dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; + CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:queue]; XCTAssertNotNil(cluster); - uint64_t bitmap64Argument = 18446744073709551615ULL; - [cluster writeAttributeBitmap64WithValue:bitmap64Argument - responseHandler:^(NSError * err, NSDictionary * values) { - NSLog(@"Write attribute BITMAP64 Max Value Error: %@", err); + [cluster on:^(NSError * err, NSDictionary * values) { + NSLog(@"Turn on light for color control tests Error: %@", err); - XCTAssertEqual(err.code, 0); + XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; + [expectation fulfill]; + }]; [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTestCluster_000027_ReadAttribute +- (void)testSendClusterTest_TC_CC_4_1_000001_ReadAttribute { - XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute BITMAP64 Max Value"]; + XCTestExpectation * expectation = [self expectationWithDescription:@"Check on/off attribute value is true after on command"]; CHIPDevice * device = GetConnectedDevice(); dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; + CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:queue]; XCTAssertNotNil(cluster); - [cluster readAttributeBitmap64WithResponseHandler:^(NSError * err, NSDictionary * values) { - NSLog(@"Read attribute BITMAP64 Max Value Error: %@", err); + [cluster readAttributeOnOffWithResponseHandler:^(NSError * err, NSDictionary * values) { + NSLog(@"Check on/off attribute value is true after on command Error: %@", err); XCTAssertEqual(err.code, 0); - XCTAssertEqual([values[@"value"] unsignedLongLongValue], 18446744073709551615ULL); + XCTAssertEqual([values[@"value"] boolValue], 1); [expectation fulfill]; }]; [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTestCluster_000028_WriteAttribute +- (void)testSendClusterTest_TC_CC_4_1_000002_MoveToSaturation { - XCTestExpectation * expectation = [self expectationWithDescription:@"Write attribute BITMAP64 Min Value"]; + XCTestExpectation * expectation = [self expectationWithDescription:@"Move to saturation command"]; CHIPDevice * device = GetConnectedDevice(); dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; + CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; XCTAssertNotNil(cluster); - uint64_t bitmap64Argument = 0ULL; - [cluster writeAttributeBitmap64WithValue:bitmap64Argument - responseHandler:^(NSError * err, NSDictionary * values) { - NSLog(@"Write attribute BITMAP64 Min Value Error: %@", err); + uint8_t saturationArgument = 90; + uint16_t transitionTimeArgument = 10U; + uint8_t optionsMaskArgument = 0; + uint8_t optionsOverrideArgument = 0; + [cluster moveToSaturation:saturationArgument + transitionTime:transitionTimeArgument + optionsMask:optionsMaskArgument + optionsOverride:optionsOverrideArgument + responseHandler:^(NSError * err, NSDictionary * values) { + NSLog(@"Move to saturation command Error: %@", err); - XCTAssertEqual(err.code, 0); + XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; + [expectation fulfill]; + }]; [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTestCluster_000029_ReadAttribute +- (void)testSendClusterTest_TC_CC_4_1_000003_Off { - XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute BITMAP64 Min Value"]; + XCTestExpectation * expectation = [self expectationWithDescription:@"Turn off light that we turned on"]; CHIPDevice * device = GetConnectedDevice(); dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; + CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:queue]; XCTAssertNotNil(cluster); - [cluster readAttributeBitmap64WithResponseHandler:^(NSError * err, NSDictionary * values) { - NSLog(@"Read attribute BITMAP64 Min Value Error: %@", err); + [cluster off:^(NSError * err, NSDictionary * values) { + NSLog(@"Turn off light that we turned on Error: %@", err); XCTAssertEqual(err.code, 0); - XCTAssertEqual([values[@"value"] unsignedLongLongValue], 0ULL); - [expectation fulfill]; }]; [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTestCluster_000030_ReadAttribute +- (void)testSendClusterTest_TC_CC_4_1_000004_ReadAttribute { - XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute INT8U Default Value"]; + XCTestExpectation * expectation = [self expectationWithDescription:@"Check on/off attribute value is false after off command"]; CHIPDevice * device = GetConnectedDevice(); dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; + CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:queue]; XCTAssertNotNil(cluster); - [cluster readAttributeInt8uWithResponseHandler:^(NSError * err, NSDictionary * values) { - NSLog(@"Read attribute INT8U Default Value Error: %@", err); + [cluster readAttributeOnOffWithResponseHandler:^(NSError * err, NSDictionary * values) { + NSLog(@"Check on/off attribute value is false after off command Error: %@", err); XCTAssertEqual(err.code, 0); - XCTAssertEqual([values[@"value"] unsignedCharValue], 0); + XCTAssertEqual([values[@"value"] boolValue], 0); [expectation fulfill]; }]; [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTestCluster_000031_WriteAttribute + +- (void)testSendClusterTest_TC_CC_4_2_000000_On { - XCTestExpectation * expectation = [self expectationWithDescription:@"Write attribute INT8U Max Value"]; + XCTestExpectation * expectation = [self expectationWithDescription:@"Turn on light for color control tests"]; CHIPDevice * device = GetConnectedDevice(); dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; + CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:queue]; XCTAssertNotNil(cluster); - uint8_t int8uArgument = 255; - [cluster writeAttributeInt8uWithValue:int8uArgument - responseHandler:^(NSError * err, NSDictionary * values) { - NSLog(@"Write attribute INT8U Max Value Error: %@", err); + [cluster on:^(NSError * err, NSDictionary * values) { + NSLog(@"Turn on light for color control tests Error: %@", err); - XCTAssertEqual(err.code, 0); + XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; + [expectation fulfill]; + }]; [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTestCluster_000032_ReadAttribute +- (void)testSendClusterTest_TC_CC_4_2_000001_ReadAttribute { - XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute INT8U Max Value"]; + XCTestExpectation * expectation = [self expectationWithDescription:@"Check on/off attribute value is true after on command"]; CHIPDevice * device = GetConnectedDevice(); dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; + CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:queue]; XCTAssertNotNil(cluster); - [cluster readAttributeInt8uWithResponseHandler:^(NSError * err, NSDictionary * values) { - NSLog(@"Read attribute INT8U Max Value Error: %@", err); + [cluster readAttributeOnOffWithResponseHandler:^(NSError * err, NSDictionary * values) { + NSLog(@"Check on/off attribute value is true after on command Error: %@", err); XCTAssertEqual(err.code, 0); - XCTAssertEqual([values[@"value"] unsignedCharValue], 255); + XCTAssertEqual([values[@"value"] boolValue], 1); [expectation fulfill]; }]; [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTestCluster_000033_WriteAttribute +- (void)testSendClusterTest_TC_CC_4_2_000002_MoveSaturation { - XCTestExpectation * expectation = [self expectationWithDescription:@"Write attribute INT8U Min Value"]; + XCTestExpectation * expectation = [self expectationWithDescription:@"Move saturation up command"]; CHIPDevice * device = GetConnectedDevice(); dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; + CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; XCTAssertNotNil(cluster); - uint8_t int8uArgument = 0; - [cluster writeAttributeInt8uWithValue:int8uArgument - responseHandler:^(NSError * err, NSDictionary * values) { - NSLog(@"Write attribute INT8U Min Value Error: %@", err); + uint8_t moveModeArgument = 1; + uint8_t rateArgument = 5; + uint8_t optionsMaskArgument = 0; + uint8_t optionsOverrideArgument = 0; + [cluster moveSaturation:moveModeArgument + rate:rateArgument + optionsMask:optionsMaskArgument + optionsOverride:optionsOverrideArgument + responseHandler:^(NSError * err, NSDictionary * values) { + NSLog(@"Move saturation up command Error: %@", err); - XCTAssertEqual(err.code, 0); + XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; + [expectation fulfill]; + }]; [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTestCluster_000034_ReadAttribute +- (void)testSendClusterTest_TC_CC_4_2_000003_MoveSaturation { - XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute INT8U Min Value"]; + XCTestExpectation * expectation = [self expectationWithDescription:@"Move saturation down command"]; CHIPDevice * device = GetConnectedDevice(); dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; + CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; XCTAssertNotNil(cluster); - [cluster readAttributeInt8uWithResponseHandler:^(NSError * err, NSDictionary * values) { - NSLog(@"Read attribute INT8U Min Value Error: %@", err); + uint8_t moveModeArgument = 3; + uint8_t rateArgument = 5; + uint8_t optionsMaskArgument = 0; + uint8_t optionsOverrideArgument = 0; + [cluster moveSaturation:moveModeArgument + rate:rateArgument + optionsMask:optionsMaskArgument + optionsOverride:optionsOverrideArgument + responseHandler:^(NSError * err, NSDictionary * values) { + NSLog(@"Move saturation down command Error: %@", err); - XCTAssertEqual(err.code, 0); + XCTAssertEqual(err.code, 0); - XCTAssertEqual([values[@"value"] unsignedCharValue], 0); + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} +- (void)testSendClusterTest_TC_CC_4_2_000004_Off +{ + XCTestExpectation * expectation = [self expectationWithDescription:@"Turn off light that we turned on"]; + + CHIPDevice * device = GetConnectedDevice(); + dispatch_queue_t queue = dispatch_get_main_queue(); + CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:queue]; + XCTAssertNotNil(cluster); + + [cluster off:^(NSError * err, NSDictionary * values) { + NSLog(@"Turn off light that we turned on Error: %@", err); + + XCTAssertEqual(err.code, 0); [expectation fulfill]; }]; [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTestCluster_000035_ReadAttribute +- (void)testSendClusterTest_TC_CC_4_2_000005_ReadAttribute { - XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute INT16U Default Value"]; + XCTestExpectation * expectation = [self expectationWithDescription:@"Check on/off attribute value is false after off command"]; CHIPDevice * device = GetConnectedDevice(); dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; + CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:queue]; XCTAssertNotNil(cluster); - [cluster readAttributeInt16uWithResponseHandler:^(NSError * err, NSDictionary * values) { - NSLog(@"Read attribute INT16U Default Value Error: %@", err); + [cluster readAttributeOnOffWithResponseHandler:^(NSError * err, NSDictionary * values) { + NSLog(@"Check on/off attribute value is false after off command Error: %@", err); XCTAssertEqual(err.code, 0); - XCTAssertEqual([values[@"value"] unsignedShortValue], 0U); + XCTAssertEqual([values[@"value"] boolValue], 0); [expectation fulfill]; }]; [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTestCluster_000036_WriteAttribute + +- (void)testSendClusterTest_TC_CC_4_3_000000_On { - XCTestExpectation * expectation = [self expectationWithDescription:@"Write attribute INT16U Max Value"]; + XCTestExpectation * expectation = [self expectationWithDescription:@"Turn on light for color control tests"]; CHIPDevice * device = GetConnectedDevice(); dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; + CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:queue]; XCTAssertNotNil(cluster); - uint16_t int16uArgument = 65535U; - [cluster writeAttributeInt16uWithValue:int16uArgument - responseHandler:^(NSError * err, NSDictionary * values) { - NSLog(@"Write attribute INT16U Max Value Error: %@", err); + [cluster on:^(NSError * err, NSDictionary * values) { + NSLog(@"Turn on light for color control tests Error: %@", err); - XCTAssertEqual(err.code, 0); + XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; + [expectation fulfill]; + }]; [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTestCluster_000037_ReadAttribute +- (void)testSendClusterTest_TC_CC_4_3_000001_ReadAttribute { - XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute INT16U Max Value"]; + XCTestExpectation * expectation = [self expectationWithDescription:@"Check on/off attribute value is true after on command"]; CHIPDevice * device = GetConnectedDevice(); dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; + CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:queue]; XCTAssertNotNil(cluster); - [cluster readAttributeInt16uWithResponseHandler:^(NSError * err, NSDictionary * values) { - NSLog(@"Read attribute INT16U Max Value Error: %@", err); + [cluster readAttributeOnOffWithResponseHandler:^(NSError * err, NSDictionary * values) { + NSLog(@"Check on/off attribute value is true after on command Error: %@", err); XCTAssertEqual(err.code, 0); - XCTAssertEqual([values[@"value"] unsignedShortValue], 65535U); + XCTAssertEqual([values[@"value"] boolValue], 1); [expectation fulfill]; }]; [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTestCluster_000038_WriteAttribute +- (void)testSendClusterTest_TC_CC_4_3_000002_StepSaturation { - XCTestExpectation * expectation = [self expectationWithDescription:@"Write attribute INT16U Min Value"]; + XCTestExpectation * expectation = [self expectationWithDescription:@"Step saturation up command"]; CHIPDevice * device = GetConnectedDevice(); dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; + CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; XCTAssertNotNil(cluster); - uint16_t int16uArgument = 0U; - [cluster writeAttributeInt16uWithValue:int16uArgument - responseHandler:^(NSError * err, NSDictionary * values) { - NSLog(@"Write attribute INT16U Min Value Error: %@", err); + uint8_t stepModeArgument = 1; + uint8_t stepSizeArgument = 15; + uint8_t transitionTimeArgument = 10; + uint8_t optionsMaskArgument = 0; + uint8_t optionsOverrideArgument = 0; + [cluster stepSaturation:stepModeArgument + stepSize:stepSizeArgument + transitionTime:transitionTimeArgument + optionsMask:optionsMaskArgument + optionsOverride:optionsOverrideArgument + responseHandler:^(NSError * err, NSDictionary * values) { + NSLog(@"Step saturation up command Error: %@", err); - XCTAssertEqual(err.code, 0); + XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; + [expectation fulfill]; + }]; [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTestCluster_000039_ReadAttribute +- (void)testSendClusterTest_TC_CC_4_3_000003_StepSaturation { - XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute INT16U Min Value"]; + XCTestExpectation * expectation = [self expectationWithDescription:@"Step saturation down command"]; CHIPDevice * device = GetConnectedDevice(); dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; + CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; XCTAssertNotNil(cluster); - [cluster readAttributeInt16uWithResponseHandler:^(NSError * err, NSDictionary * values) { - NSLog(@"Read attribute INT16U Min Value Error: %@", err); + uint8_t stepModeArgument = 3; + uint8_t stepSizeArgument = 20; + uint8_t transitionTimeArgument = 10; + uint8_t optionsMaskArgument = 0; + uint8_t optionsOverrideArgument = 0; + [cluster stepSaturation:stepModeArgument + stepSize:stepSizeArgument + transitionTime:transitionTimeArgument + optionsMask:optionsMaskArgument + optionsOverride:optionsOverrideArgument + responseHandler:^(NSError * err, NSDictionary * values) { + NSLog(@"Step saturation down command Error: %@", err); - XCTAssertEqual(err.code, 0); + XCTAssertEqual(err.code, 0); - XCTAssertEqual([values[@"value"] unsignedShortValue], 0U); + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} +- (void)testSendClusterTest_TC_CC_4_3_000004_Off +{ + XCTestExpectation * expectation = [self expectationWithDescription:@"Turn off light that we turned on"]; + + CHIPDevice * device = GetConnectedDevice(); + dispatch_queue_t queue = dispatch_get_main_queue(); + CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:queue]; + XCTAssertNotNil(cluster); + + [cluster off:^(NSError * err, NSDictionary * values) { + NSLog(@"Turn off light that we turned on Error: %@", err); + + XCTAssertEqual(err.code, 0); [expectation fulfill]; }]; [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTestCluster_000040_ReadAttribute +- (void)testSendClusterTest_TC_CC_4_3_000005_ReadAttribute { - XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute INT32U Default Value"]; + XCTestExpectation * expectation = [self expectationWithDescription:@"Check on/off attribute value is false after off command"]; CHIPDevice * device = GetConnectedDevice(); dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; + CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:queue]; XCTAssertNotNil(cluster); - [cluster readAttributeInt32uWithResponseHandler:^(NSError * err, NSDictionary * values) { - NSLog(@"Read attribute INT32U Default Value Error: %@", err); + [cluster readAttributeOnOffWithResponseHandler:^(NSError * err, NSDictionary * values) { + NSLog(@"Check on/off attribute value is false after off command Error: %@", err); XCTAssertEqual(err.code, 0); - XCTAssertEqual([values[@"value"] unsignedLongValue], 0UL); + XCTAssertEqual([values[@"value"] boolValue], 0); [expectation fulfill]; }]; [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTestCluster_000041_WriteAttribute + +- (void)testSendClusterTest_TC_CC_4_4_000000_On { - XCTestExpectation * expectation = [self expectationWithDescription:@"Write attribute INT32U Max Value"]; + XCTestExpectation * expectation = [self expectationWithDescription:@"Turn on light for color control tests"]; CHIPDevice * device = GetConnectedDevice(); dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; + CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:queue]; XCTAssertNotNil(cluster); - uint32_t int32uArgument = 4294967295UL; - [cluster writeAttributeInt32uWithValue:int32uArgument - responseHandler:^(NSError * err, NSDictionary * values) { - NSLog(@"Write attribute INT32U Max Value Error: %@", err); + [cluster on:^(NSError * err, NSDictionary * values) { + NSLog(@"Turn on light for color control tests Error: %@", err); - XCTAssertEqual(err.code, 0); + XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; + [expectation fulfill]; + }]; [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTestCluster_000042_ReadAttribute +- (void)testSendClusterTest_TC_CC_4_4_000001_ReadAttribute { - XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute INT32U Max Value"]; + XCTestExpectation * expectation = [self expectationWithDescription:@"Check on/off attribute value is true after on command"]; CHIPDevice * device = GetConnectedDevice(); dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; + CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:queue]; XCTAssertNotNil(cluster); - [cluster readAttributeInt32uWithResponseHandler:^(NSError * err, NSDictionary * values) { - NSLog(@"Read attribute INT32U Max Value Error: %@", err); + [cluster readAttributeOnOffWithResponseHandler:^(NSError * err, NSDictionary * values) { + NSLog(@"Check on/off attribute value is true after on command Error: %@", err); XCTAssertEqual(err.code, 0); - XCTAssertEqual([values[@"value"] unsignedLongValue], 4294967295UL); + XCTAssertEqual([values[@"value"] boolValue], 1); [expectation fulfill]; }]; [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTestCluster_000043_WriteAttribute +- (void)testSendClusterTest_TC_CC_4_4_000002_MoveToHueAndSaturation { - XCTestExpectation * expectation = [self expectationWithDescription:@"Write attribute INT32U Min Value"]; + XCTestExpectation * expectation = [self expectationWithDescription:@"Move To current hue and saturation command"]; CHIPDevice * device = GetConnectedDevice(); dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; + CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; XCTAssertNotNil(cluster); - uint32_t int32uArgument = 0UL; - [cluster writeAttributeInt32uWithValue:int32uArgument - responseHandler:^(NSError * err, NSDictionary * values) { - NSLog(@"Write attribute INT32U Min Value Error: %@", err); + uint8_t hueArgument = 40; + uint8_t saturationArgument = 160; + uint16_t transitionTimeArgument = 10U; + uint8_t optionsMaskArgument = 0; + uint8_t optionsOverrideArgument = 0; + [cluster moveToHueAndSaturation:hueArgument + saturation:saturationArgument + transitionTime:transitionTimeArgument + optionsMask:optionsMaskArgument + optionsOverride:optionsOverrideArgument + responseHandler:^(NSError * err, NSDictionary * values) { + NSLog(@"Move To current hue and saturation command Error: %@", err); - XCTAssertEqual(err.code, 0); + XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; + [expectation fulfill]; + }]; [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTestCluster_000044_ReadAttribute +- (void)testSendClusterTest_TC_CC_4_4_000003_Off { - XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute INT32U Min Value"]; + XCTestExpectation * expectation = [self expectationWithDescription:@"Turn off light that we turned on"]; CHIPDevice * device = GetConnectedDevice(); dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; + CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:queue]; XCTAssertNotNil(cluster); - [cluster readAttributeInt32uWithResponseHandler:^(NSError * err, NSDictionary * values) { - NSLog(@"Read attribute INT32U Min Value Error: %@", err); + [cluster off:^(NSError * err, NSDictionary * values) { + NSLog(@"Turn off light that we turned on Error: %@", err); XCTAssertEqual(err.code, 0); - XCTAssertEqual([values[@"value"] unsignedLongValue], 0UL); - [expectation fulfill]; }]; [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTestCluster_000045_ReadAttribute +- (void)testSendClusterTest_TC_CC_4_4_000004_ReadAttribute { - XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute INT64U Default Value"]; + XCTestExpectation * expectation = [self expectationWithDescription:@"Check on/off attribute value is false after off command"]; CHIPDevice * device = GetConnectedDevice(); dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; + CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:queue]; XCTAssertNotNil(cluster); - [cluster readAttributeInt64uWithResponseHandler:^(NSError * err, NSDictionary * values) { - NSLog(@"Read attribute INT64U Default Value Error: %@", err); + [cluster readAttributeOnOffWithResponseHandler:^(NSError * err, NSDictionary * values) { + NSLog(@"Check on/off attribute value is false after off command Error: %@", err); XCTAssertEqual(err.code, 0); - XCTAssertEqual([values[@"value"] unsignedLongLongValue], 0ULL); + XCTAssertEqual([values[@"value"] boolValue], 0); [expectation fulfill]; }]; [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTestCluster_000046_WriteAttribute + +- (void)testSendClusterTest_TC_CC_5_1_000000_On { - XCTestExpectation * expectation = [self expectationWithDescription:@"Write attribute INT64U Max Value"]; + XCTestExpectation * expectation = [self expectationWithDescription:@"Turn on light for color control tests"]; CHIPDevice * device = GetConnectedDevice(); dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; + CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:queue]; XCTAssertNotNil(cluster); - uint64_t int64uArgument = 18446744073709551615ULL; - [cluster writeAttributeInt64uWithValue:int64uArgument - responseHandler:^(NSError * err, NSDictionary * values) { - NSLog(@"Write attribute INT64U Max Value Error: %@", err); + [cluster on:^(NSError * err, NSDictionary * values) { + NSLog(@"Turn on light for color control tests Error: %@", err); - XCTAssertEqual(err.code, 0); + XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; + [expectation fulfill]; + }]; [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTestCluster_000047_ReadAttribute +- (void)testSendClusterTest_TC_CC_5_1_000001_ReadAttribute { - XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute INT64U Max Value"]; + XCTestExpectation * expectation = [self expectationWithDescription:@"Check on/off attribute value is true after on command"]; CHIPDevice * device = GetConnectedDevice(); dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; + CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:queue]; XCTAssertNotNil(cluster); - [cluster readAttributeInt64uWithResponseHandler:^(NSError * err, NSDictionary * values) { - NSLog(@"Read attribute INT64U Max Value Error: %@", err); + [cluster readAttributeOnOffWithResponseHandler:^(NSError * err, NSDictionary * values) { + NSLog(@"Check on/off attribute value is true after on command Error: %@", err); XCTAssertEqual(err.code, 0); - XCTAssertEqual([values[@"value"] unsignedLongLongValue], 18446744073709551615ULL); + XCTAssertEqual([values[@"value"] boolValue], 1); [expectation fulfill]; }]; [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTestCluster_000048_WriteAttribute +- (void)testSendClusterTest_TC_CC_5_1_000002_MoveToColor { - XCTestExpectation * expectation = [self expectationWithDescription:@"Write attribute INT64U Min Value"]; + XCTestExpectation * expectation = [self expectationWithDescription:@"Move to Color command"]; CHIPDevice * device = GetConnectedDevice(); dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; + CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; XCTAssertNotNil(cluster); - uint64_t int64uArgument = 0ULL; - [cluster writeAttributeInt64uWithValue:int64uArgument - responseHandler:^(NSError * err, NSDictionary * values) { - NSLog(@"Write attribute INT64U Min Value Error: %@", err); + uint16_t colorXArgument = 200U; + uint16_t colorYArgument = 300U; + uint16_t transitionTimeArgument = 20U; + uint8_t optionsMaskArgument = 0; + uint8_t optionsOverrideArgument = 0; + [cluster moveToColor:colorXArgument + colorY:colorYArgument + transitionTime:transitionTimeArgument + optionsMask:optionsMaskArgument + optionsOverride:optionsOverrideArgument + responseHandler:^(NSError * err, NSDictionary * values) { + NSLog(@"Move to Color command Error: %@", err); - XCTAssertEqual(err.code, 0); + XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; + [expectation fulfill]; + }]; [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTestCluster_000049_ReadAttribute +- (void)testSendClusterTest_TC_CC_5_1_000003_Off { - XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute INT64U Min Value"]; + XCTestExpectation * expectation = [self expectationWithDescription:@"Turn off light that we turned on"]; CHIPDevice * device = GetConnectedDevice(); dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; + CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:queue]; XCTAssertNotNil(cluster); - [cluster readAttributeInt64uWithResponseHandler:^(NSError * err, NSDictionary * values) { - NSLog(@"Read attribute INT64U Min Value Error: %@", err); + [cluster off:^(NSError * err, NSDictionary * values) { + NSLog(@"Turn off light that we turned on Error: %@", err); XCTAssertEqual(err.code, 0); - XCTAssertEqual([values[@"value"] unsignedLongLongValue], 0ULL); - [expectation fulfill]; }]; [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTestCluster_000050_ReadAttribute +- (void)testSendClusterTest_TC_CC_5_1_000004_ReadAttribute { - XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute INT8S Default Value"]; + XCTestExpectation * expectation = [self expectationWithDescription:@"Check on/off attribute value is false after off command"]; CHIPDevice * device = GetConnectedDevice(); dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; + CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:queue]; XCTAssertNotNil(cluster); - [cluster readAttributeInt8sWithResponseHandler:^(NSError * err, NSDictionary * values) { - NSLog(@"Read attribute INT8S Default Value Error: %@", err); + [cluster readAttributeOnOffWithResponseHandler:^(NSError * err, NSDictionary * values) { + NSLog(@"Check on/off attribute value is false after off command Error: %@", err); XCTAssertEqual(err.code, 0); - XCTAssertEqual([values[@"value"] charValue], 0); + XCTAssertEqual([values[@"value"] boolValue], 0); [expectation fulfill]; }]; [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTestCluster_000051_WriteAttribute + +- (void)testSendClusterTest_TC_CC_5_2_000000_On { - XCTestExpectation * expectation = [self expectationWithDescription:@"Write attribute INT8S Max Value"]; + XCTestExpectation * expectation = [self expectationWithDescription:@"Turn on light for color control tests"]; CHIPDevice * device = GetConnectedDevice(); dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; + CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:queue]; XCTAssertNotNil(cluster); - int8_t int8sArgument = 127; - [cluster writeAttributeInt8sWithValue:int8sArgument - responseHandler:^(NSError * err, NSDictionary * values) { - NSLog(@"Write attribute INT8S Max Value Error: %@", err); + [cluster on:^(NSError * err, NSDictionary * values) { + NSLog(@"Turn on light for color control tests Error: %@", err); - XCTAssertEqual(err.code, 0); + XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; + [expectation fulfill]; + }]; [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTestCluster_000052_ReadAttribute +- (void)testSendClusterTest_TC_CC_5_2_000001_ReadAttribute { - XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute INT8S Max Value"]; + XCTestExpectation * expectation = [self expectationWithDescription:@"Check on/off attribute value is true after on command"]; CHIPDevice * device = GetConnectedDevice(); dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; + CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:queue]; XCTAssertNotNil(cluster); - [cluster readAttributeInt8sWithResponseHandler:^(NSError * err, NSDictionary * values) { - NSLog(@"Read attribute INT8S Max Value Error: %@", err); + [cluster readAttributeOnOffWithResponseHandler:^(NSError * err, NSDictionary * values) { + NSLog(@"Check on/off attribute value is true after on command Error: %@", err); XCTAssertEqual(err.code, 0); - XCTAssertEqual([values[@"value"] charValue], 127); + XCTAssertEqual([values[@"value"] boolValue], 1); [expectation fulfill]; }]; [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTestCluster_000053_WriteAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Write attribute INT8S Min Value"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - int8_t int8sArgument = -128; - [cluster writeAttributeInt8sWithValue:int8sArgument - responseHandler:^(NSError * err, NSDictionary * values) { - NSLog(@"Write attribute INT8S Min Value Error: %@", err); - - XCTAssertEqual(err.code, 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestCluster_000054_ReadAttribute +- (void)testSendClusterTest_TC_CC_5_2_000002_MoveColor { - XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute INT8S Min Value"]; + XCTestExpectation * expectation = [self expectationWithDescription:@"Move Color command"]; CHIPDevice * device = GetConnectedDevice(); dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; + CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; XCTAssertNotNil(cluster); - [cluster readAttributeInt8sWithResponseHandler:^(NSError * err, NSDictionary * values) { - NSLog(@"Read attribute INT8S Min Value Error: %@", err); - - XCTAssertEqual(err.code, 0); + int16_t rateXArgument = 15; + int16_t rateYArgument = 20; + uint8_t optionsMaskArgument = 0; + uint8_t optionsOverrideArgument = 0; + [cluster moveColor:rateXArgument + rateY:rateYArgument + optionsMask:optionsMaskArgument + optionsOverride:optionsOverrideArgument + responseHandler:^(NSError * err, NSDictionary * values) { + NSLog(@"Move Color command Error: %@", err); - XCTAssertEqual([values[@"value"] charValue], -128); + XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; + [expectation fulfill]; + }]; [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTestCluster_000055_WriteAttribute +- (void)testSendClusterTest_TC_CC_5_2_000003_StopMoveStep { - XCTestExpectation * expectation = [self expectationWithDescription:@"Write attribute INT8S Default Value"]; + XCTestExpectation * expectation = [self expectationWithDescription:@"Stop Move Step command"]; CHIPDevice * device = GetConnectedDevice(); dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; + CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; XCTAssertNotNil(cluster); - int8_t int8sArgument = 0; - [cluster writeAttributeInt8sWithValue:int8sArgument - responseHandler:^(NSError * err, NSDictionary * values) { - NSLog(@"Write attribute INT8S Default Value Error: %@", err); + uint8_t optionsMaskArgument = 0; + uint8_t optionsOverrideArgument = 0; + [cluster stopMoveStep:optionsMaskArgument + optionsOverride:optionsOverrideArgument + responseHandler:^(NSError * err, NSDictionary * values) { + NSLog(@"Stop Move Step command Error: %@", err); - XCTAssertEqual(err.code, 0); + XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; + [expectation fulfill]; + }]; [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTestCluster_000056_ReadAttribute +- (void)testSendClusterTest_TC_CC_5_2_000004_Off { - XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute INT8S Default Value"]; + XCTestExpectation * expectation = [self expectationWithDescription:@"Turn off light that we turned on"]; CHIPDevice * device = GetConnectedDevice(); dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; + CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:queue]; XCTAssertNotNil(cluster); - [cluster readAttributeInt8sWithResponseHandler:^(NSError * err, NSDictionary * values) { - NSLog(@"Read attribute INT8S Default Value Error: %@", err); + [cluster off:^(NSError * err, NSDictionary * values) { + NSLog(@"Turn off light that we turned on Error: %@", err); XCTAssertEqual(err.code, 0); - XCTAssertEqual([values[@"value"] charValue], 0); - [expectation fulfill]; }]; [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTestCluster_000057_ReadAttribute +- (void)testSendClusterTest_TC_CC_5_2_000005_ReadAttribute { - XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute INT16S Default Value"]; + XCTestExpectation * expectation = [self expectationWithDescription:@"Check on/off attribute value is false after off command"]; CHIPDevice * device = GetConnectedDevice(); dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; + CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:queue]; XCTAssertNotNil(cluster); - [cluster readAttributeInt16sWithResponseHandler:^(NSError * err, NSDictionary * values) { - NSLog(@"Read attribute INT16S Default Value Error: %@", err); + [cluster readAttributeOnOffWithResponseHandler:^(NSError * err, NSDictionary * values) { + NSLog(@"Check on/off attribute value is false after off command Error: %@", err); XCTAssertEqual(err.code, 0); - XCTAssertEqual([values[@"value"] shortValue], 0); + XCTAssertEqual([values[@"value"] boolValue], 0); [expectation fulfill]; }]; [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTestCluster_000058_WriteAttribute + +- (void)testSendClusterTest_TC_CC_5_3_000000_On { - XCTestExpectation * expectation = [self expectationWithDescription:@"Write attribute INT16S Max Value"]; + XCTestExpectation * expectation = [self expectationWithDescription:@"Turn on light for color control tests"]; CHIPDevice * device = GetConnectedDevice(); dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; + CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:queue]; XCTAssertNotNil(cluster); - int16_t int16sArgument = 32767; - [cluster writeAttributeInt16sWithValue:int16sArgument - responseHandler:^(NSError * err, NSDictionary * values) { - NSLog(@"Write attribute INT16S Max Value Error: %@", err); + [cluster on:^(NSError * err, NSDictionary * values) { + NSLog(@"Turn on light for color control tests Error: %@", err); - XCTAssertEqual(err.code, 0); + XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; + [expectation fulfill]; + }]; [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTestCluster_000059_ReadAttribute +- (void)testSendClusterTest_TC_CC_5_3_000001_ReadAttribute { - XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute INT16S Max Value"]; + XCTestExpectation * expectation = [self expectationWithDescription:@"Check on/off attribute value is true after on command"]; CHIPDevice * device = GetConnectedDevice(); dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; + CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:queue]; XCTAssertNotNil(cluster); - [cluster readAttributeInt16sWithResponseHandler:^(NSError * err, NSDictionary * values) { - NSLog(@"Read attribute INT16S Max Value Error: %@", err); + [cluster readAttributeOnOffWithResponseHandler:^(NSError * err, NSDictionary * values) { + NSLog(@"Check on/off attribute value is true after on command Error: %@", err); XCTAssertEqual(err.code, 0); - XCTAssertEqual([values[@"value"] shortValue], 32767); + XCTAssertEqual([values[@"value"] boolValue], 1); [expectation fulfill]; }]; [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTestCluster_000060_WriteAttribute +- (void)testSendClusterTest_TC_CC_5_3_000002_StepColor { - XCTestExpectation * expectation = [self expectationWithDescription:@"Write attribute INT16S Min Value"]; + XCTestExpectation * expectation = [self expectationWithDescription:@"Step Color command"]; CHIPDevice * device = GetConnectedDevice(); dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; + CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; XCTAssertNotNil(cluster); - int16_t int16sArgument = -32768; - [cluster writeAttributeInt16sWithValue:int16sArgument - responseHandler:^(NSError * err, NSDictionary * values) { - NSLog(@"Write attribute INT16S Min Value Error: %@", err); + int16_t stepXArgument = 15; + int16_t stepYArgument = 20; + uint16_t transitionTimeArgument = 50U; + uint8_t optionsMaskArgument = 0; + uint8_t optionsOverrideArgument = 0; + [cluster stepColor:stepXArgument + stepY:stepYArgument + transitionTime:transitionTimeArgument + optionsMask:optionsMaskArgument + optionsOverride:optionsOverrideArgument + responseHandler:^(NSError * err, NSDictionary * values) { + NSLog(@"Step Color command Error: %@", err); - XCTAssertEqual(err.code, 0); + XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; + [expectation fulfill]; + }]; [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTestCluster_000061_ReadAttribute +- (void)testSendClusterTest_TC_CC_5_3_000003_Off { - XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute INT16S Min Value"]; + XCTestExpectation * expectation = [self expectationWithDescription:@"Turn off light that we turned on"]; CHIPDevice * device = GetConnectedDevice(); dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; + CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:queue]; XCTAssertNotNil(cluster); - [cluster readAttributeInt16sWithResponseHandler:^(NSError * err, NSDictionary * values) { - NSLog(@"Read attribute INT16S Min Value Error: %@", err); + [cluster off:^(NSError * err, NSDictionary * values) { + NSLog(@"Turn off light that we turned on Error: %@", err); XCTAssertEqual(err.code, 0); - XCTAssertEqual([values[@"value"] shortValue], -32768); - [expectation fulfill]; }]; [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTestCluster_000062_WriteAttribute +- (void)testSendClusterTest_TC_CC_5_3_000004_ReadAttribute { - XCTestExpectation * expectation = [self expectationWithDescription:@"Write attribute INT16S Default Value"]; + XCTestExpectation * expectation = [self expectationWithDescription:@"Check on/off attribute value is false after off command"]; CHIPDevice * device = GetConnectedDevice(); dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; + CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:queue]; XCTAssertNotNil(cluster); - int16_t int16sArgument = 0; - [cluster writeAttributeInt16sWithValue:int16sArgument - responseHandler:^(NSError * err, NSDictionary * values) { - NSLog(@"Write attribute INT16S Default Value Error: %@", err); + [cluster readAttributeOnOffWithResponseHandler:^(NSError * err, NSDictionary * values) { + NSLog(@"Check on/off attribute value is false after off command Error: %@", err); - XCTAssertEqual(err.code, 0); + XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; + XCTAssertEqual([values[@"value"] boolValue], 0); + + [expectation fulfill]; + }]; [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTestCluster_000063_ReadAttribute + +- (void)testSendClusterTest_TC_CC_6_1_000000_On { - XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute INT16S Default Value"]; + XCTestExpectation * expectation = [self expectationWithDescription:@"Turn on light for color control tests"]; CHIPDevice * device = GetConnectedDevice(); dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; + CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:queue]; XCTAssertNotNil(cluster); - [cluster readAttributeInt16sWithResponseHandler:^(NSError * err, NSDictionary * values) { - NSLog(@"Read attribute INT16S Default Value Error: %@", err); + [cluster on:^(NSError * err, NSDictionary * values) { + NSLog(@"Turn on light for color control tests Error: %@", err); XCTAssertEqual(err.code, 0); - XCTAssertEqual([values[@"value"] shortValue], 0); - [expectation fulfill]; }]; [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTestCluster_000064_ReadAttribute +- (void)testSendClusterTest_TC_CC_6_1_000001_ReadAttribute { - XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute INT32S Default Value"]; + XCTestExpectation * expectation = [self expectationWithDescription:@"Check on/off attribute value is true after on command"]; CHIPDevice * device = GetConnectedDevice(); dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; + CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:queue]; XCTAssertNotNil(cluster); - [cluster readAttributeInt32sWithResponseHandler:^(NSError * err, NSDictionary * values) { - NSLog(@"Read attribute INT32S Default Value Error: %@", err); + [cluster readAttributeOnOffWithResponseHandler:^(NSError * err, NSDictionary * values) { + NSLog(@"Check on/off attribute value is true after on command Error: %@", err); XCTAssertEqual(err.code, 0); - XCTAssertEqual([values[@"value"] longValue], 0L); + XCTAssertEqual([values[@"value"] boolValue], 1); [expectation fulfill]; }]; [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTestCluster_000065_WriteAttribute +- (void)testSendClusterTest_TC_CC_6_1_000002_MoveToColorTemperature { - XCTestExpectation * expectation = [self expectationWithDescription:@"Write attribute INT32S Max Value"]; + XCTestExpectation * expectation = [self expectationWithDescription:@"Move To Color Temperature command"]; CHIPDevice * device = GetConnectedDevice(); dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; + CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; XCTAssertNotNil(cluster); - int32_t int32sArgument = 2147483647L; - [cluster writeAttributeInt32sWithValue:int32sArgument - responseHandler:^(NSError * err, NSDictionary * values) { - NSLog(@"Write attribute INT32S Max Value Error: %@", err); + uint16_t colorTemperatureArgument = 100U; + uint16_t transitionTimeArgument = 10U; + uint8_t optionsMaskArgument = 0; + uint8_t optionsOverrideArgument = 0; + [cluster moveToColorTemperature:colorTemperatureArgument + transitionTime:transitionTimeArgument + optionsMask:optionsMaskArgument + optionsOverride:optionsOverrideArgument + responseHandler:^(NSError * err, NSDictionary * values) { + NSLog(@"Move To Color Temperature command Error: %@", err); - XCTAssertEqual(err.code, 0); + XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; + [expectation fulfill]; + }]; [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTestCluster_000066_ReadAttribute +- (void)testSendClusterTest_TC_CC_6_1_000003_Off { - XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute INT32S Max Value"]; + XCTestExpectation * expectation = [self expectationWithDescription:@"Turn off light that we turned on"]; CHIPDevice * device = GetConnectedDevice(); dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; + CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:queue]; XCTAssertNotNil(cluster); - [cluster readAttributeInt32sWithResponseHandler:^(NSError * err, NSDictionary * values) { - NSLog(@"Read attribute INT32S Max Value Error: %@", err); + [cluster off:^(NSError * err, NSDictionary * values) { + NSLog(@"Turn off light that we turned on Error: %@", err); XCTAssertEqual(err.code, 0); - XCTAssertEqual([values[@"value"] longValue], 2147483647L); - [expectation fulfill]; }]; [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTestCluster_000067_WriteAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Write attribute INT32S Min Value"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - int32_t int32sArgument = -2147483648L; - [cluster writeAttributeInt32sWithValue:int32sArgument - responseHandler:^(NSError * err, NSDictionary * values) { - NSLog(@"Write attribute INT32S Min Value Error: %@", err); - - XCTAssertEqual(err.code, 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestCluster_000068_ReadAttribute +- (void)testSendClusterTest_TC_CC_6_1_000004_ReadAttribute { - XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute INT32S Min Value"]; + XCTestExpectation * expectation = [self expectationWithDescription:@"Check on/off attribute value is false after off command"]; CHIPDevice * device = GetConnectedDevice(); dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; + CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:queue]; XCTAssertNotNil(cluster); - [cluster readAttributeInt32sWithResponseHandler:^(NSError * err, NSDictionary * values) { - NSLog(@"Read attribute INT32S Min Value Error: %@", err); + [cluster readAttributeOnOffWithResponseHandler:^(NSError * err, NSDictionary * values) { + NSLog(@"Check on/off attribute value is false after off command Error: %@", err); XCTAssertEqual(err.code, 0); - XCTAssertEqual([values[@"value"] longValue], -2147483648L); + XCTAssertEqual([values[@"value"] boolValue], 0); [expectation fulfill]; }]; [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTestCluster_000069_WriteAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Write attribute INT32S Default Value"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - int32_t int32sArgument = 0L; - [cluster writeAttributeInt32sWithValue:int32sArgument - responseHandler:^(NSError * err, NSDictionary * values) { - NSLog(@"Write attribute INT32S Default Value Error: %@", err); - - XCTAssertEqual(err.code, 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestCluster_000070_ReadAttribute +- (void)testSendClusterTest_TC_CC_6_2_000000_On { - XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute INT32S Default Value"]; + XCTestExpectation * expectation = [self expectationWithDescription:@"Turn on light for color control tests"]; CHIPDevice * device = GetConnectedDevice(); dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; + CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:queue]; XCTAssertNotNil(cluster); - [cluster readAttributeInt32sWithResponseHandler:^(NSError * err, NSDictionary * values) { - NSLog(@"Read attribute INT32S Default Value Error: %@", err); + [cluster on:^(NSError * err, NSDictionary * values) { + NSLog(@"Turn on light for color control tests Error: %@", err); XCTAssertEqual(err.code, 0); - XCTAssertEqual([values[@"value"] longValue], 0L); - [expectation fulfill]; }]; [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTestCluster_000071_ReadAttribute +- (void)testSendClusterTest_TC_CC_6_2_000001_ReadAttribute { - XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute INT64S Default Value"]; + XCTestExpectation * expectation = [self expectationWithDescription:@"Check on/off attribute value is true after on command"]; CHIPDevice * device = GetConnectedDevice(); dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; + CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:queue]; XCTAssertNotNil(cluster); - [cluster readAttributeInt64sWithResponseHandler:^(NSError * err, NSDictionary * values) { - NSLog(@"Read attribute INT64S Default Value Error: %@", err); + [cluster readAttributeOnOffWithResponseHandler:^(NSError * err, NSDictionary * values) { + NSLog(@"Check on/off attribute value is true after on command Error: %@", err); XCTAssertEqual(err.code, 0); - XCTAssertEqual([values[@"value"] longLongValue], 0LL); + XCTAssertEqual([values[@"value"] boolValue], 1); [expectation fulfill]; }]; [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTestCluster_000072_WriteAttribute +- (void)testSendClusterTest_TC_CC_6_2_000002_MoveColorTemperature { - XCTestExpectation * expectation = [self expectationWithDescription:@"Write attribute INT64S Max Value"]; + XCTestExpectation * expectation = [self expectationWithDescription:@"Move up color temperature command"]; CHIPDevice * device = GetConnectedDevice(); dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; + CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; XCTAssertNotNil(cluster); - int64_t int64sArgument = 9223372036854775807LL; - [cluster writeAttributeInt64sWithValue:int64sArgument - responseHandler:^(NSError * err, NSDictionary * values) { - NSLog(@"Write attribute INT64S Max Value Error: %@", err); + uint8_t moveModeArgument = 1; + uint16_t rateArgument = 10U; + uint16_t colorTemperatureMinimumArgument = 1U; + uint16_t colorTemperatureMaximumArgument = 255U; + uint8_t optionsMaskArgument = 0; + uint8_t optionsOverrideArgument = 0; + [cluster moveColorTemperature:moveModeArgument + rate:rateArgument + colorTemperatureMinimum:colorTemperatureMinimumArgument + colorTemperatureMaximum:colorTemperatureMaximumArgument + optionsMask:optionsMaskArgument + optionsOverride:optionsOverrideArgument + responseHandler:^(NSError * err, NSDictionary * values) { + NSLog(@"Move up color temperature command Error: %@", err); - XCTAssertEqual(err.code, 0); + XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; + [expectation fulfill]; + }]; [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTestCluster_000073_ReadAttribute +- (void)testSendClusterTest_TC_CC_6_2_000003_MoveColorTemperature { - XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute INT64S Max Value"]; + XCTestExpectation * expectation = [self expectationWithDescription:@"Stop Color Temperature command"]; CHIPDevice * device = GetConnectedDevice(); dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; + CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; XCTAssertNotNil(cluster); - [cluster readAttributeInt64sWithResponseHandler:^(NSError * err, NSDictionary * values) { - NSLog(@"Read attribute INT64S Max Value Error: %@", err); - - XCTAssertEqual(err.code, 0); + uint8_t moveModeArgument = 0; + uint16_t rateArgument = 10U; + uint16_t colorTemperatureMinimumArgument = 1U; + uint16_t colorTemperatureMaximumArgument = 255U; + uint8_t optionsMaskArgument = 0; + uint8_t optionsOverrideArgument = 0; + [cluster moveColorTemperature:moveModeArgument + rate:rateArgument + colorTemperatureMinimum:colorTemperatureMinimumArgument + colorTemperatureMaximum:colorTemperatureMaximumArgument + optionsMask:optionsMaskArgument + optionsOverride:optionsOverrideArgument + responseHandler:^(NSError * err, NSDictionary * values) { + NSLog(@"Stop Color Temperature command Error: %@", err); - XCTAssertEqual([values[@"value"] longLongValue], 9223372036854775807LL); + XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; + [expectation fulfill]; + }]; [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTestCluster_000074_WriteAttribute +- (void)testSendClusterTest_TC_CC_6_2_000004_MoveColorTemperature { - XCTestExpectation * expectation = [self expectationWithDescription:@"Write attribute INT64S Min Value"]; + XCTestExpectation * expectation = [self expectationWithDescription:@"Move down color temperature command"]; CHIPDevice * device = GetConnectedDevice(); dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; + CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; XCTAssertNotNil(cluster); - int64_t int64sArgument = -9223372036854775807LL; - [cluster writeAttributeInt64sWithValue:int64sArgument - responseHandler:^(NSError * err, NSDictionary * values) { - NSLog(@"Write attribute INT64S Min Value Error: %@", err); + uint8_t moveModeArgument = 3; + uint16_t rateArgument = 20U; + uint16_t colorTemperatureMinimumArgument = 1U; + uint16_t colorTemperatureMaximumArgument = 255U; + uint8_t optionsMaskArgument = 0; + uint8_t optionsOverrideArgument = 0; + [cluster moveColorTemperature:moveModeArgument + rate:rateArgument + colorTemperatureMinimum:colorTemperatureMinimumArgument + colorTemperatureMaximum:colorTemperatureMaximumArgument + optionsMask:optionsMaskArgument + optionsOverride:optionsOverrideArgument + responseHandler:^(NSError * err, NSDictionary * values) { + NSLog(@"Move down color temperature command Error: %@", err); - XCTAssertEqual(err.code, 0); + XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; + [expectation fulfill]; + }]; [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTestCluster_000075_ReadAttribute +- (void)testSendClusterTest_TC_CC_6_2_000005_Off { - XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute INT64S Min Value"]; + XCTestExpectation * expectation = [self expectationWithDescription:@"Turn off light that we turned on"]; CHIPDevice * device = GetConnectedDevice(); dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; + CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:queue]; XCTAssertNotNil(cluster); - [cluster readAttributeInt64sWithResponseHandler:^(NSError * err, NSDictionary * values) { - NSLog(@"Read attribute INT64S Min Value Error: %@", err); + [cluster off:^(NSError * err, NSDictionary * values) { + NSLog(@"Turn off light that we turned on Error: %@", err); XCTAssertEqual(err.code, 0); - XCTAssertEqual([values[@"value"] longLongValue], -9223372036854775807LL); - [expectation fulfill]; }]; [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTestCluster_000076_WriteAttribute +- (void)testSendClusterTest_TC_CC_6_2_000006_ReadAttribute { - XCTestExpectation * expectation = [self expectationWithDescription:@"Write attribute INT64S Default Value"]; + XCTestExpectation * expectation = [self expectationWithDescription:@"Check on/off attribute value is false after off command"]; CHIPDevice * device = GetConnectedDevice(); dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; + CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:queue]; XCTAssertNotNil(cluster); - int64_t int64sArgument = 0LL; - [cluster writeAttributeInt64sWithValue:int64sArgument - responseHandler:^(NSError * err, NSDictionary * values) { - NSLog(@"Write attribute INT64S Default Value Error: %@", err); + [cluster readAttributeOnOffWithResponseHandler:^(NSError * err, NSDictionary * values) { + NSLog(@"Check on/off attribute value is false after off command Error: %@", err); - XCTAssertEqual(err.code, 0); + XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; + XCTAssertEqual([values[@"value"] boolValue], 0); + + [expectation fulfill]; + }]; [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTestCluster_000077_ReadAttribute + +- (void)testSendClusterTest_TC_CC_6_3_000000_On { - XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute INT64S Default Value"]; + XCTestExpectation * expectation = [self expectationWithDescription:@"Turn on light for color control tests"]; CHIPDevice * device = GetConnectedDevice(); dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; + CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:queue]; XCTAssertNotNil(cluster); - [cluster readAttributeInt64sWithResponseHandler:^(NSError * err, NSDictionary * values) { - NSLog(@"Read attribute INT64S Default Value Error: %@", err); + [cluster on:^(NSError * err, NSDictionary * values) { + NSLog(@"Turn on light for color control tests Error: %@", err); XCTAssertEqual(err.code, 0); - XCTAssertEqual([values[@"value"] longLongValue], 0LL); - [expectation fulfill]; }]; [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTestCluster_000078_ReadAttribute +- (void)testSendClusterTest_TC_CC_6_3_000001_ReadAttribute { - XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute ENUM8 Default Value"]; + XCTestExpectation * expectation = [self expectationWithDescription:@"Check on/off attribute value is true after on command"]; CHIPDevice * device = GetConnectedDevice(); dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; + CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:queue]; XCTAssertNotNil(cluster); - [cluster readAttributeEnum8WithResponseHandler:^(NSError * err, NSDictionary * values) { - NSLog(@"Read attribute ENUM8 Default Value Error: %@", err); + [cluster readAttributeOnOffWithResponseHandler:^(NSError * err, NSDictionary * values) { + NSLog(@"Check on/off attribute value is true after on command Error: %@", err); XCTAssertEqual(err.code, 0); - XCTAssertEqual([values[@"value"] unsignedCharValue], 0); + XCTAssertEqual([values[@"value"] boolValue], 1); [expectation fulfill]; }]; [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTestCluster_000079_WriteAttribute +- (void)testSendClusterTest_TC_CC_6_3_000002_StepColorTemperature { - XCTestExpectation * expectation = [self expectationWithDescription:@"Write attribute ENUM8 Max Value"]; + XCTestExpectation * expectation = [self expectationWithDescription:@"Step up color temperature command"]; CHIPDevice * device = GetConnectedDevice(); dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; + CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; XCTAssertNotNil(cluster); - uint8_t enum8Argument = 255; - [cluster writeAttributeEnum8WithValue:enum8Argument - responseHandler:^(NSError * err, NSDictionary * values) { - NSLog(@"Write attribute ENUM8 Max Value Error: %@", err); - - XCTAssertEqual(err.code, 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestCluster_000080_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute ENUM8 Max Value"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeEnum8WithResponseHandler:^(NSError * err, NSDictionary * values) { - NSLog(@"Read attribute ENUM8 Max Value Error: %@", err); - - XCTAssertEqual(err.code, 0); + 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; + [cluster stepColorTemperature:stepModeArgument + stepSize:stepSizeArgument + transitionTime:transitionTimeArgument + colorTemperatureMinimum:colorTemperatureMinimumArgument + colorTemperatureMaximum:colorTemperatureMaximumArgument + optionsMask:optionsMaskArgument + optionsOverride:optionsOverrideArgument + responseHandler:^(NSError * err, NSDictionary * values) { + NSLog(@"Step up color temperature command Error: %@", err); - XCTAssertEqual([values[@"value"] unsignedCharValue], 255); + XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; + [expectation fulfill]; + }]; [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTestCluster_000081_WriteAttribute +- (void)testSendClusterTest_TC_CC_6_3_000003_StepColorTemperature { - XCTestExpectation * expectation = [self expectationWithDescription:@"Write attribute ENUM8 Min Value"]; + XCTestExpectation * expectation = [self expectationWithDescription:@"Step down color temperature command"]; CHIPDevice * device = GetConnectedDevice(); dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; + CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; XCTAssertNotNil(cluster); - uint8_t enum8Argument = 0; - [cluster writeAttributeEnum8WithValue:enum8Argument - responseHandler:^(NSError * err, NSDictionary * values) { - NSLog(@"Write attribute ENUM8 Min Value Error: %@", err); + 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; + [cluster stepColorTemperature:stepModeArgument + stepSize:stepSizeArgument + transitionTime:transitionTimeArgument + colorTemperatureMinimum:colorTemperatureMinimumArgument + colorTemperatureMaximum:colorTemperatureMaximumArgument + optionsMask:optionsMaskArgument + optionsOverride:optionsOverrideArgument + responseHandler:^(NSError * err, NSDictionary * values) { + NSLog(@"Step down color temperature command Error: %@", err); - XCTAssertEqual(err.code, 0); + XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; + [expectation fulfill]; + }]; [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTestCluster_000082_ReadAttribute +- (void)testSendClusterTest_TC_CC_6_3_000004_Off { - XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute ENUM8 Min Value"]; + XCTestExpectation * expectation = [self expectationWithDescription:@"Turn off light that we turned on"]; CHIPDevice * device = GetConnectedDevice(); dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; + CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:queue]; XCTAssertNotNil(cluster); - [cluster readAttributeEnum8WithResponseHandler:^(NSError * err, NSDictionary * values) { - NSLog(@"Read attribute ENUM8 Min Value Error: %@", err); + [cluster off:^(NSError * err, NSDictionary * values) { + NSLog(@"Turn off light that we turned on Error: %@", err); XCTAssertEqual(err.code, 0); - XCTAssertEqual([values[@"value"] unsignedCharValue], 0); - [expectation fulfill]; }]; [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTestCluster_000083_ReadAttribute +- (void)testSendClusterTest_TC_CC_6_3_000005_ReadAttribute { - XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute ENUM16 Default Value"]; + XCTestExpectation * expectation = [self expectationWithDescription:@"Check on/off attribute value is false after off command"]; CHIPDevice * device = GetConnectedDevice(); dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; + CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:queue]; XCTAssertNotNil(cluster); - [cluster readAttributeEnum16WithResponseHandler:^(NSError * err, NSDictionary * values) { - NSLog(@"Read attribute ENUM16 Default Value Error: %@", err); + [cluster readAttributeOnOffWithResponseHandler:^(NSError * err, NSDictionary * values) { + NSLog(@"Check on/off attribute value is false after off command Error: %@", err); XCTAssertEqual(err.code, 0); - XCTAssertEqual([values[@"value"] unsignedShortValue], 0U); + XCTAssertEqual([values[@"value"] boolValue], 0); [expectation fulfill]; }]; [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTestCluster_000084_WriteAttribute + +- (void)testSendClusterTest_TC_CC_7_1_000000_On { - XCTestExpectation * expectation = [self expectationWithDescription:@"Write attribute ENUM16 Max Value"]; + XCTestExpectation * expectation = [self expectationWithDescription:@"Turn on light for color control tests"]; CHIPDevice * device = GetConnectedDevice(); dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; + CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:queue]; XCTAssertNotNil(cluster); - uint16_t enum16Argument = 65535U; - [cluster writeAttributeEnum16WithValue:enum16Argument - responseHandler:^(NSError * err, NSDictionary * values) { - NSLog(@"Write attribute ENUM16 Max Value Error: %@", err); + [cluster on:^(NSError * err, NSDictionary * values) { + NSLog(@"Turn on light for color control tests Error: %@", err); - XCTAssertEqual(err.code, 0); + XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; + [expectation fulfill]; + }]; [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTestCluster_000085_ReadAttribute +- (void)testSendClusterTest_TC_CC_7_1_000001_ReadAttribute { - XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute ENUM16 Max Value"]; + XCTestExpectation * expectation = [self expectationWithDescription:@"Check on/off attribute value is true after on command"]; CHIPDevice * device = GetConnectedDevice(); dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; + CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:queue]; XCTAssertNotNil(cluster); - [cluster readAttributeEnum16WithResponseHandler:^(NSError * err, NSDictionary * values) { - NSLog(@"Read attribute ENUM16 Max Value Error: %@", err); + [cluster readAttributeOnOffWithResponseHandler:^(NSError * err, NSDictionary * values) { + NSLog(@"Check on/off attribute value is true after on command Error: %@", err); XCTAssertEqual(err.code, 0); - XCTAssertEqual([values[@"value"] unsignedShortValue], 65535U); + XCTAssertEqual([values[@"value"] boolValue], 1); [expectation fulfill]; }]; [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTestCluster_000086_WriteAttribute +- (void)testSendClusterTest_TC_CC_7_1_000002_EnhancedMoveToHue { - XCTestExpectation * expectation = [self expectationWithDescription:@"Write attribute ENUM16 Min Value"]; + XCTestExpectation * expectation = [self expectationWithDescription:@"Enhanced Move To Hue command"]; CHIPDevice * device = GetConnectedDevice(); dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; + CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; XCTAssertNotNil(cluster); - uint16_t enum16Argument = 0U; - [cluster writeAttributeEnum16WithValue:enum16Argument - responseHandler:^(NSError * err, NSDictionary * values) { - NSLog(@"Write attribute ENUM16 Min Value Error: %@", err); + uint16_t enhancedHueArgument = 1025U; + uint8_t directionArgument = 0; + uint16_t transitionTimeArgument = 1U; + uint8_t optionsMaskArgument = 0; + uint8_t optionsOverrideArgument = 0; + [cluster enhancedMoveToHue:enhancedHueArgument + direction:directionArgument + transitionTime:transitionTimeArgument + optionsMask:optionsMaskArgument + optionsOverride:optionsOverrideArgument + responseHandler:^(NSError * err, NSDictionary * values) { + NSLog(@"Enhanced Move To Hue command Error: %@", err); - XCTAssertEqual(err.code, 0); + XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; + [expectation fulfill]; + }]; [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTestCluster_000087_ReadAttribute +- (void)testSendClusterTest_TC_CC_7_1_000003_ReadAttribute { - XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute ENUM16 Min Value"]; + XCTestExpectation * expectation = + [self expectationWithDescription:@"Check Remaining time attribute value matched the value sent by the last command"]; CHIPDevice * device = GetConnectedDevice(); dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; + CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; XCTAssertNotNil(cluster); - [cluster readAttributeEnum16WithResponseHandler:^(NSError * err, NSDictionary * values) { - NSLog(@"Read attribute ENUM16 Min Value Error: %@", err); + [cluster readAttributeRemainingTimeWithResponseHandler:^(NSError * err, NSDictionary * values) { + NSLog(@"Check Remaining time attribute value matched the value sent by the last command Error: %@", err); XCTAssertEqual(err.code, 0); - XCTAssertEqual([values[@"value"] unsignedShortValue], 0U); + XCTAssertEqual([values[@"value"] unsignedShortValue], 1U); [expectation fulfill]; }]; [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTestCluster_000088_ReadAttribute +- (void)testSendClusterTest_TC_CC_7_1_000004_Off { - XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute OCTET_STRING Default Value"]; + XCTestExpectation * expectation = [self expectationWithDescription:@"Turn off light that we turned on"]; CHIPDevice * device = GetConnectedDevice(); dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; + CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:queue]; XCTAssertNotNil(cluster); - [cluster readAttributeOctetStringWithResponseHandler:^(NSError * err, NSDictionary * values) { - NSLog(@"Read attribute OCTET_STRING Default Value Error: %@", err); + [cluster off:^(NSError * err, NSDictionary * values) { + NSLog(@"Turn off light that we turned on Error: %@", err); XCTAssertEqual(err.code, 0); - NSString * octetStringArgumentString = @""; - NSData * octetStringArgument = [octetStringArgumentString dataUsingEncoding:NSUTF8StringEncoding]; - XCTAssertTrue([values[@"value"] isEqualToData:octetStringArgument]); - [expectation fulfill]; }]; [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTestCluster_000089_WriteAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Write attribute OCTET_STRING"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - NSString * octetStringArgumentString = @"TestValue"; - NSData * octetStringArgument = [octetStringArgumentString dataUsingEncoding:NSUTF8StringEncoding]; - [cluster writeAttributeOctetStringWithValue:octetStringArgument - responseHandler:^(NSError * err, NSDictionary * values) { - NSLog(@"Write attribute OCTET_STRING Error: %@", err); - - XCTAssertEqual(err.code, 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestCluster_000090_ReadAttribute +- (void)testSendClusterTest_TC_CC_7_1_000005_ReadAttribute { - XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute OCTET_STRING"]; + XCTestExpectation * expectation = [self expectationWithDescription:@"Check on/off attribute value is false after off command"]; CHIPDevice * device = GetConnectedDevice(); dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; + CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:queue]; XCTAssertNotNil(cluster); - [cluster readAttributeOctetStringWithResponseHandler:^(NSError * err, NSDictionary * values) { - NSLog(@"Read attribute OCTET_STRING Error: %@", err); + [cluster readAttributeOnOffWithResponseHandler:^(NSError * err, NSDictionary * values) { + NSLog(@"Check on/off attribute value is false after off command Error: %@", err); XCTAssertEqual(err.code, 0); - NSString * octetStringArgumentString = @"TestValue"; - NSData * octetStringArgument = [octetStringArgumentString dataUsingEncoding:NSUTF8StringEncoding]; - XCTAssertTrue([values[@"value"] isEqualToData:octetStringArgument]); + XCTAssertEqual([values[@"value"] boolValue], 0); [expectation fulfill]; }]; [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTestCluster_000091_WriteAttribute + +- (void)testSendClusterTest_TC_CC_7_2_000000_On { - XCTestExpectation * expectation = [self expectationWithDescription:@"Write attribute OCTET_STRING"]; + XCTestExpectation * expectation = [self expectationWithDescription:@"Turn on light for color control tests"]; CHIPDevice * device = GetConnectedDevice(); dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; + CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:queue]; XCTAssertNotNil(cluster); - NSString * octetStringArgumentString = @"TestValueLongerThan10"; - NSData * octetStringArgument = [octetStringArgumentString dataUsingEncoding:NSUTF8StringEncoding]; - [cluster writeAttributeOctetStringWithValue:octetStringArgument - responseHandler:^(NSError * err, NSDictionary * values) { - NSLog(@"Write attribute OCTET_STRING Error: %@", err); + [cluster on:^(NSError * err, NSDictionary * values) { + NSLog(@"Turn on light for color control tests Error: %@", err); - XCTAssertEqual(err.code, true); - [expectation fulfill]; - }]; + XCTAssertEqual(err.code, 0); + + [expectation fulfill]; + }]; [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTestCluster_000092_ReadAttribute +- (void)testSendClusterTest_TC_CC_7_2_000001_ReadAttribute { - XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute OCTET_STRING"]; + XCTestExpectation * expectation = [self expectationWithDescription:@"Check on/off attribute value is true after on command"]; CHIPDevice * device = GetConnectedDevice(); dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; + CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:queue]; XCTAssertNotNil(cluster); - [cluster readAttributeOctetStringWithResponseHandler:^(NSError * err, NSDictionary * values) { - NSLog(@"Read attribute OCTET_STRING Error: %@", err); + [cluster readAttributeOnOffWithResponseHandler:^(NSError * err, NSDictionary * values) { + NSLog(@"Check on/off attribute value is true after on command Error: %@", err); XCTAssertEqual(err.code, 0); - NSString * octetStringArgumentString = @"TestValue"; - NSData * octetStringArgument = [octetStringArgumentString dataUsingEncoding:NSUTF8StringEncoding]; - XCTAssertTrue([values[@"value"] isEqualToData:octetStringArgument]); + XCTAssertEqual([values[@"value"] boolValue], 1); [expectation fulfill]; }]; [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTestCluster_000093_WriteAttribute +- (void)testSendClusterTest_TC_CC_7_2_000002_EnhancedMoveHue { - XCTestExpectation * expectation = [self expectationWithDescription:@"Write attribute OCTET_STRING"]; + XCTestExpectation * expectation = [self expectationWithDescription:@"Enhanced Move Hue Down command "]; CHIPDevice * device = GetConnectedDevice(); dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; + CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; XCTAssertNotNil(cluster); - NSString * octetStringArgumentString = @""; - NSData * octetStringArgument = [octetStringArgumentString dataUsingEncoding:NSUTF8StringEncoding]; - [cluster writeAttributeOctetStringWithValue:octetStringArgument - responseHandler:^(NSError * err, NSDictionary * values) { - NSLog(@"Write attribute OCTET_STRING Error: %@", err); - - XCTAssertEqual(err.code, 0); - - [expectation fulfill]; - }]; + uint8_t moveModeArgument = 3; + uint16_t rateArgument = 5U; + uint8_t optionsMaskArgument = 0; + uint8_t optionsOverrideArgument = 0; + [cluster enhancedMoveHue:moveModeArgument + rate:rateArgument + optionsMask:optionsMaskArgument + optionsOverride:optionsOverrideArgument + responseHandler:^(NSError * err, NSDictionary * values) { + NSLog(@"Enhanced Move Hue Down command Error: %@", err); + + XCTAssertEqual(err.code, 0); + + [expectation fulfill]; + }]; [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTestCluster_000094_ReadAttribute +- (void)testSendClusterTest_TC_CC_7_2_000003_EnhancedMoveHue { - XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute LONG_OCTET_STRING Default Value"]; + XCTestExpectation * expectation = [self expectationWithDescription:@"Enhanced Move Hue Stop command"]; CHIPDevice * device = GetConnectedDevice(); dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; + CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; XCTAssertNotNil(cluster); - [cluster readAttributeLongOctetStringWithResponseHandler:^(NSError * err, NSDictionary * values) { - NSLog(@"Read attribute LONG_OCTET_STRING Default Value Error: %@", err); - - XCTAssertEqual(err.code, 0); + uint8_t moveModeArgument = 0; + uint16_t rateArgument = 0U; + uint8_t optionsMaskArgument = 0; + uint8_t optionsOverrideArgument = 0; + [cluster enhancedMoveHue:moveModeArgument + rate:rateArgument + optionsMask:optionsMaskArgument + optionsOverride:optionsOverrideArgument + responseHandler:^(NSError * err, NSDictionary * values) { + NSLog(@"Enhanced Move Hue Stop command Error: %@", err); - NSString * longOctetStringArgumentString = @""; - NSData * longOctetStringArgument = [longOctetStringArgumentString dataUsingEncoding:NSUTF8StringEncoding]; - XCTAssertTrue([values[@"value"] isEqualToData:longOctetStringArgument]); + XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; + [expectation fulfill]; + }]; [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTestCluster_000095_WriteAttribute +- (void)testSendClusterTest_TC_CC_7_2_000004_EnhancedMoveHue { - XCTestExpectation * expectation = [self expectationWithDescription:@"Write attribute LONG_OCTET_STRING"]; + XCTestExpectation * expectation = [self expectationWithDescription:@"Enhanced Move Hue Up command"]; CHIPDevice * device = GetConnectedDevice(); dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; + CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; XCTAssertNotNil(cluster); - NSString * longOctetStringArgumentString - = @"11111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111" - @"11111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111" - @"11111111111111111111111111111111111111111111111111111111111111"; - NSData * longOctetStringArgument = [longOctetStringArgumentString dataUsingEncoding:NSUTF8StringEncoding]; - [cluster writeAttributeLongOctetStringWithValue:longOctetStringArgument - responseHandler:^(NSError * err, NSDictionary * values) { - NSLog(@"Write attribute LONG_OCTET_STRING Error: %@", err); + uint8_t moveModeArgument = 1; + uint16_t rateArgument = 50U; + uint8_t optionsMaskArgument = 0; + uint8_t optionsOverrideArgument = 0; + [cluster enhancedMoveHue:moveModeArgument + rate:rateArgument + optionsMask:optionsMaskArgument + optionsOverride:optionsOverrideArgument + responseHandler:^(NSError * err, NSDictionary * values) { + NSLog(@"Enhanced Move Hue Up command Error: %@", err); - XCTAssertEqual(err.code, 0); + XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; + [expectation fulfill]; + }]; [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTestCluster_000096_ReadAttribute +- (void)testSendClusterTest_TC_CC_7_2_000005_EnhancedMoveHue { - XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute LONG_OCTET_STRING"]; + XCTestExpectation * expectation = [self expectationWithDescription:@"Enhanced Move Hue Stop command"]; CHIPDevice * device = GetConnectedDevice(); dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; + CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; XCTAssertNotNil(cluster); - [cluster readAttributeLongOctetStringWithResponseHandler:^(NSError * err, NSDictionary * values) { - NSLog(@"Read attribute LONG_OCTET_STRING Error: %@", err); - - XCTAssertEqual(err.code, 0); + uint8_t moveModeArgument = 0; + uint16_t rateArgument = 0U; + uint8_t optionsMaskArgument = 0; + uint8_t optionsOverrideArgument = 0; + [cluster enhancedMoveHue:moveModeArgument + rate:rateArgument + optionsMask:optionsMaskArgument + optionsOverride:optionsOverrideArgument + responseHandler:^(NSError * err, NSDictionary * values) { + NSLog(@"Enhanced Move Hue Stop command Error: %@", err); - NSString * longOctetStringArgumentString - = @"1111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111" - @"1111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111" - @"1111111111111111111111111111111111111111111111111111111111111111111111"; - NSData * longOctetStringArgument = [longOctetStringArgumentString dataUsingEncoding:NSUTF8StringEncoding]; - XCTAssertTrue([values[@"value"] isEqualToData:longOctetStringArgument]); + XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; + [expectation fulfill]; + }]; [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTestCluster_000097_WriteAttribute +- (void)testSendClusterTest_TC_CC_7_2_000006_Off { - XCTestExpectation * expectation = [self expectationWithDescription:@"Write attribute LONG_OCTET_STRING"]; + XCTestExpectation * expectation = [self expectationWithDescription:@"Turn off light that we turned on"]; CHIPDevice * device = GetConnectedDevice(); dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; + CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:queue]; XCTAssertNotNil(cluster); - NSString * longOctetStringArgumentString = @""; - NSData * longOctetStringArgument = [longOctetStringArgumentString dataUsingEncoding:NSUTF8StringEncoding]; - [cluster writeAttributeLongOctetStringWithValue:longOctetStringArgument - responseHandler:^(NSError * err, NSDictionary * values) { - NSLog(@"Write attribute LONG_OCTET_STRING Error: %@", err); + [cluster off:^(NSError * err, NSDictionary * values) { + NSLog(@"Turn off light that we turned on Error: %@", err); - XCTAssertEqual(err.code, 0); + XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; + [expectation fulfill]; + }]; [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTestCluster_000098_ReadAttribute +- (void)testSendClusterTest_TC_CC_7_2_000007_ReadAttribute { - XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute CHAR_STRING Default Value"]; + XCTestExpectation * expectation = [self expectationWithDescription:@"Check on/off attribute value is false after off command"]; CHIPDevice * device = GetConnectedDevice(); dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; + CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:queue]; XCTAssertNotNil(cluster); - [cluster readAttributeCharStringWithResponseHandler:^(NSError * err, NSDictionary * values) { - NSLog(@"Read attribute CHAR_STRING Default Value Error: %@", err); + [cluster readAttributeOnOffWithResponseHandler:^(NSError * err, NSDictionary * values) { + NSLog(@"Check on/off attribute value is false after off command Error: %@", err); XCTAssertEqual(err.code, 0); - NSString * charStringArgument = @""; - XCTAssertTrue([values[@"value"] isEqualToString:charStringArgument]); + XCTAssertEqual([values[@"value"] boolValue], 0); [expectation fulfill]; }]; [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTestCluster_000099_WriteAttribute + +- (void)testSendClusterTest_TC_CC_7_3_000000_On { - XCTestExpectation * expectation = [self expectationWithDescription:@"Write attribute CHAR_STRING"]; + XCTestExpectation * expectation = [self expectationWithDescription:@"Turn on light for color control tests"]; CHIPDevice * device = GetConnectedDevice(); dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; + CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:queue]; XCTAssertNotNil(cluster); - NSString * charStringArgument = @"☉T☉"; - [cluster writeAttributeCharStringWithValue:charStringArgument - responseHandler:^(NSError * err, NSDictionary * values) { - NSLog(@"Write attribute CHAR_STRING Error: %@", err); + [cluster on:^(NSError * err, NSDictionary * values) { + NSLog(@"Turn on light for color control tests Error: %@", err); - XCTAssertEqual(err.code, 0); + XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; + [expectation fulfill]; + }]; [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTestCluster_000100_WriteAttribute +- (void)testSendClusterTest_TC_CC_7_3_000001_ReadAttribute { - XCTestExpectation * expectation = [self expectationWithDescription:@"Write attribute CHAR_STRING - Value too long"]; + XCTestExpectation * expectation = [self expectationWithDescription:@"Check on/off attribute value is true after on command"]; CHIPDevice * device = GetConnectedDevice(); dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; + CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:queue]; XCTAssertNotNil(cluster); - NSString * charStringArgument = @"☉TestValueLongerThan10☉"; - [cluster writeAttributeCharStringWithValue:charStringArgument - responseHandler:^(NSError * err, NSDictionary * values) { - NSLog(@"Write attribute CHAR_STRING - Value too long Error: %@", err); + [cluster readAttributeOnOffWithResponseHandler:^(NSError * err, NSDictionary * values) { + NSLog(@"Check on/off attribute value is true after on command Error: %@", err); - XCTAssertEqual(err.code, true); - [expectation fulfill]; - }]; + XCTAssertEqual(err.code, 0); + + XCTAssertEqual([values[@"value"] boolValue], 1); + + [expectation fulfill]; + }]; [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTestCluster_000101_WriteAttribute +- (void)testSendClusterTest_TC_CC_7_3_000002_EnhancedStepHue { - XCTestExpectation * expectation = [self expectationWithDescription:@"Write attribute CHAR_STRING - Empty"]; + XCTestExpectation * expectation = [self expectationWithDescription:@"Enhanced Step Hue Up command"]; CHIPDevice * device = GetConnectedDevice(); dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; + CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; XCTAssertNotNil(cluster); - NSString * charStringArgument = @""; - [cluster writeAttributeCharStringWithValue:charStringArgument - responseHandler:^(NSError * err, NSDictionary * values) { - NSLog(@"Write attribute CHAR_STRING - Empty Error: %@", err); + uint8_t stepModeArgument = 0; + uint16_t stepSizeArgument = 50U; + uint16_t transitionTimeArgument = 1U; + uint8_t optionsMaskArgument = 0; + uint8_t optionsOverrideArgument = 0; + [cluster enhancedStepHue:stepModeArgument + stepSize:stepSizeArgument + transitionTime:transitionTimeArgument + optionsMask:optionsMaskArgument + optionsOverride:optionsOverrideArgument + responseHandler:^(NSError * err, NSDictionary * values) { + NSLog(@"Enhanced Step Hue Up command Error: %@", err); - XCTAssertEqual(err.code, 0); + XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; + [expectation fulfill]; + }]; [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTestCluster_000102_ReadAttribute +- (void)testSendClusterTest_TC_CC_7_3_000003_EnhancedStepHue { - XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute LONG_CHAR_STRING Default Value"]; + XCTestExpectation * expectation = [self expectationWithDescription:@"Enhanced Step Hue Down command"]; CHIPDevice * device = GetConnectedDevice(); dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; + CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; XCTAssertNotNil(cluster); - [cluster readAttributeLongCharStringWithResponseHandler:^(NSError * err, NSDictionary * values) { - NSLog(@"Read attribute LONG_CHAR_STRING Default Value Error: %@", err); - - XCTAssertEqual(err.code, 0); + uint8_t stepModeArgument = 1; + uint16_t stepSizeArgument = 75U; + uint16_t transitionTimeArgument = 1U; + uint8_t optionsMaskArgument = 0; + uint8_t optionsOverrideArgument = 0; + [cluster enhancedStepHue:stepModeArgument + stepSize:stepSizeArgument + transitionTime:transitionTimeArgument + optionsMask:optionsMaskArgument + optionsOverride:optionsOverrideArgument + responseHandler:^(NSError * err, NSDictionary * values) { + NSLog(@"Enhanced Step Hue Down command Error: %@", err); - NSString * longCharStringArgument = @""; - XCTAssertTrue([values[@"value"] isEqualToString:longCharStringArgument]); + XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; + [expectation fulfill]; + }]; [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTestCluster_000103_WriteAttribute +- (void)testSendClusterTest_TC_CC_7_3_000004_Off { - XCTestExpectation * expectation = [self expectationWithDescription:@"Write attribute LONG_CHAR_STRING"]; + XCTestExpectation * expectation = [self expectationWithDescription:@"Turn off light that we turned on"]; CHIPDevice * device = GetConnectedDevice(); dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; + CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:queue]; XCTAssertNotNil(cluster); - NSString * longCharStringArgument - = @"☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉" - @"☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉" - @"☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉"; - [cluster writeAttributeLongCharStringWithValue:longCharStringArgument - responseHandler:^(NSError * err, NSDictionary * values) { - NSLog(@"Write attribute LONG_CHAR_STRING Error: %@", err); + [cluster off:^(NSError * err, NSDictionary * values) { + NSLog(@"Turn off light that we turned on Error: %@", err); - XCTAssertEqual(err.code, 0); + XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; + [expectation fulfill]; + }]; [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTestCluster_000104_ReadAttribute +- (void)testSendClusterTest_TC_CC_7_3_000005_ReadAttribute { - XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute LONG_CHAR_STRING"]; + XCTestExpectation * expectation = [self expectationWithDescription:@"Check on/off attribute value is false after off command"]; CHIPDevice * device = GetConnectedDevice(); dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; + CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:queue]; XCTAssertNotNil(cluster); - [cluster readAttributeLongCharStringWithResponseHandler:^(NSError * err, NSDictionary * values) { - NSLog(@"Read attribute LONG_CHAR_STRING Error: %@", err); + [cluster readAttributeOnOffWithResponseHandler:^(NSError * err, NSDictionary * values) { + NSLog(@"Check on/off attribute value is false after off command Error: %@", err); XCTAssertEqual(err.code, 0); - NSString * longCharStringArgument - = @"☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉" - @"☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉" - @"☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉"; - XCTAssertTrue([values[@"value"] isEqualToString:longCharStringArgument]); + XCTAssertEqual([values[@"value"] boolValue], 0); [expectation fulfill]; }]; [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTestCluster_000105_WriteAttribute + +- (void)testSendClusterTest_TC_CC_7_4_000000_On { - XCTestExpectation * expectation = [self expectationWithDescription:@"Write attribute LONG_CHAR_STRING"]; + XCTestExpectation * expectation = [self expectationWithDescription:@"Turn on light for color control tests"]; CHIPDevice * device = GetConnectedDevice(); dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; + CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:queue]; XCTAssertNotNil(cluster); - NSString * longCharStringArgument = @""; - [cluster writeAttributeLongCharStringWithValue:longCharStringArgument - responseHandler:^(NSError * err, NSDictionary * values) { - NSLog(@"Write attribute LONG_CHAR_STRING Error: %@", err); + [cluster on:^(NSError * err, NSDictionary * values) { + NSLog(@"Turn on light for color control tests Error: %@", err); - XCTAssertEqual(err.code, 0); + XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; + [expectation fulfill]; + }]; [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTestCluster_000106_ReadAttribute +- (void)testSendClusterTest_TC_CC_7_4_000001_ReadAttribute { - XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute LIST"]; + XCTestExpectation * expectation = [self expectationWithDescription:@"Check on/off attribute value is true after on command"]; CHIPDevice * device = GetConnectedDevice(); dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; + CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:queue]; XCTAssertNotNil(cluster); - [cluster readAttributeListInt8uWithResponseHandler:^(NSError * err, NSDictionary * values) { - NSLog(@"Read attribute LIST Error: %@", err); + [cluster readAttributeOnOffWithResponseHandler:^(NSError * err, NSDictionary * values) { + NSLog(@"Check on/off attribute value is true after on command Error: %@", err); XCTAssertEqual(err.code, 0); - XCTAssertEqual([values[@"value"] count], 4); + XCTAssertEqual([values[@"value"] boolValue], 1); [expectation fulfill]; }]; [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTestCluster_000107_ReadAttribute +- (void)testSendClusterTest_TC_CC_7_4_000002_EnhancedMoveToHueAndSaturation { - XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute LIST_OCTET_STRING"]; + XCTestExpectation * expectation = [self expectationWithDescription:@"Enhanced move to hue and saturation command"]; CHIPDevice * device = GetConnectedDevice(); dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; + CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; XCTAssertNotNil(cluster); - [cluster readAttributeListOctetStringWithResponseHandler:^(NSError * err, NSDictionary * values) { - NSLog(@"Read attribute LIST_OCTET_STRING Error: %@", err); - - XCTAssertEqual(err.code, 0); + uint16_t enhancedHueArgument = 1200U; + uint8_t saturationArgument = 90; + uint16_t transitionTimeArgument = 10U; + uint8_t optionsMaskArgument = 0; + uint8_t optionsOverrideArgument = 0; + [cluster enhancedMoveToHueAndSaturation:enhancedHueArgument + saturation:saturationArgument + transitionTime:transitionTimeArgument + optionsMask:optionsMaskArgument + optionsOverride:optionsOverrideArgument + responseHandler:^(NSError * err, NSDictionary * values) { + NSLog(@"Enhanced move to hue and saturation command Error: %@", err); - XCTAssertEqual([values[@"value"] count], 4); + XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; + [expectation fulfill]; + }]; [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTestCluster_000108_ReadAttribute +- (void)testSendClusterTest_TC_CC_7_4_000003_Off { - XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute LIST_STRUCT_OCTET_STRING"]; + XCTestExpectation * expectation = [self expectationWithDescription:@"Turn off light that we turned on"]; CHIPDevice * device = GetConnectedDevice(); dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; + CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:queue]; XCTAssertNotNil(cluster); - [cluster readAttributeListStructOctetStringWithResponseHandler:^(NSError * err, NSDictionary * values) { - NSLog(@"Read attribute LIST_STRUCT_OCTET_STRING Error: %@", err); + [cluster off:^(NSError * err, NSDictionary * values) { + NSLog(@"Turn off light that we turned on Error: %@", err); XCTAssertEqual(err.code, 0); - XCTAssertEqual([values[@"value"] count], 4); - [expectation fulfill]; }]; [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTestCluster_000109_ReadAttribute +- (void)testSendClusterTest_TC_CC_7_4_000004_ReadAttribute { - XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute EPOCH_US Default Value"]; + XCTestExpectation * expectation = [self expectationWithDescription:@"Check on/off attribute value is false after off command"]; CHIPDevice * device = GetConnectedDevice(); dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; + CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:queue]; XCTAssertNotNil(cluster); - [cluster readAttributeEpochUsWithResponseHandler:^(NSError * err, NSDictionary * values) { - NSLog(@"Read attribute EPOCH_US Default Value Error: %@", err); + [cluster readAttributeOnOffWithResponseHandler:^(NSError * err, NSDictionary * values) { + NSLog(@"Check on/off attribute value is false after off command Error: %@", err); XCTAssertEqual(err.code, 0); - XCTAssertEqual([values[@"value"] unsignedLongLongValue], 0ULL); + XCTAssertEqual([values[@"value"] boolValue], 0); [expectation fulfill]; }]; [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTestCluster_000110_WriteAttribute + +- (void)testSendClusterTest_TC_CC_8_1_000000_On { - XCTestExpectation * expectation = [self expectationWithDescription:@"Write attribute EPOCH_US Max Value"]; + XCTestExpectation * expectation = [self expectationWithDescription:@"Turn on light for color control tests"]; CHIPDevice * device = GetConnectedDevice(); dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; + CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:queue]; XCTAssertNotNil(cluster); - uint64_t epochUsArgument = 18446744073709551615ULL; - [cluster writeAttributeEpochUsWithValue:epochUsArgument - responseHandler:^(NSError * err, NSDictionary * values) { - NSLog(@"Write attribute EPOCH_US Max Value Error: %@", err); + [cluster on:^(NSError * err, NSDictionary * values) { + NSLog(@"Turn on light for color control tests Error: %@", err); - XCTAssertEqual(err.code, 0); + XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; + [expectation fulfill]; + }]; [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTestCluster_000111_ReadAttribute +- (void)testSendClusterTest_TC_CC_8_1_000001_ReadAttribute { - XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute EPOCH_US Max Value"]; + XCTestExpectation * expectation = [self expectationWithDescription:@"Check on/off attribute value is true after on command"]; CHIPDevice * device = GetConnectedDevice(); dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; + CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:queue]; XCTAssertNotNil(cluster); - [cluster readAttributeEpochUsWithResponseHandler:^(NSError * err, NSDictionary * values) { - NSLog(@"Read attribute EPOCH_US Max Value Error: %@", err); + [cluster readAttributeOnOffWithResponseHandler:^(NSError * err, NSDictionary * values) { + NSLog(@"Check on/off attribute value is true after on command Error: %@", err); XCTAssertEqual(err.code, 0); - XCTAssertEqual([values[@"value"] unsignedLongLongValue], 18446744073709551615ULL); + XCTAssertEqual([values[@"value"] boolValue], 1); [expectation fulfill]; }]; [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTestCluster_000112_WriteAttribute +- (void)testSendClusterTest_TC_CC_8_1_000002_ColorLoopSet { - XCTestExpectation * expectation = [self expectationWithDescription:@"Write attribute EPOCH_US Min Value"]; + XCTestExpectation * expectation = [self expectationWithDescription:@"Color Loop Set Command - Set all Attributs"]; CHIPDevice * device = GetConnectedDevice(); dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; + CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; XCTAssertNotNil(cluster); - uint64_t epochUsArgument = 0ULL; - [cluster writeAttributeEpochUsWithValue:epochUsArgument - responseHandler:^(NSError * err, NSDictionary * values) { - NSLog(@"Write attribute EPOCH_US Min Value Error: %@", err); + 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; + [cluster colorLoopSet:updateFlagsArgument + action:actionArgument + direction:directionArgument + time:timeArgument + startHue:startHueArgument + optionsMask:optionsMaskArgument + optionsOverride:optionsOverrideArgument + responseHandler:^(NSError * err, NSDictionary * values) { + NSLog(@"Color Loop Set Command - Set all Attributs Error: %@", err); - XCTAssertEqual(err.code, 0); + XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; + [expectation fulfill]; + }]; [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTestCluster_000113_ReadAttribute +- (void)testSendClusterTest_TC_CC_8_1_000003_ReadAttribute { - XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute EPOCH_US Min Value"]; + XCTestExpectation * expectation = [self expectationWithDescription:@"Check ColorLoopDirection Value"]; CHIPDevice * device = GetConnectedDevice(); dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; + CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; XCTAssertNotNil(cluster); - [cluster readAttributeEpochUsWithResponseHandler:^(NSError * err, NSDictionary * values) { - NSLog(@"Read attribute EPOCH_US Min Value Error: %@", err); + [cluster readAttributeColorLoopDirectionWithResponseHandler:^(NSError * err, NSDictionary * values) { + NSLog(@"Check ColorLoopDirection Value Error: %@", err); XCTAssertEqual(err.code, 0); - XCTAssertEqual([values[@"value"] unsignedLongLongValue], 0ULL); + XCTAssertEqual([values[@"value"] unsignedCharValue], 1); [expectation fulfill]; }]; [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTestCluster_000114_ReadAttribute +- (void)testSendClusterTest_TC_CC_8_1_000004_ReadAttribute { - XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute EPOCH_S Default Value"]; + XCTestExpectation * expectation = [self expectationWithDescription:@"Check ColorLoopTime Value"]; CHIPDevice * device = GetConnectedDevice(); dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; + CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; XCTAssertNotNil(cluster); - [cluster readAttributeEpochSWithResponseHandler:^(NSError * err, NSDictionary * values) { - NSLog(@"Read attribute EPOCH_S Default Value Error: %@", err); + [cluster readAttributeColorLoopTimeWithResponseHandler:^(NSError * err, NSDictionary * values) { + NSLog(@"Check ColorLoopTime Value Error: %@", err); XCTAssertEqual(err.code, 0); - XCTAssertEqual([values[@"value"] unsignedLongValue], 0UL); + XCTAssertEqual([values[@"value"] unsignedShortValue], 100U); [expectation fulfill]; }]; [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTestCluster_000115_WriteAttribute +- (void)testSendClusterTest_TC_CC_8_1_000005_ReadAttribute { - XCTestExpectation * expectation = [self expectationWithDescription:@"Write attribute EPOCH_S Max Value"]; + XCTestExpectation * expectation = [self expectationWithDescription:@"Check ColorLoopStartEnhancedHue Value"]; CHIPDevice * device = GetConnectedDevice(); dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; + CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; XCTAssertNotNil(cluster); - uint32_t epochSArgument = 4294967295UL; - [cluster writeAttributeEpochSWithValue:epochSArgument - responseHandler:^(NSError * err, NSDictionary * values) { - NSLog(@"Write attribute EPOCH_S Max Value Error: %@", err); + [cluster readAttributeColorLoopStartEnhancedHueWithResponseHandler:^(NSError * err, NSDictionary * values) { + NSLog(@"Check ColorLoopStartEnhancedHue Value Error: %@", err); - XCTAssertEqual(err.code, 0); + XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; + XCTAssertEqual([values[@"value"] unsignedShortValue], 500U); + + [expectation fulfill]; + }]; [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTestCluster_000116_ReadAttribute +- (void)testSendClusterTest_TC_CC_8_1_000006_ReadAttribute { - XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute EPOCH_S Max Value"]; + XCTestExpectation * expectation = [self expectationWithDescription:@"Check ColorLoopActive Value"]; CHIPDevice * device = GetConnectedDevice(); dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; + CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; XCTAssertNotNil(cluster); - [cluster readAttributeEpochSWithResponseHandler:^(NSError * err, NSDictionary * values) { - NSLog(@"Read attribute EPOCH_S Max Value Error: %@", err); + [cluster readAttributeColorLoopActiveWithResponseHandler:^(NSError * err, NSDictionary * values) { + NSLog(@"Check ColorLoopActive Value Error: %@", err); XCTAssertEqual(err.code, 0); - XCTAssertEqual([values[@"value"] unsignedLongValue], 4294967295UL); + XCTAssertEqual([values[@"value"] unsignedCharValue], 0); [expectation fulfill]; }]; [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTestCluster_000117_WriteAttribute +- (void)testSendClusterTest_TC_CC_8_1_000007_ColorLoopSet { - XCTestExpectation * expectation = [self expectationWithDescription:@"Write attribute EPOCH_S Min Value"]; + XCTestExpectation * expectation = [self expectationWithDescription:@"Color Loop Set Command - Start Color Loop"]; CHIPDevice * device = GetConnectedDevice(); dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; + CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; XCTAssertNotNil(cluster); - uint32_t epochSArgument = 0UL; - [cluster writeAttributeEpochSWithValue:epochSArgument - responseHandler:^(NSError * err, NSDictionary * values) { - NSLog(@"Write attribute EPOCH_S Min Value Error: %@", err); + 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; + [cluster colorLoopSet:updateFlagsArgument + action:actionArgument + direction:directionArgument + time:timeArgument + startHue:startHueArgument + optionsMask:optionsMaskArgument + optionsOverride:optionsOverrideArgument + responseHandler:^(NSError * err, NSDictionary * values) { + NSLog(@"Color Loop Set Command - Start Color Loop Error: %@", err); - XCTAssertEqual(err.code, 0); + XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; + [expectation fulfill]; + }]; [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTestCluster_000118_ReadAttribute +- (void)testSendClusterTest_TC_CC_8_1_000008_ReadAttribute { - XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute EPOCH_S Min Value"]; + XCTestExpectation * expectation = [self expectationWithDescription:@"Check ColorLoopActive Value"]; CHIPDevice * device = GetConnectedDevice(); dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; + CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; XCTAssertNotNil(cluster); - [cluster readAttributeEpochSWithResponseHandler:^(NSError * err, NSDictionary * values) { - NSLog(@"Read attribute EPOCH_S Min Value Error: %@", err); + [cluster readAttributeColorLoopActiveWithResponseHandler:^(NSError * err, NSDictionary * values) { + NSLog(@"Check ColorLoopActive Value Error: %@", err); XCTAssertEqual(err.code, 0); - XCTAssertEqual([values[@"value"] unsignedLongValue], 0UL); + XCTAssertEqual([values[@"value"] unsignedCharValue], 1); [expectation fulfill]; }]; [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTestCluster_000119_ReadAttribute +- (void)testSendClusterTest_TC_CC_8_1_000009_ColorLoopSet { - XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute UNSUPPORTED"]; + XCTestExpectation * expectation = + [self expectationWithDescription:@"Color Loop Set Command - Set direction and time while running"]; CHIPDevice * device = GetConnectedDevice(); dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; + CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; XCTAssertNotNil(cluster); - [cluster readAttributeUnsupportedWithResponseHandler:^(NSError * err, NSDictionary * values) { - NSLog(@"Read attribute UNSUPPORTED Error: %@", err); - - if (err.code == CHIPErrorCodeUnsupportedAttribute) { - [expectation fulfill]; - return; - } - - XCTAssertEqual(err.code, 0); + 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; + [cluster colorLoopSet:updateFlagsArgument + action:actionArgument + direction:directionArgument + time:timeArgument + startHue:startHueArgument + optionsMask:optionsMaskArgument + optionsOverride:optionsOverrideArgument + responseHandler:^(NSError * err, NSDictionary * values) { + NSLog(@"Color Loop Set Command - Set direction and time while running Error: %@", err); - XCTAssertEqual([values[@"value"] boolValue], 0); + XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; + [expectation fulfill]; + }]; [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTestCluster_000120_WriteAttribute +- (void)testSendClusterTest_TC_CC_8_1_000010_ReadAttribute { - XCTestExpectation * expectation = [self expectationWithDescription:@"Writeattribute UNSUPPORTED"]; + XCTestExpectation * expectation = [self expectationWithDescription:@"Check ColorLoopDirection Value"]; CHIPDevice * device = GetConnectedDevice(); dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; + CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; XCTAssertNotNil(cluster); - bool unsupportedArgument = 0; - [cluster writeAttributeUnsupportedWithValue:unsupportedArgument - responseHandler:^(NSError * err, NSDictionary * values) { - NSLog(@"Writeattribute UNSUPPORTED Error: %@", err); + [cluster readAttributeColorLoopDirectionWithResponseHandler:^(NSError * err, NSDictionary * values) { + NSLog(@"Check ColorLoopDirection Value Error: %@", err); - if (err.code == CHIPErrorCodeUnsupportedAttribute) { - [expectation fulfill]; - return; - } + XCTAssertEqual(err.code, 0); - XCTAssertEqual(err.code, 0); + XCTAssertEqual([values[@"value"] unsignedCharValue], 0); - [expectation fulfill]; - }]; + [expectation fulfill]; + }]; [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTestCluster_000121_Test +- (void)testSendClusterTest_TC_CC_8_1_000011_ReadAttribute { - XCTestExpectation * expectation = [self expectationWithDescription:@"Send Test Command to unsupported endpoint"]; + XCTestExpectation * expectation = [self expectationWithDescription:@"Check ColorLoopTime Value"]; CHIPDevice * device = GetConnectedDevice(); dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:200 queue:queue]; + CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; XCTAssertNotNil(cluster); - [cluster test:^(NSError * err, NSDictionary * values) { - NSLog(@"Send Test Command to unsupported endpoint Error: %@", err); + [cluster readAttributeColorLoopTimeWithResponseHandler:^(NSError * err, NSDictionary * values) { + NSLog(@"Check ColorLoopTime Value Error: %@", err); + + XCTAssertEqual(err.code, 0); + + XCTAssertEqual([values[@"value"] unsignedShortValue], 3500U); - XCTAssertEqual(err.code, 1); [expectation fulfill]; }]; [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } - -- (void)testSendClusterTestConstraints_000000_WriteAttribute +- (void)testSendClusterTest_TC_CC_8_1_000012_ColorLoopSet { - XCTestExpectation * expectation = [self expectationWithDescription:@"Write attribute INT32U Value"]; + XCTestExpectation * expectation = [self expectationWithDescription:@"Color Loop Set Command - Set direction while running"]; CHIPDevice * device = GetConnectedDevice(); dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; + CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; XCTAssertNotNil(cluster); - uint32_t int32uArgument = 5UL; - [cluster writeAttributeInt32uWithValue:int32uArgument - responseHandler:^(NSError * err, NSDictionary * values) { - NSLog(@"Write attribute INT32U Value Error: %@", err); + 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; + [cluster colorLoopSet:updateFlagsArgument + action:actionArgument + direction:directionArgument + time:timeArgument + startHue:startHueArgument + optionsMask:optionsMaskArgument + optionsOverride:optionsOverrideArgument + responseHandler:^(NSError * err, NSDictionary * values) { + NSLog(@"Color Loop Set Command - Set direction while running Error: %@", err); - XCTAssertEqual(err.code, 0); + XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; + [expectation fulfill]; + }]; [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTestConstraints_000001_ReadAttribute +- (void)testSendClusterTest_TC_CC_8_1_000013_ReadAttribute { - XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute INT32U Value MinValue Constraints"]; + XCTestExpectation * expectation = [self expectationWithDescription:@"Check ColorLoopDirection Value"]; CHIPDevice * device = GetConnectedDevice(); dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; + CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; XCTAssertNotNil(cluster); - [cluster readAttributeInt32uWithResponseHandler:^(NSError * err, NSDictionary * values) { - NSLog(@"Read attribute INT32U Value MinValue Constraints Error: %@", err); + [cluster readAttributeColorLoopDirectionWithResponseHandler:^(NSError * err, NSDictionary * values) { + NSLog(@"Check ColorLoopDirection Value Error: %@", err); XCTAssertEqual(err.code, 0); - XCTAssertGreaterThanOrEqual([values[@"value"] unsignedLongValue], 5); + XCTAssertEqual([values[@"value"] unsignedCharValue], 1); [expectation fulfill]; }]; [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTestConstraints_000002_ReadAttribute +- (void)testSendClusterTest_TC_CC_8_1_000014_Off { - XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute INT32U Value MaxValue Constraints"]; + XCTestExpectation * expectation = [self expectationWithDescription:@"Turn off light that we turned on"]; CHIPDevice * device = GetConnectedDevice(); dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; + CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:queue]; XCTAssertNotNil(cluster); - [cluster readAttributeInt32uWithResponseHandler:^(NSError * err, NSDictionary * values) { - NSLog(@"Read attribute INT32U Value MaxValue Constraints Error: %@", err); + [cluster off:^(NSError * err, NSDictionary * values) { + NSLog(@"Turn off light that we turned on Error: %@", err); XCTAssertEqual(err.code, 0); - XCTAssertLessThanOrEqual([values[@"value"] unsignedLongValue], 5); - [expectation fulfill]; }]; [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTestConstraints_000003_ReadAttribute +- (void)testSendClusterTest_TC_CC_8_1_000015_ReadAttribute { - XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute INT32U Value NotValue Constraints"]; + XCTestExpectation * expectation = [self expectationWithDescription:@"Check on/off attribute value is false after off command"]; CHIPDevice * device = GetConnectedDevice(); dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; + CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:queue]; XCTAssertNotNil(cluster); - [cluster readAttributeInt32uWithResponseHandler:^(NSError * err, NSDictionary * values) { - NSLog(@"Read attribute INT32U Value NotValue Constraints Error: %@", err); + [cluster readAttributeOnOffWithResponseHandler:^(NSError * err, NSDictionary * values) { + NSLog(@"Check on/off attribute value is false after off command Error: %@", err); XCTAssertEqual(err.code, 0); - XCTAssertNotEqual([values[@"value"] unsignedLongValue], 6); + XCTAssertEqual([values[@"value"] boolValue], 0); [expectation fulfill]; }]; @@ -2867,111 +3021,97 @@ - (void)testSendClusterTestConstraints_000003_ReadAttribute [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTestDelayCommands_000000_WaitForMs -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Wait 100ms"]; - - dispatch_queue_t queue = dispatch_get_main_queue(); - WaitForMs(expectation, queue, 100); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterTestDescriptorCluster_000000_ReadAttribute +- (void)testSendClusterTest_TC_DM_1_1_000000_ReadAttribute { - XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute Device list"]; + XCTestExpectation * expectation = [self expectationWithDescription:@"Query Interaction Model Version"]; CHIPDevice * device = GetConnectedDevice(); dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestDescriptor * cluster = [[CHIPTestDescriptor alloc] initWithDevice:device endpoint:0 queue:queue]; + CHIPTestBasic * cluster = [[CHIPTestBasic alloc] initWithDevice:device endpoint:0 queue:queue]; XCTAssertNotNil(cluster); - [cluster readAttributeDeviceListWithResponseHandler:^(NSError * err, NSDictionary * values) { - NSLog(@"Read attribute Device list Error: %@", err); + [cluster readAttributeInteractionModelVersionWithResponseHandler:^(NSError * err, NSDictionary * values) { + NSLog(@"Query Interaction Model Version Error: %@", err); XCTAssertEqual(err.code, 0); - XCTAssertEqual([values[@"value"] count], 1); - [expectation fulfill]; }]; [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTestDescriptorCluster_000001_ReadAttribute +- (void)testSendClusterTest_TC_DM_1_1_000001_ReadAttribute { - XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute Server list"]; + XCTestExpectation * expectation = [self expectationWithDescription:@"Query Vendor Name"]; CHIPDevice * device = GetConnectedDevice(); dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestDescriptor * cluster = [[CHIPTestDescriptor alloc] initWithDevice:device endpoint:0 queue:queue]; + CHIPTestBasic * cluster = [[CHIPTestBasic alloc] initWithDevice:device endpoint:0 queue:queue]; XCTAssertNotNil(cluster); - [cluster readAttributeServerListWithResponseHandler:^(NSError * err, NSDictionary * values) { - NSLog(@"Read attribute Server list Error: %@", err); + [cluster readAttributeVendorNameWithResponseHandler:^(NSError * err, NSDictionary * values) { + NSLog(@"Query Vendor Name Error: %@", err); XCTAssertEqual(err.code, 0); - XCTAssertEqual([values[@"value"] count], 18); + XCTAssertLessThanOrEqual([values[@"value"] length], 32); [expectation fulfill]; }]; [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTestDescriptorCluster_000002_ReadAttribute +- (void)testSendClusterTest_TC_DM_1_1_000002_ReadAttribute { - XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute Client list"]; + XCTestExpectation * expectation = [self expectationWithDescription:@"Query VendorID"]; CHIPDevice * device = GetConnectedDevice(); dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestDescriptor * cluster = [[CHIPTestDescriptor alloc] initWithDevice:device endpoint:0 queue:queue]; + CHIPTestBasic * cluster = [[CHIPTestBasic alloc] initWithDevice:device endpoint:0 queue:queue]; XCTAssertNotNil(cluster); - [cluster readAttributeClientListWithResponseHandler:^(NSError * err, NSDictionary * values) { - NSLog(@"Read attribute Client list Error: %@", err); + [cluster readAttributeVendorIDWithResponseHandler:^(NSError * err, NSDictionary * values) { + NSLog(@"Query VendorID Error: %@", err); XCTAssertEqual(err.code, 0); - XCTAssertEqual([values[@"value"] count], 0); - [expectation fulfill]; }]; [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTestDescriptorCluster_000003_ReadAttribute +- (void)testSendClusterTest_TC_DM_1_1_000003_ReadAttribute { - XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute Parts list"]; + XCTestExpectation * expectation = [self expectationWithDescription:@"Query Product Name"]; CHIPDevice * device = GetConnectedDevice(); dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestDescriptor * cluster = [[CHIPTestDescriptor alloc] initWithDevice:device endpoint:0 queue:queue]; + CHIPTestBasic * cluster = [[CHIPTestBasic alloc] initWithDevice:device endpoint:0 queue:queue]; XCTAssertNotNil(cluster); - [cluster readAttributePartsListWithResponseHandler:^(NSError * err, NSDictionary * values) { - NSLog(@"Read attribute Parts list Error: %@", err); + [cluster readAttributeProductNameWithResponseHandler:^(NSError * err, NSDictionary * values) { + NSLog(@"Query Product Name Error: %@", err); XCTAssertEqual(err.code, 0); - XCTAssertEqual([values[@"value"] count], 2); + XCTAssertLessThanOrEqual([values[@"value"] length], 32); [expectation fulfill]; }]; [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } - -- (void)testSendClusterTestSubscribe_OnOff_000000_Off +- (void)testSendClusterTest_TC_DM_1_1_000004_ReadAttribute { - XCTestExpectation * expectation = [self expectationWithDescription:@"Set OnOff Attribute to false"]; + XCTestExpectation * expectation = [self expectationWithDescription:@"Query ProductID"]; CHIPDevice * device = GetConnectedDevice(); dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:queue]; + CHIPTestBasic * cluster = [[CHIPTestBasic alloc] initWithDevice:device endpoint:0 queue:queue]; XCTAssertNotNil(cluster); - [cluster off:^(NSError * err, NSDictionary * values) { - NSLog(@"Set OnOff Attribute to false Error: %@", err); + [cluster readAttributeProductIDWithResponseHandler:^(NSError * err, NSDictionary * values) { + NSLog(@"Query ProductID Error: %@", err); XCTAssertEqual(err.code, 0); @@ -2980,59 +3120,59 @@ - (void)testSendClusterTestSubscribe_OnOff_000000_Off [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -bool testSendClusterTestSubscribe_OnOff_000001_WaitForReport_Fulfilled = false; -- (void)testSendClusterTestSubscribe_OnOff_000001_WaitForReport +- (void)testSendClusterTest_TC_DM_1_1_000005_ReadAttribute { + XCTestExpectation * expectation = [self expectationWithDescription:@"Query User Label"]; CHIPDevice * device = GetConnectedDevice(); dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:queue]; + CHIPTestBasic * cluster = [[CHIPTestBasic alloc] initWithDevice:device endpoint:0 queue:queue]; XCTAssertNotNil(cluster); - [cluster reportAttributeOnOffWithResponseHandler:^(NSError * err, NSDictionary * values) { - NSLog(@"Report: Subscribe OnOff Attribute Error: %@", err); + [cluster readAttributeUserLabelWithResponseHandler:^(NSError * err, NSDictionary * values) { + NSLog(@"Query User Label Error: %@", err); XCTAssertEqual(err.code, 0); - XCTAssertEqual([values[@"value"] boolValue], false); + XCTAssertLessThanOrEqual([values[@"value"] length], 32); - testSendClusterTestSubscribe_OnOff_000001_WaitForReport_Fulfilled = true; + [expectation fulfill]; }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTestSubscribe_OnOff_000002_SubscribeAttribute +- (void)testSendClusterTest_TC_DM_1_1_000006_ReadAttribute { - XCTestExpectation * expectation = [self expectationWithDescription:@"Subscribe OnOff Attribute"]; + XCTestExpectation * expectation = [self expectationWithDescription:@"Query User Location"]; CHIPDevice * device = GetConnectedDevice(); dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:queue]; + CHIPTestBasic * cluster = [[CHIPTestBasic alloc] initWithDevice:device endpoint:0 queue:queue]; XCTAssertNotNil(cluster); - uint16_t minIntervalArgument = 2; - uint16_t maxIntervalArgument = 10; - [cluster subscribeAttributeOnOffWithMinInterval:minIntervalArgument - maxInterval:maxIntervalArgument - responseHandler:^(NSError * err, NSDictionary * values) { - NSLog(@"Subscribe OnOff Attribute Error: %@", err); + [cluster readAttributeLocationWithResponseHandler:^(NSError * err, NSDictionary * values) { + NSLog(@"Query User Location Error: %@", err); - XCTAssertEqual(err.code, 0); - XCTAssertEqual(testSendClusterTestSubscribe_OnOff_000001_WaitForReport_Fulfilled, true); - [expectation fulfill]; - }]; + XCTAssertEqual(err.code, 0); + + XCTAssertLessThanOrEqual([values[@"value"] length], 2); + + [expectation fulfill]; + }]; [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTestSubscribe_OnOff_000003_On +- (void)testSendClusterTest_TC_DM_1_1_000007_ReadAttribute { - XCTestExpectation * expectation = [self expectationWithDescription:@"Turn On the light to see attribute change"]; + XCTestExpectation * expectation = [self expectationWithDescription:@"Query HardwareVersion"]; CHIPDevice * device = GetConnectedDevice(); dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:queue]; + CHIPTestBasic * cluster = [[CHIPTestBasic alloc] initWithDevice:device endpoint:0 queue:queue]; XCTAssertNotNil(cluster); - [cluster on:^(NSError * err, NSDictionary * values) { - NSLog(@"Turn On the light to see attribute change Error: %@", err); + [cluster readAttributeHardwareVersionWithResponseHandler:^(NSError * err, NSDictionary * values) { + NSLog(@"Query HardwareVersion Error: %@", err); XCTAssertEqual(err.code, 0); @@ -3041,39 +3181,40 @@ - (void)testSendClusterTestSubscribe_OnOff_000003_On [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTestSubscribe_OnOff_000004_WaitForReport +- (void)testSendClusterTest_TC_DM_1_1_000008_ReadAttribute { - XCTestExpectation * expectation = [self expectationWithDescription:@"Check for attribute report"]; + XCTestExpectation * expectation = [self expectationWithDescription:@"Query HardwareVersionString"]; CHIPDevice * device = GetConnectedDevice(); dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:queue]; + CHIPTestBasic * cluster = [[CHIPTestBasic alloc] initWithDevice:device endpoint:0 queue:queue]; XCTAssertNotNil(cluster); - [cluster reportAttributeOnOffWithResponseHandler:^(NSError * err, NSDictionary * values) { - NSLog(@"Check for attribute report Error: %@", err); + [cluster readAttributeHardwareVersionStringWithResponseHandler:^(NSError * err, NSDictionary * values) { + NSLog(@"Query HardwareVersionString Error: %@", err); XCTAssertEqual(err.code, 0); - XCTAssertEqual([values[@"value"] boolValue], true); + XCTAssertGreaterThanOrEqual([values[@"value"] length], 1); + XCTAssertLessThanOrEqual([values[@"value"] length], 64); [expectation fulfill]; }]; [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTestSubscribe_OnOff_000005_Off +- (void)testSendClusterTest_TC_DM_1_1_000009_ReadAttribute { - XCTestExpectation * expectation = [self expectationWithDescription:@"Turn Off the light to see attribute change"]; + XCTestExpectation * expectation = [self expectationWithDescription:@"Query SoftwareVersion"]; CHIPDevice * device = GetConnectedDevice(); dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:queue]; + CHIPTestBasic * cluster = [[CHIPTestBasic alloc] initWithDevice:device endpoint:0 queue:queue]; XCTAssertNotNil(cluster); - [cluster off:^(NSError * err, NSDictionary * values) { - NSLog(@"Turn Off the light to see attribute change Error: %@", err); - + [cluster readAttributeSoftwareVersionWithResponseHandler:^(NSError * err, NSDictionary * values) { + NSLog(@"Query SoftwareVersion Error: %@", err); + XCTAssertEqual(err.code, 0); [expectation fulfill]; @@ -3081,356 +3222,398 @@ - (void)testSendClusterTestSubscribe_OnOff_000005_Off [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTestSubscribe_OnOff_000006_WaitForReport +- (void)testSendClusterTest_TC_DM_1_1_000010_ReadAttribute { - XCTestExpectation * expectation = [self expectationWithDescription:@"Check for attribute report"]; + XCTestExpectation * expectation = [self expectationWithDescription:@"Query SoftwareVersionString"]; CHIPDevice * device = GetConnectedDevice(); dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:queue]; + CHIPTestBasic * cluster = [[CHIPTestBasic alloc] initWithDevice:device endpoint:0 queue:queue]; XCTAssertNotNil(cluster); - [cluster reportAttributeOnOffWithResponseHandler:^(NSError * err, NSDictionary * values) { - NSLog(@"Check for attribute report Error: %@", err); + [cluster readAttributeSoftwareVersionStringWithResponseHandler:^(NSError * err, NSDictionary * values) { + NSLog(@"Query SoftwareVersionString Error: %@", err); XCTAssertEqual(err.code, 0); - XCTAssertEqual([values[@"value"] boolValue], false); + XCTAssertGreaterThanOrEqual([values[@"value"] length], 1); + XCTAssertLessThanOrEqual([values[@"value"] length], 64); [expectation fulfill]; }]; [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } - -- (void)testSendClusterTest_TC_OO_1_1_000000_ReadAttribute +- (void)testSendClusterTest_TC_DM_1_1_000011_ReadAttribute { - XCTestExpectation * expectation = [self expectationWithDescription:@"read the global attribute: ClusterRevision"]; + XCTestExpectation * expectation = [self expectationWithDescription:@"Query ManufacturingDate"]; CHIPDevice * device = GetConnectedDevice(); dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:queue]; + CHIPTestBasic * cluster = [[CHIPTestBasic alloc] initWithDevice:device endpoint:0 queue:queue]; XCTAssertNotNil(cluster); - [cluster readAttributeClusterRevisionWithResponseHandler:^(NSError * err, NSDictionary * values) { - NSLog(@"read the global attribute: ClusterRevision Error: %@", err); + [cluster readAttributeManufacturingDateWithResponseHandler:^(NSError * err, NSDictionary * values) { + NSLog(@"Query ManufacturingDate Error: %@", err); + + if (err.code == CHIPErrorCodeUnsupportedAttribute) { + [expectation fulfill]; + return; + } XCTAssertEqual(err.code, 0); - XCTAssertEqual([values[@"value"] unsignedShortValue], 3U); + XCTAssertGreaterThanOrEqual([values[@"value"] length], 8); + XCTAssertLessThanOrEqual([values[@"value"] length], 16); [expectation fulfill]; }]; [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTest_TC_OO_1_1_000001_WriteAttribute +- (void)testSendClusterTest_TC_DM_1_1_000012_ReadAttribute { - XCTestExpectation * expectation = - [self expectationWithDescription:@"write the default values to mandatory global attribute: ClusterRevision"]; + XCTestExpectation * expectation = [self expectationWithDescription:@"Query PartNumber"]; CHIPDevice * device = GetConnectedDevice(); dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:queue]; + CHIPTestBasic * cluster = [[CHIPTestBasic alloc] initWithDevice:device endpoint:0 queue:queue]; XCTAssertNotNil(cluster); - uint16_t clusterRevisionArgument = 3U; - [cluster - writeAttributeClusterRevisionWithValue:clusterRevisionArgument - responseHandler:^(NSError * err, NSDictionary * values) { - NSLog(@"write the default values to mandatory global attribute: ClusterRevision Error: %@", err); + [cluster readAttributePartNumberWithResponseHandler:^(NSError * err, NSDictionary * values) { + NSLog(@"Query PartNumber Error: %@", err); - XCTAssertEqual(err.code, 1); - [expectation fulfill]; - }]; + if (err.code == CHIPErrorCodeUnsupportedAttribute) { + [expectation fulfill]; + return; + } + + XCTAssertEqual(err.code, 0); + + XCTAssertLessThanOrEqual([values[@"value"] length], 32); + + [expectation fulfill]; + }]; [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTest_TC_OO_1_1_000002_ReadAttribute +- (void)testSendClusterTest_TC_DM_1_1_000013_ReadAttribute { - XCTestExpectation * expectation = [self expectationWithDescription:@"reads back global attribute: ClusterRevision"]; + XCTestExpectation * expectation = [self expectationWithDescription:@"Query ProductURL"]; CHIPDevice * device = GetConnectedDevice(); dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:queue]; + CHIPTestBasic * cluster = [[CHIPTestBasic alloc] initWithDevice:device endpoint:0 queue:queue]; XCTAssertNotNil(cluster); - [cluster readAttributeClusterRevisionWithResponseHandler:^(NSError * err, NSDictionary * values) { - NSLog(@"reads back global attribute: ClusterRevision Error: %@", err); + [cluster readAttributeProductURLWithResponseHandler:^(NSError * err, NSDictionary * values) { + NSLog(@"Query ProductURL Error: %@", err); + + if (err.code == CHIPErrorCodeUnsupportedAttribute) { + [expectation fulfill]; + return; + } XCTAssertEqual(err.code, 0); - XCTAssertEqual([values[@"value"] unsignedShortValue], 3U); + XCTAssertLessThanOrEqual([values[@"value"] length], 256); [expectation fulfill]; }]; [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTest_TC_OO_1_1_000003_ReadAttribute +- (void)testSendClusterTest_TC_DM_1_1_000014_ReadAttribute { - XCTestExpectation * expectation = [self expectationWithDescription:@"read the optional global attribute: FeatureMap"]; + XCTestExpectation * expectation = [self expectationWithDescription:@"Query ProductLabel"]; CHIPDevice * device = GetConnectedDevice(); dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:queue]; + CHIPTestBasic * cluster = [[CHIPTestBasic alloc] initWithDevice:device endpoint:0 queue:queue]; XCTAssertNotNil(cluster); - [cluster readAttributeFeatureMapWithResponseHandler:^(NSError * err, NSDictionary * values) { - NSLog(@"read the optional global attribute: FeatureMap Error: %@", err); + [cluster readAttributeProductLabelWithResponseHandler:^(NSError * err, NSDictionary * values) { + NSLog(@"Query ProductLabel Error: %@", err); + + if (err.code == CHIPErrorCodeUnsupportedAttribute) { + [expectation fulfill]; + return; + } XCTAssertEqual(err.code, 0); - XCTAssertEqual([values[@"value"] unsignedLongValue], 0UL); + XCTAssertLessThanOrEqual([values[@"value"] length], 64); [expectation fulfill]; }]; [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTest_TC_OO_1_1_000004_WriteAttribute +- (void)testSendClusterTest_TC_DM_1_1_000015_ReadAttribute { - XCTestExpectation * expectation = - [self expectationWithDescription:@"write the default values to optional global attribute: FeatureMap"]; + XCTestExpectation * expectation = [self expectationWithDescription:@"Query SerialNumber"]; CHIPDevice * device = GetConnectedDevice(); dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:queue]; + CHIPTestBasic * cluster = [[CHIPTestBasic alloc] initWithDevice:device endpoint:0 queue:queue]; XCTAssertNotNil(cluster); - uint32_t featureMapArgument = 0UL; - [cluster writeAttributeFeatureMapWithValue:featureMapArgument - responseHandler:^(NSError * err, NSDictionary * values) { - NSLog(@"write the default values to optional global attribute: FeatureMap Error: %@", err); + [cluster readAttributeSerialNumberWithResponseHandler:^(NSError * err, NSDictionary * values) { + NSLog(@"Query SerialNumber Error: %@", err); - XCTAssertEqual(err.code, 1); - [expectation fulfill]; - }]; + if (err.code == CHIPErrorCodeUnsupportedAttribute) { + [expectation fulfill]; + return; + } + + XCTAssertEqual(err.code, 0); + + XCTAssertLessThanOrEqual([values[@"value"] length], 32); + + [expectation fulfill]; + }]; [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTest_TC_OO_1_1_000005_ReadAttribute +- (void)testSendClusterTest_TC_DM_1_1_000016_ReadAttribute { - XCTestExpectation * expectation = [self expectationWithDescription:@"reads back optional global attribute: FeatureMap"]; + XCTestExpectation * expectation = [self expectationWithDescription:@"Query LocalConfigDisabled"]; CHIPDevice * device = GetConnectedDevice(); dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:queue]; + CHIPTestBasic * cluster = [[CHIPTestBasic alloc] initWithDevice:device endpoint:0 queue:queue]; XCTAssertNotNil(cluster); - [cluster readAttributeFeatureMapWithResponseHandler:^(NSError * err, NSDictionary * values) { - NSLog(@"reads back optional global attribute: FeatureMap Error: %@", err); + [cluster readAttributeLocalConfigDisabledWithResponseHandler:^(NSError * err, NSDictionary * values) { + NSLog(@"Query LocalConfigDisabled Error: %@", err); - XCTAssertEqual(err.code, 0); + if (err.code == CHIPErrorCodeUnsupportedAttribute) { + [expectation fulfill]; + return; + } - XCTAssertEqual([values[@"value"] unsignedLongValue], 0UL); + XCTAssertEqual(err.code, 0); [expectation fulfill]; }]; [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } - -- (void)testSendClusterTest_TC_OO_2_1_000000_ReadAttribute +- (void)testSendClusterTest_TC_DM_1_1_000017_ReadAttribute { - XCTestExpectation * expectation = [self expectationWithDescription:@"read the mandatory attribute: OnOff"]; + XCTestExpectation * expectation = [self expectationWithDescription:@"Query Reachable"]; CHIPDevice * device = GetConnectedDevice(); dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:queue]; + CHIPTestBasic * cluster = [[CHIPTestBasic alloc] initWithDevice:device endpoint:0 queue:queue]; XCTAssertNotNil(cluster); - [cluster readAttributeOnOffWithResponseHandler:^(NSError * err, NSDictionary * values) { - NSLog(@"read the mandatory attribute: OnOff Error: %@", err); + [cluster readAttributeReachableWithResponseHandler:^(NSError * err, NSDictionary * values) { + NSLog(@"Query Reachable Error: %@", err); - XCTAssertEqual(err.code, 0); + if (err.code == CHIPErrorCodeUnsupportedAttribute) { + [expectation fulfill]; + return; + } - XCTAssertEqual([values[@"value"] boolValue], 0); + XCTAssertEqual(err.code, 0); [expectation fulfill]; }]; [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTest_TC_OO_2_1_000001_ReadAttribute + +- (void)testSendClusterTest_TC_FLW_1_1_000000_WriteAttribute { - XCTestExpectation * expectation = [self expectationWithDescription:@"reads back mandatory attribute: OnOff"]; + XCTestExpectation * expectation = + [self expectationWithDescription:@"write the default values to mandatory global attribute: ClusterRevision"]; CHIPDevice * device = GetConnectedDevice(); dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:queue]; + CHIPTestFlowMeasurement * cluster = [[CHIPTestFlowMeasurement alloc] initWithDevice:device endpoint:1 queue:queue]; XCTAssertNotNil(cluster); - [cluster readAttributeOnOffWithResponseHandler:^(NSError * err, NSDictionary * values) { - NSLog(@"reads back mandatory attribute: OnOff Error: %@", err); - - XCTAssertEqual(err.code, 0); - - XCTAssertEqual([values[@"value"] boolValue], 0); + uint16_t clusterRevisionArgument = 2U; + [cluster + writeAttributeClusterRevisionWithValue:clusterRevisionArgument + responseHandler:^(NSError * err, NSDictionary * values) { + NSLog(@"write the default values to mandatory global attribute: ClusterRevision Error: %@", err); - [expectation fulfill]; - }]; + XCTAssertEqual(err.code, 1); + [expectation fulfill]; + }]; [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTest_TC_OO_2_1_000002_ReadAttribute + +- (void)testSendClusterTest_TC_LVL_1_1_000000_WriteAttribute { - XCTestExpectation * expectation = [self expectationWithDescription:@"read LT attribute: GlobalSceneControl"]; + XCTestExpectation * expectation = + [self expectationWithDescription:@"write the default values to mandatory global attribute: ClusterRevision"]; CHIPDevice * device = GetConnectedDevice(); dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:queue]; + CHIPTestLevelControl * cluster = [[CHIPTestLevelControl alloc] initWithDevice:device endpoint:1 queue:queue]; XCTAssertNotNil(cluster); - [cluster readAttributeGlobalSceneControlWithResponseHandler:^(NSError * err, NSDictionary * values) { - NSLog(@"read LT attribute: GlobalSceneControl Error: %@", err); - - XCTAssertEqual(err.code, 0); - - XCTAssertEqual([values[@"value"] boolValue], 1); + uint16_t clusterRevisionArgument = 4U; + [cluster + writeAttributeClusterRevisionWithValue:clusterRevisionArgument + responseHandler:^(NSError * err, NSDictionary * values) { + NSLog(@"write the default values to mandatory global attribute: ClusterRevision Error: %@", err); - [expectation fulfill]; - }]; + XCTAssertEqual(err.code, 1); + [expectation fulfill]; + }]; [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTest_TC_OO_2_1_000003_ReadAttribute + +- (void)testSendClusterTest_TC_LVL_2_1_000000_ReadAttribute { - XCTestExpectation * expectation = [self expectationWithDescription:@"read LT attribute: OnTime"]; + XCTestExpectation * expectation = [self expectationWithDescription:@"reads current Level attribute from DUT"]; CHIPDevice * device = GetConnectedDevice(); dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:queue]; + CHIPTestLevelControl * cluster = [[CHIPTestLevelControl alloc] initWithDevice:device endpoint:1 queue:queue]; XCTAssertNotNil(cluster); - [cluster readAttributeOnTimeWithResponseHandler:^(NSError * err, NSDictionary * values) { - NSLog(@"read LT attribute: OnTime Error: %@", err); + [cluster readAttributeCurrentLevelWithResponseHandler:^(NSError * err, NSDictionary * values) { + NSLog(@"reads current Level attribute from DUT Error: %@", err); XCTAssertEqual(err.code, 0); - XCTAssertEqual([values[@"value"] unsignedShortValue], 0U); + XCTAssertEqual([values[@"value"] unsignedCharValue], 0); [expectation fulfill]; }]; [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTest_TC_OO_2_1_000004_ReadAttribute +- (void)testSendClusterTest_TC_LVL_2_1_000001_MoveToLevel { - XCTestExpectation * expectation = [self expectationWithDescription:@"read LT attribute: OffWaitTime"]; + XCTestExpectation * expectation = [self expectationWithDescription:@"sends a Move to level command"]; CHIPDevice * device = GetConnectedDevice(); dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:queue]; + CHIPTestLevelControl * cluster = [[CHIPTestLevelControl alloc] initWithDevice:device endpoint:1 queue:queue]; XCTAssertNotNil(cluster); - [cluster readAttributeOffWaitTimeWithResponseHandler:^(NSError * err, NSDictionary * values) { - NSLog(@"read LT attribute: OffWaitTime Error: %@", err); + uint8_t levelArgument = 64; + uint16_t transitionTimeArgument = 0U; + uint8_t optionMaskArgument = 1; + uint8_t optionOverrideArgument = 1; + [cluster moveToLevel:levelArgument + transitionTime:transitionTimeArgument + optionMask:optionMaskArgument + optionOverride:optionOverrideArgument + responseHandler:^(NSError * err, NSDictionary * values) { + NSLog(@"sends a Move to level command Error: %@", err); - XCTAssertEqual(err.code, 0); + XCTAssertEqual(err.code, 0); - XCTAssertEqual([values[@"value"] unsignedShortValue], 0U); + [expectation fulfill]; + }]; - [expectation fulfill]; - }]; + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} +- (void)testSendClusterTest_TC_LVL_2_1_000002_WaitForMs +{ + XCTestExpectation * expectation = [self expectationWithDescription:@"Wait 10ms"]; + dispatch_queue_t queue = dispatch_get_main_queue(); + WaitForMs(expectation, queue, 10); [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTest_TC_OO_2_1_000005_ReadAttribute +- (void)testSendClusterTest_TC_LVL_2_1_000003_ReadAttribute { - XCTestExpectation * expectation = [self expectationWithDescription:@"read LT attribute: StartUpOnOff"]; + XCTestExpectation * expectation = [self expectationWithDescription:@"reads current Level attribute from DUT"]; CHIPDevice * device = GetConnectedDevice(); dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:queue]; + CHIPTestLevelControl * cluster = [[CHIPTestLevelControl alloc] initWithDevice:device endpoint:1 queue:queue]; XCTAssertNotNil(cluster); - [cluster readAttributeStartUpOnOffWithResponseHandler:^(NSError * err, NSDictionary * values) { - NSLog(@"read LT attribute: StartUpOnOff Error: %@", err); + [cluster readAttributeCurrentLevelWithResponseHandler:^(NSError * err, NSDictionary * values) { + NSLog(@"reads current Level attribute from DUT Error: %@", err); XCTAssertEqual(err.code, 0); - XCTAssertEqual([values[@"value"] unsignedCharValue], 0); + XCTAssertEqual([values[@"value"] unsignedCharValue], 64); [expectation fulfill]; }]; [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTest_TC_OO_2_1_000006_WriteAttribute +- (void)testSendClusterTest_TC_LVL_2_1_000004_MoveToLevel { - XCTestExpectation * expectation = [self expectationWithDescription:@"write the default value to LT attribute: OnTime"]; + XCTestExpectation * expectation = [self expectationWithDescription:@"sends a Move to level command"]; CHIPDevice * device = GetConnectedDevice(); dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:queue]; + CHIPTestLevelControl * cluster = [[CHIPTestLevelControl alloc] initWithDevice:device endpoint:1 queue:queue]; XCTAssertNotNil(cluster); - uint16_t onTimeArgument = 0U; - [cluster writeAttributeOnTimeWithValue:onTimeArgument - responseHandler:^(NSError * err, NSDictionary * values) { - NSLog(@"write the default value to LT attribute: OnTime Error: %@", err); + uint8_t levelArgument = 128; + uint16_t transitionTimeArgument = 1U; + uint8_t optionMaskArgument = 1; + uint8_t optionOverrideArgument = 1; + [cluster moveToLevel:levelArgument + transitionTime:transitionTimeArgument + optionMask:optionMaskArgument + optionOverride:optionOverrideArgument + responseHandler:^(NSError * err, NSDictionary * values) { + NSLog(@"sends a Move to level command Error: %@", err); - XCTAssertEqual(err.code, 0); + XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; + [expectation fulfill]; + }]; [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTest_TC_OO_2_1_000007_WriteAttribute +- (void)testSendClusterTest_TC_LVL_2_1_000005_WaitForMs { - XCTestExpectation * expectation = [self expectationWithDescription:@"write the default value to LT attribute: OffWaitTime"]; + XCTestExpectation * expectation = [self expectationWithDescription:@"Wait 100ms"]; - CHIPDevice * device = GetConnectedDevice(); dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - uint16_t offWaitTimeArgument = 0U; - [cluster writeAttributeOffWaitTimeWithValue:offWaitTimeArgument - responseHandler:^(NSError * err, NSDictionary * values) { - NSLog(@"write the default value to LT attribute: OffWaitTime Error: %@", err); - - XCTAssertEqual(err.code, 0); - - [expectation fulfill]; - }]; - + WaitForMs(expectation, queue, 100); [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTest_TC_OO_2_1_000008_WriteAttribute +- (void)testSendClusterTest_TC_LVL_2_1_000006_ReadAttribute { - XCTestExpectation * expectation = [self expectationWithDescription:@"write the default value to LT attribute: StartUpOnOff"]; + XCTestExpectation * expectation = [self expectationWithDescription:@"reads current Level attribute from DUT"]; CHIPDevice * device = GetConnectedDevice(); dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:queue]; + CHIPTestLevelControl * cluster = [[CHIPTestLevelControl alloc] initWithDevice:device endpoint:1 queue:queue]; XCTAssertNotNil(cluster); - uint8_t startUpOnOffArgument = 0; - [cluster writeAttributeStartUpOnOffWithValue:startUpOnOffArgument - responseHandler:^(NSError * err, NSDictionary * values) { - NSLog(@"write the default value to LT attribute: StartUpOnOff Error: %@", err); + [cluster readAttributeCurrentLevelWithResponseHandler:^(NSError * err, NSDictionary * values) { + NSLog(@"reads current Level attribute from DUT Error: %@", err); - XCTAssertEqual(err.code, 0); + XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; + XCTAssertEqual([values[@"value"] unsignedCharValue], 128); + + [expectation fulfill]; + }]; [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTest_TC_OO_2_1_000009_ReadAttribute +- (void)testSendClusterTest_TC_LVL_2_1_000007_ReadAttribute { - XCTestExpectation * expectation = [self expectationWithDescription:@"reads back LT attribute: OnTime"]; + XCTestExpectation * expectation = [self expectationWithDescription:@"reads On Off Transition Time attribute from DUT"]; CHIPDevice * device = GetConnectedDevice(); dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:queue]; + CHIPTestLevelControl * cluster = [[CHIPTestLevelControl alloc] initWithDevice:device endpoint:1 queue:queue]; XCTAssertNotNil(cluster); - [cluster readAttributeOnTimeWithResponseHandler:^(NSError * err, NSDictionary * values) { - NSLog(@"reads back LT attribute: OnTime Error: %@", err); + [cluster readAttributeOnOffTransitionTimeWithResponseHandler:^(NSError * err, NSDictionary * values) { + NSLog(@"reads On Off Transition Time attribute from DUT Error: %@", err); XCTAssertEqual(err.code, 0); @@ -3441,325 +3624,365 @@ - (void)testSendClusterTest_TC_OO_2_1_000009_ReadAttribute [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTest_TC_OO_2_1_000010_ReadAttribute +- (void)testSendClusterTest_TC_LVL_2_1_000008_MoveToLevel { - XCTestExpectation * expectation = [self expectationWithDescription:@"reads back LT attribute: OffWaitTime"]; + XCTestExpectation * expectation = [self expectationWithDescription:@"sends a Move to level command"]; CHIPDevice * device = GetConnectedDevice(); dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:queue]; + CHIPTestLevelControl * cluster = [[CHIPTestLevelControl alloc] initWithDevice:device endpoint:1 queue:queue]; XCTAssertNotNil(cluster); - [cluster readAttributeOffWaitTimeWithResponseHandler:^(NSError * err, NSDictionary * values) { - NSLog(@"reads back LT attribute: OffWaitTime Error: %@", err); + uint8_t levelArgument = 254; + uint16_t transitionTimeArgument = 65535U; + uint8_t optionMaskArgument = 1; + uint8_t optionOverrideArgument = 1; + [cluster moveToLevel:levelArgument + transitionTime:transitionTimeArgument + optionMask:optionMaskArgument + optionOverride:optionOverrideArgument + responseHandler:^(NSError * err, NSDictionary * values) { + NSLog(@"sends a Move to level command Error: %@", err); - XCTAssertEqual(err.code, 0); + XCTAssertEqual(err.code, 0); - XCTAssertEqual([values[@"value"] unsignedShortValue], 0U); + [expectation fulfill]; + }]; - [expectation fulfill]; - }]; + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} +- (void)testSendClusterTest_TC_LVL_2_1_000009_WaitForMs +{ + XCTestExpectation * expectation = [self expectationWithDescription:@"Wait 1ms"]; + dispatch_queue_t queue = dispatch_get_main_queue(); + WaitForMs(expectation, queue, 1); [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTest_TC_OO_2_1_000011_ReadAttribute +- (void)testSendClusterTest_TC_LVL_2_1_000010_ReadAttribute { - XCTestExpectation * expectation = [self expectationWithDescription:@"reads back LT attribute: StartUpOnOff"]; + XCTestExpectation * expectation = [self expectationWithDescription:@"reads current Level attribute from DUT"]; CHIPDevice * device = GetConnectedDevice(); dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:queue]; + CHIPTestLevelControl * cluster = [[CHIPTestLevelControl alloc] initWithDevice:device endpoint:1 queue:queue]; XCTAssertNotNil(cluster); - [cluster readAttributeStartUpOnOffWithResponseHandler:^(NSError * err, NSDictionary * values) { - NSLog(@"reads back LT attribute: StartUpOnOff Error: %@", err); + [cluster readAttributeCurrentLevelWithResponseHandler:^(NSError * err, NSDictionary * values) { + NSLog(@"reads current Level attribute from DUT Error: %@", err); XCTAssertEqual(err.code, 0); - XCTAssertEqual([values[@"value"] unsignedCharValue], 0); + XCTAssertEqual([values[@"value"] unsignedCharValue], 254); [expectation fulfill]; }]; [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } - -- (void)testSendClusterTest_TC_OO_2_2_000000_Off +- (void)testSendClusterTest_TC_LVL_2_1_000011_MoveToLevel { - XCTestExpectation * expectation = [self expectationWithDescription:@"Send Off Command"]; + XCTestExpectation * expectation = [self expectationWithDescription:@"Reset level to 0"]; CHIPDevice * device = GetConnectedDevice(); dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:queue]; + CHIPTestLevelControl * cluster = [[CHIPTestLevelControl alloc] initWithDevice:device endpoint:1 queue:queue]; XCTAssertNotNil(cluster); - [cluster off:^(NSError * err, NSDictionary * values) { - NSLog(@"Send Off Command Error: %@", err); + uint8_t levelArgument = 0; + uint16_t transitionTimeArgument = 0U; + uint8_t optionMaskArgument = 1; + uint8_t optionOverrideArgument = 1; + [cluster moveToLevel:levelArgument + transitionTime:transitionTimeArgument + optionMask:optionMaskArgument + optionOverride:optionOverrideArgument + responseHandler:^(NSError * err, NSDictionary * values) { + NSLog(@"Reset level to 0 Error: %@", err); - XCTAssertEqual(err.code, 0); + XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; + [expectation fulfill]; + }]; [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTest_TC_OO_2_2_000001_ReadAttribute +- (void)testSendClusterTest_TC_LVL_2_1_000012_WaitForMs { - XCTestExpectation * expectation = [self expectationWithDescription:@"Check on/off attribute value is false after off command"]; + XCTestExpectation * expectation = [self expectationWithDescription:@"Wait 10ms"]; - CHIPDevice * device = GetConnectedDevice(); dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeOnOffWithResponseHandler:^(NSError * err, NSDictionary * values) { - NSLog(@"Check on/off attribute value is false after off command Error: %@", err); - - XCTAssertEqual(err.code, 0); - - XCTAssertEqual([values[@"value"] boolValue], 0); - - [expectation fulfill]; - }]; - + WaitForMs(expectation, queue, 10); [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTest_TC_OO_2_2_000002_On + +- (void)testSendClusterTest_TC_LVL_3_1_000000_ReadAttribute { - XCTestExpectation * expectation = [self expectationWithDescription:@"Send On Command"]; + XCTestExpectation * expectation = [self expectationWithDescription:@"reads current level attribute from DUT"]; CHIPDevice * device = GetConnectedDevice(); dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:queue]; + CHIPTestLevelControl * cluster = [[CHIPTestLevelControl alloc] initWithDevice:device endpoint:1 queue:queue]; XCTAssertNotNil(cluster); - [cluster on:^(NSError * err, NSDictionary * values) { - NSLog(@"Send On Command Error: %@", err); + [cluster readAttributeCurrentLevelWithResponseHandler:^(NSError * err, NSDictionary * values) { + NSLog(@"reads current level attribute from DUT Error: %@", err); XCTAssertEqual(err.code, 0); + XCTAssertEqual([values[@"value"] unsignedCharValue], 0); + [expectation fulfill]; }]; [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTest_TC_OO_2_2_000003_ReadAttribute +- (void)testSendClusterTest_TC_LVL_3_1_000001_ReadAttribute { - XCTestExpectation * expectation = [self expectationWithDescription:@"Check on/off attribute value is true after on command"]; + XCTestExpectation * expectation = [self expectationWithDescription:@"reads max level attribute from DUT"]; CHIPDevice * device = GetConnectedDevice(); dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:queue]; + CHIPTestLevelControl * cluster = [[CHIPTestLevelControl alloc] initWithDevice:device endpoint:1 queue:queue]; XCTAssertNotNil(cluster); - [cluster readAttributeOnOffWithResponseHandler:^(NSError * err, NSDictionary * values) { - NSLog(@"Check on/off attribute value is true after on command Error: %@", err); + [cluster readAttributeMaxLevelWithResponseHandler:^(NSError * err, NSDictionary * values) { + NSLog(@"reads max level attribute from DUT Error: %@", err); XCTAssertEqual(err.code, 0); - XCTAssertEqual([values[@"value"] boolValue], 1); + XCTAssertEqual([values[@"value"] unsignedCharValue], 255); [expectation fulfill]; }]; [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTest_TC_OO_2_2_000004_Off +- (void)testSendClusterTest_TC_LVL_3_1_000002_Move { - XCTestExpectation * expectation = [self expectationWithDescription:@"Send Off Command"]; + XCTestExpectation * expectation = [self expectationWithDescription:@"sends a Move up command"]; CHIPDevice * device = GetConnectedDevice(); dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:queue]; + CHIPTestLevelControl * cluster = [[CHIPTestLevelControl alloc] initWithDevice:device endpoint:1 queue:queue]; XCTAssertNotNil(cluster); - [cluster off:^(NSError * err, NSDictionary * values) { - NSLog(@"Send Off Command Error: %@", err); + uint8_t moveModeArgument = 0; + uint8_t rateArgument = 200; + uint8_t optionMaskArgument = 1; + uint8_t optionOverrideArgument = 1; + [cluster move:moveModeArgument + rate:rateArgument + optionMask:optionMaskArgument + optionOverride:optionOverrideArgument + responseHandler:^(NSError * err, NSDictionary * values) { + NSLog(@"sends a Move up command Error: %@", err); - XCTAssertEqual(err.code, 0); + XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; + [expectation fulfill]; + }]; [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTest_TC_OO_2_2_000005_ReadAttribute +- (void)testSendClusterTest_TC_LVL_3_1_000003_WaitForMs { - XCTestExpectation * expectation = [self expectationWithDescription:@"Check on/off attribute value is false after off command"]; + XCTestExpectation * expectation = [self expectationWithDescription:@"Wait 2500ms"]; - CHIPDevice * device = GetConnectedDevice(); dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeOnOffWithResponseHandler:^(NSError * err, NSDictionary * values) { - NSLog(@"Check on/off attribute value is false after off command Error: %@", err); - - XCTAssertEqual(err.code, 0); - - XCTAssertEqual([values[@"value"] boolValue], 0); - - [expectation fulfill]; - }]; - + WaitForMs(expectation, queue, 2500); [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTest_TC_OO_2_2_000006_Toggle +- (void)testSendClusterTest_TC_LVL_3_1_000004_ReadAttribute { - XCTestExpectation * expectation = [self expectationWithDescription:@"Send Toggle Command"]; + XCTestExpectation * expectation = [self expectationWithDescription:@"reads current level attribute from DUT"]; CHIPDevice * device = GetConnectedDevice(); dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:queue]; + CHIPTestLevelControl * cluster = [[CHIPTestLevelControl alloc] initWithDevice:device endpoint:1 queue:queue]; XCTAssertNotNil(cluster); - [cluster toggle:^(NSError * err, NSDictionary * values) { - NSLog(@"Send Toggle Command Error: %@", err); + [cluster readAttributeCurrentLevelWithResponseHandler:^(NSError * err, NSDictionary * values) { + NSLog(@"reads current level attribute from DUT Error: %@", err); XCTAssertEqual(err.code, 0); + XCTAssertEqual([values[@"value"] unsignedCharValue], 255); + [expectation fulfill]; }]; [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTest_TC_OO_2_2_000007_ReadAttribute -{ - XCTestExpectation * expectation = - [self expectationWithDescription:@"Check on/off attribute value is true after toggle command"]; +- (void)testSendClusterTest_TC_LVL_3_1_000005_ReadAttribute +{ + XCTestExpectation * expectation = [self expectationWithDescription:@"reads min level attribute from DUT"]; CHIPDevice * device = GetConnectedDevice(); dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:queue]; + CHIPTestLevelControl * cluster = [[CHIPTestLevelControl alloc] initWithDevice:device endpoint:1 queue:queue]; XCTAssertNotNil(cluster); - [cluster readAttributeOnOffWithResponseHandler:^(NSError * err, NSDictionary * values) { - NSLog(@"Check on/off attribute value is true after toggle command Error: %@", err); + [cluster readAttributeMinLevelWithResponseHandler:^(NSError * err, NSDictionary * values) { + NSLog(@"reads min level attribute from DUT Error: %@", err); XCTAssertEqual(err.code, 0); - XCTAssertEqual([values[@"value"] boolValue], 1); + XCTAssertEqual([values[@"value"] unsignedCharValue], 0); [expectation fulfill]; }]; [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTest_TC_OO_2_2_000008_Toggle +- (void)testSendClusterTest_TC_LVL_3_1_000006_Move { - XCTestExpectation * expectation = [self expectationWithDescription:@"Send Toggle Command"]; + XCTestExpectation * expectation = [self expectationWithDescription:@"sends a Move down command"]; CHIPDevice * device = GetConnectedDevice(); dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:queue]; + CHIPTestLevelControl * cluster = [[CHIPTestLevelControl alloc] initWithDevice:device endpoint:1 queue:queue]; XCTAssertNotNil(cluster); - [cluster toggle:^(NSError * err, NSDictionary * values) { - NSLog(@"Send Toggle Command Error: %@", err); + uint8_t moveModeArgument = 1; + uint8_t rateArgument = 250; + uint8_t optionMaskArgument = 1; + uint8_t optionOverrideArgument = 1; + [cluster move:moveModeArgument + rate:rateArgument + optionMask:optionMaskArgument + optionOverride:optionOverrideArgument + responseHandler:^(NSError * err, NSDictionary * values) { + NSLog(@"sends a Move down command Error: %@", err); - XCTAssertEqual(err.code, 0); + XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; + [expectation fulfill]; + }]; [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTest_TC_OO_2_2_000009_ReadAttribute +- (void)testSendClusterTest_TC_LVL_3_1_000007_WaitForMs { - XCTestExpectation * expectation = - [self expectationWithDescription:@"Check on/off attribute value is false after toggle command"]; + XCTestExpectation * expectation = [self expectationWithDescription:@"Wait 2500ms"]; + + dispatch_queue_t queue = dispatch_get_main_queue(); + WaitForMs(expectation, queue, 2500); + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} +- (void)testSendClusterTest_TC_LVL_3_1_000008_ReadAttribute +{ + XCTestExpectation * expectation = [self expectationWithDescription:@"reads current level attribute from DUT"]; CHIPDevice * device = GetConnectedDevice(); dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:queue]; + CHIPTestLevelControl * cluster = [[CHIPTestLevelControl alloc] initWithDevice:device endpoint:1 queue:queue]; XCTAssertNotNil(cluster); - [cluster readAttributeOnOffWithResponseHandler:^(NSError * err, NSDictionary * values) { - NSLog(@"Check on/off attribute value is false after toggle command Error: %@", err); + [cluster readAttributeCurrentLevelWithResponseHandler:^(NSError * err, NSDictionary * values) { + NSLog(@"reads current level attribute from DUT Error: %@", err); XCTAssertEqual(err.code, 0); - XCTAssertEqual([values[@"value"] boolValue], 0); + XCTAssertEqual([values[@"value"] unsignedCharValue], 0); [expectation fulfill]; }]; [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTest_TC_OO_2_2_000010_On +- (void)testSendClusterTest_TC_LVL_3_1_000009_WriteAttribute { - XCTestExpectation * expectation = [self expectationWithDescription:@"Send On Command"]; + XCTestExpectation * expectation = [self expectationWithDescription:@"Write default move rate attribute from DUT"]; CHIPDevice * device = GetConnectedDevice(); dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:queue]; + CHIPTestLevelControl * cluster = [[CHIPTestLevelControl alloc] initWithDevice:device endpoint:1 queue:queue]; XCTAssertNotNil(cluster); - [cluster on:^(NSError * err, NSDictionary * values) { - NSLog(@"Send On Command Error: %@", err); + uint8_t defaultMoveRateArgument = 20; + [cluster writeAttributeDefaultMoveRateWithValue:defaultMoveRateArgument + responseHandler:^(NSError * err, NSDictionary * values) { + NSLog(@"Write default move rate attribute from DUT Error: %@", err); - XCTAssertEqual(err.code, 0); + XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; + [expectation fulfill]; + }]; [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTest_TC_OO_2_2_000011_ReadAttribute +- (void)testSendClusterTest_TC_LVL_3_1_000010_ReadAttribute { - XCTestExpectation * expectation = [self expectationWithDescription:@"Check on/off attribute value is true after on command"]; + XCTestExpectation * expectation = [self expectationWithDescription:@"reads default move rate attribute from DUT"]; CHIPDevice * device = GetConnectedDevice(); dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:queue]; + CHIPTestLevelControl * cluster = [[CHIPTestLevelControl alloc] initWithDevice:device endpoint:1 queue:queue]; XCTAssertNotNil(cluster); - [cluster readAttributeOnOffWithResponseHandler:^(NSError * err, NSDictionary * values) { - NSLog(@"Check on/off attribute value is true after on command Error: %@", err); + [cluster readAttributeDefaultMoveRateWithResponseHandler:^(NSError * err, NSDictionary * values) { + NSLog(@"reads default move rate attribute from DUT Error: %@", err); XCTAssertEqual(err.code, 0); - XCTAssertEqual([values[@"value"] boolValue], 1); + XCTAssertEqual([values[@"value"] unsignedCharValue], 20); [expectation fulfill]; }]; [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTest_TC_OO_2_2_000012_Off +- (void)testSendClusterTest_TC_LVL_3_1_000011_Move { - XCTestExpectation * expectation = [self expectationWithDescription:@"Send Off Command"]; + XCTestExpectation * expectation = [self expectationWithDescription:@"sends a Move up command at default move rate"]; CHIPDevice * device = GetConnectedDevice(); dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:queue]; + CHIPTestLevelControl * cluster = [[CHIPTestLevelControl alloc] initWithDevice:device endpoint:1 queue:queue]; XCTAssertNotNil(cluster); - [cluster off:^(NSError * err, NSDictionary * values) { - NSLog(@"Send Off Command Error: %@", err); + uint8_t moveModeArgument = 1; + uint8_t rateArgument = 255; + uint8_t optionMaskArgument = 1; + uint8_t optionOverrideArgument = 1; + [cluster move:moveModeArgument + rate:rateArgument + optionMask:optionMaskArgument + optionOverride:optionOverrideArgument + responseHandler:^(NSError * err, NSDictionary * values) { + NSLog(@"sends a Move up command at default move rate Error: %@", err); - XCTAssertEqual(err.code, 0); + XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; + [expectation fulfill]; + }]; [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTest_TC_OO_2_2_000013_ReadAttribute +- (void)testSendClusterTest_TC_LVL_3_1_000012_WaitForMs { - XCTestExpectation * expectation = [self expectationWithDescription:@"Check on/off attribute value is false after off command"]; + XCTestExpectation * expectation = [self expectationWithDescription:@"Wait 10ms"]; + + dispatch_queue_t queue = dispatch_get_main_queue(); + WaitForMs(expectation, queue, 10); + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} +- (void)testSendClusterTest_TC_LVL_3_1_000013_ReadAttribute +{ + XCTestExpectation * expectation = [self expectationWithDescription:@"reads current level attribute from DUT"]; CHIPDevice * device = GetConnectedDevice(); dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:queue]; + CHIPTestLevelControl * cluster = [[CHIPTestLevelControl alloc] initWithDevice:device endpoint:1 queue:queue]; XCTAssertNotNil(cluster); - [cluster readAttributeOnOffWithResponseHandler:^(NSError * err, NSDictionary * values) { - NSLog(@"Check on/off attribute value is false after off command Error: %@", err); + [cluster readAttributeCurrentLevelWithResponseHandler:^(NSError * err, NSDictionary * values) { + NSLog(@"reads current level attribute from DUT Error: %@", err); XCTAssertEqual(err.code, 0); - XCTAssertEqual([values[@"value"] boolValue], 0); + XCTAssertNotEqual([values[@"value"] unsignedCharValue], 255); [expectation fulfill]; }]; @@ -3767,467 +3990,449 @@ - (void)testSendClusterTest_TC_OO_2_2_000013_ReadAttribute [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTest_TC_DM_1_1_000000_ReadAttribute +- (void)testSendClusterTest_TC_MC_1_1_000000_WriteAttribute { - XCTestExpectation * expectation = [self expectationWithDescription:@"Query Interaction Model Version"]; + XCTestExpectation * expectation = + [self expectationWithDescription:@"write the default values to mandatory global attribute: ClusterRevision"]; CHIPDevice * device = GetConnectedDevice(); dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestBasic * cluster = [[CHIPTestBasic alloc] initWithDevice:device endpoint:0 queue:queue]; + CHIPTestRelativeHumidityMeasurement * cluster = [[CHIPTestRelativeHumidityMeasurement alloc] initWithDevice:device + endpoint:1 + queue:queue]; XCTAssertNotNil(cluster); - [cluster readAttributeInteractionModelVersionWithResponseHandler:^(NSError * err, NSDictionary * values) { - NSLog(@"Query Interaction Model Version Error: %@", err); - - XCTAssertEqual(err.code, 0); + uint16_t clusterRevisionArgument = 1U; + [cluster + writeAttributeClusterRevisionWithValue:clusterRevisionArgument + responseHandler:^(NSError * err, NSDictionary * values) { + NSLog(@"write the default values to mandatory global attribute: ClusterRevision Error: %@", err); - [expectation fulfill]; - }]; + XCTAssertEqual(err.code, 1); + [expectation fulfill]; + }]; [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTest_TC_DM_1_1_000001_ReadAttribute + +- (void)testSendClusterTest_TC_OCC_1_1_000000_ReadAttribute { - XCTestExpectation * expectation = [self expectationWithDescription:@"Query Vendor Name"]; + XCTestExpectation * expectation = [self expectationWithDescription:@"read the global attribute: ClusterRevision"]; CHIPDevice * device = GetConnectedDevice(); dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestBasic * cluster = [[CHIPTestBasic alloc] initWithDevice:device endpoint:0 queue:queue]; + CHIPTestOccupancySensing * cluster = [[CHIPTestOccupancySensing alloc] initWithDevice:device endpoint:1 queue:queue]; XCTAssertNotNil(cluster); - [cluster readAttributeVendorNameWithResponseHandler:^(NSError * err, NSDictionary * values) { - NSLog(@"Query Vendor Name Error: %@", err); + [cluster readAttributeClusterRevisionWithResponseHandler:^(NSError * err, NSDictionary * values) { + NSLog(@"read the global attribute: ClusterRevision Error: %@", err); XCTAssertEqual(err.code, 0); - XCTAssertLessThanOrEqual([values[@"value"] length], 32); + XCTAssertEqual([values[@"value"] unsignedShortValue], 2U); [expectation fulfill]; }]; [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTest_TC_DM_1_1_000002_ReadAttribute +- (void)testSendClusterTest_TC_OCC_1_1_000001_WriteAttribute { - XCTestExpectation * expectation = [self expectationWithDescription:@"Query VendorID"]; + XCTestExpectation * expectation = + [self expectationWithDescription:@"write the default values to mandatory global attribute: ClusterRevision"]; CHIPDevice * device = GetConnectedDevice(); dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestBasic * cluster = [[CHIPTestBasic alloc] initWithDevice:device endpoint:0 queue:queue]; + CHIPTestOccupancySensing * cluster = [[CHIPTestOccupancySensing alloc] initWithDevice:device endpoint:1 queue:queue]; XCTAssertNotNil(cluster); - [cluster readAttributeVendorIDWithResponseHandler:^(NSError * err, NSDictionary * values) { - NSLog(@"Query VendorID Error: %@", err); - - XCTAssertEqual(err.code, 0); + uint16_t clusterRevisionArgument = 2U; + [cluster + writeAttributeClusterRevisionWithValue:clusterRevisionArgument + responseHandler:^(NSError * err, NSDictionary * values) { + NSLog(@"write the default values to mandatory global attribute: ClusterRevision Error: %@", err); - [expectation fulfill]; - }]; + XCTAssertEqual(err.code, 1); + [expectation fulfill]; + }]; [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTest_TC_DM_1_1_000003_ReadAttribute + +- (void)testSendClusterTest_TC_OO_1_1_000000_ReadAttribute { - XCTestExpectation * expectation = [self expectationWithDescription:@"Query Product Name"]; + XCTestExpectation * expectation = [self expectationWithDescription:@"read the global attribute: ClusterRevision"]; CHIPDevice * device = GetConnectedDevice(); dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestBasic * cluster = [[CHIPTestBasic alloc] initWithDevice:device endpoint:0 queue:queue]; + CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:queue]; XCTAssertNotNil(cluster); - [cluster readAttributeProductNameWithResponseHandler:^(NSError * err, NSDictionary * values) { - NSLog(@"Query Product Name Error: %@", err); + [cluster readAttributeClusterRevisionWithResponseHandler:^(NSError * err, NSDictionary * values) { + NSLog(@"read the global attribute: ClusterRevision Error: %@", err); XCTAssertEqual(err.code, 0); - XCTAssertLessThanOrEqual([values[@"value"] length], 32); + XCTAssertEqual([values[@"value"] unsignedShortValue], 3U); [expectation fulfill]; }]; [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTest_TC_DM_1_1_000004_ReadAttribute +- (void)testSendClusterTest_TC_OO_1_1_000001_WriteAttribute { - XCTestExpectation * expectation = [self expectationWithDescription:@"Query ProductID"]; + XCTestExpectation * expectation = + [self expectationWithDescription:@"write the default values to mandatory global attribute: ClusterRevision"]; CHIPDevice * device = GetConnectedDevice(); dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestBasic * cluster = [[CHIPTestBasic alloc] initWithDevice:device endpoint:0 queue:queue]; + CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:queue]; XCTAssertNotNil(cluster); - [cluster readAttributeProductIDWithResponseHandler:^(NSError * err, NSDictionary * values) { - NSLog(@"Query ProductID Error: %@", err); - - XCTAssertEqual(err.code, 0); + uint16_t clusterRevisionArgument = 3U; + [cluster + writeAttributeClusterRevisionWithValue:clusterRevisionArgument + responseHandler:^(NSError * err, NSDictionary * values) { + NSLog(@"write the default values to mandatory global attribute: ClusterRevision Error: %@", err); - [expectation fulfill]; - }]; + XCTAssertEqual(err.code, 1); + [expectation fulfill]; + }]; [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTest_TC_DM_1_1_000005_ReadAttribute +- (void)testSendClusterTest_TC_OO_1_1_000002_ReadAttribute { - XCTestExpectation * expectation = [self expectationWithDescription:@"Query User Label"]; + XCTestExpectation * expectation = [self expectationWithDescription:@"reads back global attribute: ClusterRevision"]; CHIPDevice * device = GetConnectedDevice(); dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestBasic * cluster = [[CHIPTestBasic alloc] initWithDevice:device endpoint:0 queue:queue]; + CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:queue]; XCTAssertNotNil(cluster); - [cluster readAttributeUserLabelWithResponseHandler:^(NSError * err, NSDictionary * values) { - NSLog(@"Query User Label Error: %@", err); + [cluster readAttributeClusterRevisionWithResponseHandler:^(NSError * err, NSDictionary * values) { + NSLog(@"reads back global attribute: ClusterRevision Error: %@", err); XCTAssertEqual(err.code, 0); - XCTAssertLessThanOrEqual([values[@"value"] length], 32); + XCTAssertEqual([values[@"value"] unsignedShortValue], 3U); [expectation fulfill]; }]; [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTest_TC_DM_1_1_000006_ReadAttribute +- (void)testSendClusterTest_TC_OO_1_1_000003_ReadAttribute { - XCTestExpectation * expectation = [self expectationWithDescription:@"Query User Location"]; + XCTestExpectation * expectation = [self expectationWithDescription:@"read the optional global attribute: FeatureMap"]; CHIPDevice * device = GetConnectedDevice(); dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestBasic * cluster = [[CHIPTestBasic alloc] initWithDevice:device endpoint:0 queue:queue]; + CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:queue]; XCTAssertNotNil(cluster); - [cluster readAttributeLocationWithResponseHandler:^(NSError * err, NSDictionary * values) { - NSLog(@"Query User Location Error: %@", err); + [cluster readAttributeFeatureMapWithResponseHandler:^(NSError * err, NSDictionary * values) { + NSLog(@"read the optional global attribute: FeatureMap Error: %@", err); XCTAssertEqual(err.code, 0); - XCTAssertLessThanOrEqual([values[@"value"] length], 2); + XCTAssertEqual([values[@"value"] unsignedLongValue], 0UL); [expectation fulfill]; }]; [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTest_TC_DM_1_1_000007_ReadAttribute +- (void)testSendClusterTest_TC_OO_1_1_000004_WriteAttribute { - XCTestExpectation * expectation = [self expectationWithDescription:@"Query HardwareVersion"]; + XCTestExpectation * expectation = + [self expectationWithDescription:@"write the default values to optional global attribute: FeatureMap"]; CHIPDevice * device = GetConnectedDevice(); dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestBasic * cluster = [[CHIPTestBasic alloc] initWithDevice:device endpoint:0 queue:queue]; + CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:queue]; XCTAssertNotNil(cluster); - [cluster readAttributeHardwareVersionWithResponseHandler:^(NSError * err, NSDictionary * values) { - NSLog(@"Query HardwareVersion Error: %@", err); - - XCTAssertEqual(err.code, 0); + uint32_t featureMapArgument = 0UL; + [cluster writeAttributeFeatureMapWithValue:featureMapArgument + responseHandler:^(NSError * err, NSDictionary * values) { + NSLog(@"write the default values to optional global attribute: FeatureMap Error: %@", err); - [expectation fulfill]; - }]; + XCTAssertEqual(err.code, 1); + [expectation fulfill]; + }]; [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTest_TC_DM_1_1_000008_ReadAttribute +- (void)testSendClusterTest_TC_OO_1_1_000005_ReadAttribute { - XCTestExpectation * expectation = [self expectationWithDescription:@"Query HardwareVersionString"]; + XCTestExpectation * expectation = [self expectationWithDescription:@"reads back optional global attribute: FeatureMap"]; CHIPDevice * device = GetConnectedDevice(); dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestBasic * cluster = [[CHIPTestBasic alloc] initWithDevice:device endpoint:0 queue:queue]; + CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:queue]; XCTAssertNotNil(cluster); - [cluster readAttributeHardwareVersionStringWithResponseHandler:^(NSError * err, NSDictionary * values) { - NSLog(@"Query HardwareVersionString Error: %@", err); + [cluster readAttributeFeatureMapWithResponseHandler:^(NSError * err, NSDictionary * values) { + NSLog(@"reads back optional global attribute: FeatureMap Error: %@", err); XCTAssertEqual(err.code, 0); - XCTAssertGreaterThanOrEqual([values[@"value"] length], 1); - XCTAssertLessThanOrEqual([values[@"value"] length], 64); + XCTAssertEqual([values[@"value"] unsignedLongValue], 0UL); [expectation fulfill]; }]; [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTest_TC_DM_1_1_000009_ReadAttribute + +- (void)testSendClusterTest_TC_OO_2_1_000000_ReadAttribute { - XCTestExpectation * expectation = [self expectationWithDescription:@"Query SoftwareVersion"]; + XCTestExpectation * expectation = [self expectationWithDescription:@"read the mandatory attribute: OnOff"]; CHIPDevice * device = GetConnectedDevice(); dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestBasic * cluster = [[CHIPTestBasic alloc] initWithDevice:device endpoint:0 queue:queue]; + CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:queue]; XCTAssertNotNil(cluster); - [cluster readAttributeSoftwareVersionWithResponseHandler:^(NSError * err, NSDictionary * values) { - NSLog(@"Query SoftwareVersion Error: %@", err); + [cluster readAttributeOnOffWithResponseHandler:^(NSError * err, NSDictionary * values) { + NSLog(@"read the mandatory attribute: OnOff Error: %@", err); XCTAssertEqual(err.code, 0); + XCTAssertEqual([values[@"value"] boolValue], 0); + [expectation fulfill]; }]; [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTest_TC_DM_1_1_000010_ReadAttribute +- (void)testSendClusterTest_TC_OO_2_1_000001_ReadAttribute { - XCTestExpectation * expectation = [self expectationWithDescription:@"Query SoftwareVersionString"]; + XCTestExpectation * expectation = [self expectationWithDescription:@"reads back mandatory attribute: OnOff"]; CHIPDevice * device = GetConnectedDevice(); dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestBasic * cluster = [[CHIPTestBasic alloc] initWithDevice:device endpoint:0 queue:queue]; + CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:queue]; XCTAssertNotNil(cluster); - [cluster readAttributeSoftwareVersionStringWithResponseHandler:^(NSError * err, NSDictionary * values) { - NSLog(@"Query SoftwareVersionString Error: %@", err); + [cluster readAttributeOnOffWithResponseHandler:^(NSError * err, NSDictionary * values) { + NSLog(@"reads back mandatory attribute: OnOff Error: %@", err); XCTAssertEqual(err.code, 0); - XCTAssertGreaterThanOrEqual([values[@"value"] length], 1); - XCTAssertLessThanOrEqual([values[@"value"] length], 64); + XCTAssertEqual([values[@"value"] boolValue], 0); [expectation fulfill]; }]; [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTest_TC_DM_1_1_000011_ReadAttribute +- (void)testSendClusterTest_TC_OO_2_1_000002_ReadAttribute { - XCTestExpectation * expectation = [self expectationWithDescription:@"Query ManufacturingDate"]; + XCTestExpectation * expectation = [self expectationWithDescription:@"read LT attribute: GlobalSceneControl"]; CHIPDevice * device = GetConnectedDevice(); dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestBasic * cluster = [[CHIPTestBasic alloc] initWithDevice:device endpoint:0 queue:queue]; + CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:queue]; XCTAssertNotNil(cluster); - [cluster readAttributeManufacturingDateWithResponseHandler:^(NSError * err, NSDictionary * values) { - NSLog(@"Query ManufacturingDate Error: %@", err); - - if (err.code == CHIPErrorCodeUnsupportedAttribute) { - [expectation fulfill]; - return; - } + [cluster readAttributeGlobalSceneControlWithResponseHandler:^(NSError * err, NSDictionary * values) { + NSLog(@"read LT attribute: GlobalSceneControl Error: %@", err); XCTAssertEqual(err.code, 0); - XCTAssertGreaterThanOrEqual([values[@"value"] length], 8); - XCTAssertLessThanOrEqual([values[@"value"] length], 16); + XCTAssertEqual([values[@"value"] boolValue], 1); [expectation fulfill]; }]; [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTest_TC_DM_1_1_000012_ReadAttribute +- (void)testSendClusterTest_TC_OO_2_1_000003_ReadAttribute { - XCTestExpectation * expectation = [self expectationWithDescription:@"Query PartNumber"]; + XCTestExpectation * expectation = [self expectationWithDescription:@"read LT attribute: OnTime"]; CHIPDevice * device = GetConnectedDevice(); dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestBasic * cluster = [[CHIPTestBasic alloc] initWithDevice:device endpoint:0 queue:queue]; + CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:queue]; XCTAssertNotNil(cluster); - [cluster readAttributePartNumberWithResponseHandler:^(NSError * err, NSDictionary * values) { - NSLog(@"Query PartNumber Error: %@", err); - - if (err.code == CHIPErrorCodeUnsupportedAttribute) { - [expectation fulfill]; - return; - } + [cluster readAttributeOnTimeWithResponseHandler:^(NSError * err, NSDictionary * values) { + NSLog(@"read LT attribute: OnTime Error: %@", err); XCTAssertEqual(err.code, 0); - XCTAssertLessThanOrEqual([values[@"value"] length], 32); + XCTAssertEqual([values[@"value"] unsignedShortValue], 0U); [expectation fulfill]; }]; [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTest_TC_DM_1_1_000013_ReadAttribute +- (void)testSendClusterTest_TC_OO_2_1_000004_ReadAttribute { - XCTestExpectation * expectation = [self expectationWithDescription:@"Query ProductURL"]; + XCTestExpectation * expectation = [self expectationWithDescription:@"read LT attribute: OffWaitTime"]; CHIPDevice * device = GetConnectedDevice(); dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestBasic * cluster = [[CHIPTestBasic alloc] initWithDevice:device endpoint:0 queue:queue]; + CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:queue]; XCTAssertNotNil(cluster); - [cluster readAttributeProductURLWithResponseHandler:^(NSError * err, NSDictionary * values) { - NSLog(@"Query ProductURL Error: %@", err); - - if (err.code == CHIPErrorCodeUnsupportedAttribute) { - [expectation fulfill]; - return; - } + [cluster readAttributeOffWaitTimeWithResponseHandler:^(NSError * err, NSDictionary * values) { + NSLog(@"read LT attribute: OffWaitTime Error: %@", err); XCTAssertEqual(err.code, 0); - XCTAssertLessThanOrEqual([values[@"value"] length], 256); + XCTAssertEqual([values[@"value"] unsignedShortValue], 0U); [expectation fulfill]; }]; [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTest_TC_DM_1_1_000014_ReadAttribute +- (void)testSendClusterTest_TC_OO_2_1_000005_ReadAttribute { - XCTestExpectation * expectation = [self expectationWithDescription:@"Query ProductLabel"]; + XCTestExpectation * expectation = [self expectationWithDescription:@"read LT attribute: StartUpOnOff"]; CHIPDevice * device = GetConnectedDevice(); dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestBasic * cluster = [[CHIPTestBasic alloc] initWithDevice:device endpoint:0 queue:queue]; + CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:queue]; XCTAssertNotNil(cluster); - [cluster readAttributeProductLabelWithResponseHandler:^(NSError * err, NSDictionary * values) { - NSLog(@"Query ProductLabel Error: %@", err); - - if (err.code == CHIPErrorCodeUnsupportedAttribute) { - [expectation fulfill]; - return; - } + [cluster readAttributeStartUpOnOffWithResponseHandler:^(NSError * err, NSDictionary * values) { + NSLog(@"read LT attribute: StartUpOnOff Error: %@", err); XCTAssertEqual(err.code, 0); - XCTAssertLessThanOrEqual([values[@"value"] length], 64); + XCTAssertEqual([values[@"value"] unsignedCharValue], 0); [expectation fulfill]; }]; [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTest_TC_DM_1_1_000015_ReadAttribute +- (void)testSendClusterTest_TC_OO_2_1_000006_WriteAttribute { - XCTestExpectation * expectation = [self expectationWithDescription:@"Query SerialNumber"]; + XCTestExpectation * expectation = [self expectationWithDescription:@"write the default value to LT attribute: OnTime"]; CHIPDevice * device = GetConnectedDevice(); dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestBasic * cluster = [[CHIPTestBasic alloc] initWithDevice:device endpoint:0 queue:queue]; + CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:queue]; XCTAssertNotNil(cluster); - [cluster readAttributeSerialNumberWithResponseHandler:^(NSError * err, NSDictionary * values) { - NSLog(@"Query SerialNumber Error: %@", err); - - if (err.code == CHIPErrorCodeUnsupportedAttribute) { - [expectation fulfill]; - return; - } - - XCTAssertEqual(err.code, 0); + uint16_t onTimeArgument = 0U; + [cluster writeAttributeOnTimeWithValue:onTimeArgument + responseHandler:^(NSError * err, NSDictionary * values) { + NSLog(@"write the default value to LT attribute: OnTime Error: %@", err); - XCTAssertLessThanOrEqual([values[@"value"] length], 32); + XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; + [expectation fulfill]; + }]; [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTest_TC_DM_1_1_000016_ReadAttribute +- (void)testSendClusterTest_TC_OO_2_1_000007_WriteAttribute { - XCTestExpectation * expectation = [self expectationWithDescription:@"Query LocalConfigDisabled"]; + XCTestExpectation * expectation = [self expectationWithDescription:@"write the default value to LT attribute: OffWaitTime"]; CHIPDevice * device = GetConnectedDevice(); dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestBasic * cluster = [[CHIPTestBasic alloc] initWithDevice:device endpoint:0 queue:queue]; + CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:queue]; XCTAssertNotNil(cluster); - [cluster readAttributeLocalConfigDisabledWithResponseHandler:^(NSError * err, NSDictionary * values) { - NSLog(@"Query LocalConfigDisabled Error: %@", err); - - if (err.code == CHIPErrorCodeUnsupportedAttribute) { - [expectation fulfill]; - return; - } + uint16_t offWaitTimeArgument = 0U; + [cluster writeAttributeOffWaitTimeWithValue:offWaitTimeArgument + responseHandler:^(NSError * err, NSDictionary * values) { + NSLog(@"write the default value to LT attribute: OffWaitTime Error: %@", err); - XCTAssertEqual(err.code, 0); + XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; + [expectation fulfill]; + }]; [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTest_TC_DM_1_1_000017_ReadAttribute +- (void)testSendClusterTest_TC_OO_2_1_000008_WriteAttribute { - XCTestExpectation * expectation = [self expectationWithDescription:@"Query Reachable"]; + XCTestExpectation * expectation = [self expectationWithDescription:@"write the default value to LT attribute: StartUpOnOff"]; CHIPDevice * device = GetConnectedDevice(); dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestBasic * cluster = [[CHIPTestBasic alloc] initWithDevice:device endpoint:0 queue:queue]; + CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:queue]; XCTAssertNotNil(cluster); - [cluster readAttributeReachableWithResponseHandler:^(NSError * err, NSDictionary * values) { - NSLog(@"Query Reachable Error: %@", err); - - if (err.code == CHIPErrorCodeUnsupportedAttribute) { - [expectation fulfill]; - return; - } + uint8_t startUpOnOffArgument = 0; + [cluster writeAttributeStartUpOnOffWithValue:startUpOnOffArgument + responseHandler:^(NSError * err, NSDictionary * values) { + NSLog(@"write the default value to LT attribute: StartUpOnOff Error: %@", err); - XCTAssertEqual(err.code, 0); + XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; + [expectation fulfill]; + }]; [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } - -- (void)testSendClusterTest_TC_WNCV_1_1_000000_ReadAttribute +- (void)testSendClusterTest_TC_OO_2_1_000009_ReadAttribute { - XCTestExpectation * expectation = [self expectationWithDescription:@"read the global attribute: ClusterRevision"]; + XCTestExpectation * expectation = [self expectationWithDescription:@"reads back LT attribute: OnTime"]; CHIPDevice * device = GetConnectedDevice(); dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestWindowCovering * cluster = [[CHIPTestWindowCovering alloc] initWithDevice:device endpoint:1 queue:queue]; + CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:queue]; XCTAssertNotNil(cluster); - [cluster readAttributeClusterRevisionWithResponseHandler:^(NSError * err, NSDictionary * values) { - NSLog(@"read the global attribute: ClusterRevision Error: %@", err); + [cluster readAttributeOnTimeWithResponseHandler:^(NSError * err, NSDictionary * values) { + NSLog(@"reads back LT attribute: OnTime Error: %@", err); XCTAssertEqual(err.code, 0); - XCTAssertEqual([values[@"value"] unsignedShortValue], 5U); + XCTAssertEqual([values[@"value"] unsignedShortValue], 0U); [expectation fulfill]; }]; [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTest_TC_WNCV_1_1_000001_WriteAttribute +- (void)testSendClusterTest_TC_OO_2_1_000010_ReadAttribute { - XCTestExpectation * expectation = - [self expectationWithDescription:@"write the default value to mandatory global attribute: ClusterRevision"]; + XCTestExpectation * expectation = [self expectationWithDescription:@"reads back LT attribute: OffWaitTime"]; CHIPDevice * device = GetConnectedDevice(); dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestWindowCovering * cluster = [[CHIPTestWindowCovering alloc] initWithDevice:device endpoint:1 queue:queue]; + CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:queue]; XCTAssertNotNil(cluster); - uint16_t clusterRevisionArgument = 5U; - [cluster - writeAttributeClusterRevisionWithValue:clusterRevisionArgument - responseHandler:^(NSError * err, NSDictionary * values) { - NSLog(@"write the default value to mandatory global attribute: ClusterRevision Error: %@", err); + [cluster readAttributeOffWaitTimeWithResponseHandler:^(NSError * err, NSDictionary * values) { + NSLog(@"reads back LT attribute: OffWaitTime Error: %@", err); - XCTAssertEqual(err.code, 1); - [expectation fulfill]; - }]; + XCTAssertEqual(err.code, 0); + + XCTAssertEqual([values[@"value"] unsignedShortValue], 0U); + + [expectation fulfill]; + }]; [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTest_TC_WNCV_1_1_000002_ReadAttribute +- (void)testSendClusterTest_TC_OO_2_1_000011_ReadAttribute { - XCTestExpectation * expectation = [self expectationWithDescription:@"reads back global attribute: ClusterRevision"]; + XCTestExpectation * expectation = [self expectationWithDescription:@"reads back LT attribute: StartUpOnOff"]; CHIPDevice * device = GetConnectedDevice(); dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestWindowCovering * cluster = [[CHIPTestWindowCovering alloc] initWithDevice:device endpoint:1 queue:queue]; + CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:queue]; XCTAssertNotNil(cluster); - [cluster readAttributeClusterRevisionWithResponseHandler:^(NSError * err, NSDictionary * values) { - NSLog(@"reads back global attribute: ClusterRevision Error: %@", err); + [cluster readAttributeStartUpOnOffWithResponseHandler:^(NSError * err, NSDictionary * values) { + NSLog(@"reads back LT attribute: StartUpOnOff Error: %@", err); XCTAssertEqual(err.code, 0); - XCTAssertEqual([values[@"value"] unsignedShortValue], 5U); + XCTAssertEqual([values[@"value"] unsignedCharValue], 0); [expectation fulfill]; }]; @@ -4235,269 +4440,259 @@ - (void)testSendClusterTest_TC_WNCV_1_1_000002_ReadAttribute [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTest_TC_WNCV_2_1_000000_ReadAttribute +- (void)testSendClusterTest_TC_OO_2_2_000000_Off { - XCTestExpectation * expectation = [self expectationWithDescription:@"read the RO mandatory attribute default: Type"]; + XCTestExpectation * expectation = [self expectationWithDescription:@"Send Off Command"]; CHIPDevice * device = GetConnectedDevice(); dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestWindowCovering * cluster = [[CHIPTestWindowCovering alloc] initWithDevice:device endpoint:1 queue:queue]; + CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:queue]; XCTAssertNotNil(cluster); - [cluster readAttributeTypeWithResponseHandler:^(NSError * err, NSDictionary * values) { - NSLog(@"read the RO mandatory attribute default: Type Error: %@", err); + [cluster off:^(NSError * err, NSDictionary * values) { + NSLog(@"Send Off Command Error: %@", err); XCTAssertEqual(err.code, 0); - XCTAssertEqual([values[@"value"] unsignedCharValue], 0); - [expectation fulfill]; }]; [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTest_TC_WNCV_2_1_000001_ReadAttribute +- (void)testSendClusterTest_TC_OO_2_2_000001_ReadAttribute { - XCTestExpectation * expectation = [self expectationWithDescription:@"reads back the RO mandatory attribute: Type"]; + XCTestExpectation * expectation = [self expectationWithDescription:@"Check on/off attribute value is false after off command"]; CHIPDevice * device = GetConnectedDevice(); dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestWindowCovering * cluster = [[CHIPTestWindowCovering alloc] initWithDevice:device endpoint:1 queue:queue]; + CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:queue]; XCTAssertNotNil(cluster); - [cluster readAttributeTypeWithResponseHandler:^(NSError * err, NSDictionary * values) { - NSLog(@"reads back the RO mandatory attribute: Type Error: %@", err); - + [cluster readAttributeOnOffWithResponseHandler:^(NSError * err, NSDictionary * values) { + NSLog(@"Check on/off attribute value is false after off command Error: %@", err); + XCTAssertEqual(err.code, 0); - XCTAssertEqual([values[@"value"] unsignedCharValue], 0); + XCTAssertEqual([values[@"value"] boolValue], 0); [expectation fulfill]; }]; [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTest_TC_WNCV_2_1_000002_ReadAttribute +- (void)testSendClusterTest_TC_OO_2_2_000002_On { - XCTestExpectation * expectation = [self expectationWithDescription:@"read the RO mandatory attribute default: ConfigStatus"]; + XCTestExpectation * expectation = [self expectationWithDescription:@"Send On Command"]; CHIPDevice * device = GetConnectedDevice(); dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestWindowCovering * cluster = [[CHIPTestWindowCovering alloc] initWithDevice:device endpoint:1 queue:queue]; + CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:queue]; XCTAssertNotNil(cluster); - [cluster readAttributeConfigStatusWithResponseHandler:^(NSError * err, NSDictionary * values) { - NSLog(@"read the RO mandatory attribute default: ConfigStatus Error: %@", err); + [cluster on:^(NSError * err, NSDictionary * values) { + NSLog(@"Send On Command Error: %@", err); XCTAssertEqual(err.code, 0); - XCTAssertEqual([values[@"value"] unsignedCharValue], 3); - [expectation fulfill]; }]; [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTest_TC_WNCV_2_1_000003_ReadAttribute +- (void)testSendClusterTest_TC_OO_2_2_000003_ReadAttribute { - XCTestExpectation * expectation = [self expectationWithDescription:@"reads back the RO mandatory attribute: ConfigStatus"]; + XCTestExpectation * expectation = [self expectationWithDescription:@"Check on/off attribute value is true after on command"]; CHIPDevice * device = GetConnectedDevice(); dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestWindowCovering * cluster = [[CHIPTestWindowCovering alloc] initWithDevice:device endpoint:1 queue:queue]; + CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:queue]; XCTAssertNotNil(cluster); - [cluster readAttributeConfigStatusWithResponseHandler:^(NSError * err, NSDictionary * values) { - NSLog(@"reads back the RO mandatory attribute: ConfigStatus Error: %@", err); + [cluster readAttributeOnOffWithResponseHandler:^(NSError * err, NSDictionary * values) { + NSLog(@"Check on/off attribute value is true after on command Error: %@", err); XCTAssertEqual(err.code, 0); - XCTAssertEqual([values[@"value"] unsignedCharValue], 3); + XCTAssertEqual([values[@"value"] boolValue], 1); [expectation fulfill]; }]; [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTest_TC_WNCV_2_1_000004_ReadAttribute +- (void)testSendClusterTest_TC_OO_2_2_000004_Off { - XCTestExpectation * expectation = - [self expectationWithDescription:@"read the RO mandatory attribute default: OperationalStatus"]; + XCTestExpectation * expectation = [self expectationWithDescription:@"Send Off Command"]; CHIPDevice * device = GetConnectedDevice(); dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestWindowCovering * cluster = [[CHIPTestWindowCovering alloc] initWithDevice:device endpoint:1 queue:queue]; + CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:queue]; XCTAssertNotNil(cluster); - [cluster readAttributeOperationalStatusWithResponseHandler:^(NSError * err, NSDictionary * values) { - NSLog(@"read the RO mandatory attribute default: OperationalStatus Error: %@", err); + [cluster off:^(NSError * err, NSDictionary * values) { + NSLog(@"Send Off Command Error: %@", err); XCTAssertEqual(err.code, 0); - XCTAssertEqual([values[@"value"] unsignedCharValue], 0); - [expectation fulfill]; }]; [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTest_TC_WNCV_2_1_000005_ReadAttribute +- (void)testSendClusterTest_TC_OO_2_2_000005_ReadAttribute { - XCTestExpectation * expectation = [self expectationWithDescription:@"reads back the RO mandatory attribute: OperationalStatus"]; + XCTestExpectation * expectation = [self expectationWithDescription:@"Check on/off attribute value is false after off command"]; CHIPDevice * device = GetConnectedDevice(); dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestWindowCovering * cluster = [[CHIPTestWindowCovering alloc] initWithDevice:device endpoint:1 queue:queue]; + CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:queue]; XCTAssertNotNil(cluster); - [cluster readAttributeOperationalStatusWithResponseHandler:^(NSError * err, NSDictionary * values) { - NSLog(@"reads back the RO mandatory attribute: OperationalStatus Error: %@", err); + [cluster readAttributeOnOffWithResponseHandler:^(NSError * err, NSDictionary * values) { + NSLog(@"Check on/off attribute value is false after off command Error: %@", err); XCTAssertEqual(err.code, 0); - XCTAssertEqual([values[@"value"] unsignedCharValue], 0); + XCTAssertEqual([values[@"value"] boolValue], 0); [expectation fulfill]; }]; [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTest_TC_WNCV_2_1_000006_ReadAttribute +- (void)testSendClusterTest_TC_OO_2_2_000006_Toggle { - XCTestExpectation * expectation = [self expectationWithDescription:@"read the RO mandatory attribute default: EndProductType"]; + XCTestExpectation * expectation = [self expectationWithDescription:@"Send Toggle Command"]; CHIPDevice * device = GetConnectedDevice(); dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestWindowCovering * cluster = [[CHIPTestWindowCovering alloc] initWithDevice:device endpoint:1 queue:queue]; + CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:queue]; XCTAssertNotNil(cluster); - [cluster readAttributeEndProductTypeWithResponseHandler:^(NSError * err, NSDictionary * values) { - NSLog(@"read the RO mandatory attribute default: EndProductType Error: %@", err); + [cluster toggle:^(NSError * err, NSDictionary * values) { + NSLog(@"Send Toggle Command Error: %@", err); XCTAssertEqual(err.code, 0); - XCTAssertEqual([values[@"value"] unsignedCharValue], 0); - [expectation fulfill]; }]; [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTest_TC_WNCV_2_1_000007_ReadAttribute +- (void)testSendClusterTest_TC_OO_2_2_000007_ReadAttribute { - XCTestExpectation * expectation = [self expectationWithDescription:@"reads back the RO mandatory attribute: EndProductType"]; + XCTestExpectation * expectation = + [self expectationWithDescription:@"Check on/off attribute value is true after toggle command"]; CHIPDevice * device = GetConnectedDevice(); dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestWindowCovering * cluster = [[CHIPTestWindowCovering alloc] initWithDevice:device endpoint:1 queue:queue]; + CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:queue]; XCTAssertNotNil(cluster); - [cluster readAttributeEndProductTypeWithResponseHandler:^(NSError * err, NSDictionary * values) { - NSLog(@"reads back the RO mandatory attribute: EndProductType Error: %@", err); + [cluster readAttributeOnOffWithResponseHandler:^(NSError * err, NSDictionary * values) { + NSLog(@"Check on/off attribute value is true after toggle command Error: %@", err); XCTAssertEqual(err.code, 0); - XCTAssertEqual([values[@"value"] unsignedCharValue], 0); + XCTAssertEqual([values[@"value"] boolValue], 1); [expectation fulfill]; }]; [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTest_TC_WNCV_2_1_000008_ReadAttribute +- (void)testSendClusterTest_TC_OO_2_2_000008_Toggle { - XCTestExpectation * expectation = [self expectationWithDescription:@"read the RW mandatory attribute default: Mode"]; + XCTestExpectation * expectation = [self expectationWithDescription:@"Send Toggle Command"]; CHIPDevice * device = GetConnectedDevice(); dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestWindowCovering * cluster = [[CHIPTestWindowCovering alloc] initWithDevice:device endpoint:1 queue:queue]; + CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:queue]; XCTAssertNotNil(cluster); - [cluster readAttributeModeWithResponseHandler:^(NSError * err, NSDictionary * values) { - NSLog(@"read the RW mandatory attribute default: Mode Error: %@", err); + [cluster toggle:^(NSError * err, NSDictionary * values) { + NSLog(@"Send Toggle Command Error: %@", err); XCTAssertEqual(err.code, 0); - XCTAssertEqual([values[@"value"] unsignedCharValue], 0); - [expectation fulfill]; }]; [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTest_TC_WNCV_2_1_000009_WriteAttribute +- (void)testSendClusterTest_TC_OO_2_2_000009_ReadAttribute { - XCTestExpectation * expectation = [self expectationWithDescription:@"write a value into the RW mandatory attribute:: Mode"]; + XCTestExpectation * expectation = + [self expectationWithDescription:@"Check on/off attribute value is false after toggle command"]; CHIPDevice * device = GetConnectedDevice(); dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestWindowCovering * cluster = [[CHIPTestWindowCovering alloc] initWithDevice:device endpoint:1 queue:queue]; + CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:queue]; XCTAssertNotNil(cluster); - uint8_t modeArgument = 7; - [cluster writeAttributeModeWithValue:modeArgument - responseHandler:^(NSError * err, NSDictionary * values) { - NSLog(@"write a value into the RW mandatory attribute:: Mode Error: %@", err); + [cluster readAttributeOnOffWithResponseHandler:^(NSError * err, NSDictionary * values) { + NSLog(@"Check on/off attribute value is false after toggle command Error: %@", err); - XCTAssertEqual(err.code, 0); + XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; + XCTAssertEqual([values[@"value"] boolValue], 0); + + [expectation fulfill]; + }]; [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTest_TC_WNCV_2_1_000010_ReadAttribute +- (void)testSendClusterTest_TC_OO_2_2_000010_On { - XCTestExpectation * expectation = [self expectationWithDescription:@"reads back the RW mandatory attribute: Mode"]; + XCTestExpectation * expectation = [self expectationWithDescription:@"Send On Command"]; CHIPDevice * device = GetConnectedDevice(); dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestWindowCovering * cluster = [[CHIPTestWindowCovering alloc] initWithDevice:device endpoint:1 queue:queue]; + CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:queue]; XCTAssertNotNil(cluster); - [cluster readAttributeModeWithResponseHandler:^(NSError * err, NSDictionary * values) { - NSLog(@"reads back the RW mandatory attribute: Mode Error: %@", err); + [cluster on:^(NSError * err, NSDictionary * values) { + NSLog(@"Send On Command Error: %@", err); XCTAssertEqual(err.code, 0); - XCTAssertEqual([values[@"value"] unsignedCharValue], 7); - [expectation fulfill]; }]; [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } - -- (void)testSendClusterTest_TC_WNCV_3_1_000000_DownOrClose +- (void)testSendClusterTest_TC_OO_2_2_000011_ReadAttribute { - XCTestExpectation * expectation = [self expectationWithDescription:@"1a: TH adjusts the the DUT to a non-open position"]; + XCTestExpectation * expectation = [self expectationWithDescription:@"Check on/off attribute value is true after on command"]; CHIPDevice * device = GetConnectedDevice(); dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestWindowCovering * cluster = [[CHIPTestWindowCovering alloc] initWithDevice:device endpoint:1 queue:queue]; + CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:queue]; XCTAssertNotNil(cluster); - [cluster downOrClose:^(NSError * err, NSDictionary * values) { - NSLog(@"1a: TH adjusts the the DUT to a non-open position Error: %@", err); + [cluster readAttributeOnOffWithResponseHandler:^(NSError * err, NSDictionary * values) { + NSLog(@"Check on/off attribute value is true after on command Error: %@", err); XCTAssertEqual(err.code, 0); + XCTAssertEqual([values[@"value"] boolValue], 1); + [expectation fulfill]; }]; [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTest_TC_WNCV_3_1_000001_UpOrOpen +- (void)testSendClusterTest_TC_OO_2_2_000012_Off { - XCTestExpectation * expectation = [self expectationWithDescription:@"2a: TH sends UpOrOpen command to DUT"]; + XCTestExpectation * expectation = [self expectationWithDescription:@"Send Off Command"]; CHIPDevice * device = GetConnectedDevice(); dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestWindowCovering * cluster = [[CHIPTestWindowCovering alloc] initWithDevice:device endpoint:1 queue:queue]; + CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:queue]; XCTAssertNotNil(cluster); - [cluster upOrOpen:^(NSError * err, NSDictionary * values) { - NSLog(@"2a: TH sends UpOrOpen command to DUT Error: %@", err); + [cluster off:^(NSError * err, NSDictionary * values) { + NSLog(@"Send Off Command Error: %@", err); XCTAssertEqual(err.code, 0); @@ -4506,21 +4701,21 @@ - (void)testSendClusterTest_TC_WNCV_3_1_000001_UpOrOpen [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTest_TC_WNCV_3_1_000002_ReadAttribute +- (void)testSendClusterTest_TC_OO_2_2_000013_ReadAttribute { - XCTestExpectation * expectation = [self expectationWithDescription:@"3a: TH reads OperationalStatus attribute from DUT"]; + XCTestExpectation * expectation = [self expectationWithDescription:@"Check on/off attribute value is false after off command"]; CHIPDevice * device = GetConnectedDevice(); dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestWindowCovering * cluster = [[CHIPTestWindowCovering alloc] initWithDevice:device endpoint:1 queue:queue]; + CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:queue]; XCTAssertNotNil(cluster); - [cluster readAttributeOperationalStatusWithResponseHandler:^(NSError * err, NSDictionary * values) { - NSLog(@"3a: TH reads OperationalStatus attribute from DUT Error: %@", err); + [cluster readAttributeOnOffWithResponseHandler:^(NSError * err, NSDictionary * values) { + NSLog(@"Check on/off attribute value is false after off command Error: %@", err); XCTAssertEqual(err.code, 0); - XCTAssertEqual([values[@"value"] unsignedCharValue], 0); + XCTAssertEqual([values[@"value"] boolValue], 0); [expectation fulfill]; }]; @@ -4528,36 +4723,44 @@ - (void)testSendClusterTest_TC_WNCV_3_1_000002_ReadAttribute [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTest_TC_WNCV_3_2_000000_UpOrOpen +- (void)testSendClusterTest_TC_PCC_1_1_000000_WriteAttribute { - XCTestExpectation * expectation = [self expectationWithDescription:@"1a: TH adjusts the the DUT to a non-closed position"]; + XCTestExpectation * expectation = + [self expectationWithDescription:@"write the default values to mandatory global attribute: ClusterRevision"]; CHIPDevice * device = GetConnectedDevice(); dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestWindowCovering * cluster = [[CHIPTestWindowCovering alloc] initWithDevice:device endpoint:1 queue:queue]; + CHIPTestPumpConfigurationAndControl * cluster = [[CHIPTestPumpConfigurationAndControl alloc] initWithDevice:device + endpoint:1 + queue:queue]; XCTAssertNotNil(cluster); - [cluster upOrOpen:^(NSError * err, NSDictionary * values) { - NSLog(@"1a: TH adjusts the the DUT to a non-closed position Error: %@", err); - - XCTAssertEqual(err.code, 0); + uint16_t clusterRevisionArgument = 3U; + [cluster + writeAttributeClusterRevisionWithValue:clusterRevisionArgument + responseHandler:^(NSError * err, NSDictionary * values) { + NSLog(@"write the default values to mandatory global attribute: ClusterRevision Error: %@", err); - [expectation fulfill]; - }]; + XCTAssertEqual(err.code, 1); + [expectation fulfill]; + }]; [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTest_TC_WNCV_3_2_000001_DownOrClose + +- (void)testSendClusterTest_TC_PCC_2_1_000000_ReadAttribute { - XCTestExpectation * expectation = [self expectationWithDescription:@"2a: TH sends DownOrClose command to DUT"]; + XCTestExpectation * expectation = [self expectationWithDescription:@"read the mandatory attribute: MaxPressure"]; CHIPDevice * device = GetConnectedDevice(); dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestWindowCovering * cluster = [[CHIPTestWindowCovering alloc] initWithDevice:device endpoint:1 queue:queue]; + CHIPTestPumpConfigurationAndControl * cluster = [[CHIPTestPumpConfigurationAndControl alloc] initWithDevice:device + endpoint:1 + queue:queue]; XCTAssertNotNil(cluster); - [cluster downOrClose:^(NSError * err, NSDictionary * values) { - NSLog(@"2a: TH sends DownOrClose command to DUT Error: %@", err); + [cluster readAttributeMaxPressureWithResponseHandler:^(NSError * err, NSDictionary * values) { + NSLog(@"read the mandatory attribute: MaxPressure Error: %@", err); XCTAssertEqual(err.code, 0); @@ -4566,39 +4769,40 @@ - (void)testSendClusterTest_TC_WNCV_3_2_000001_DownOrClose [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTest_TC_WNCV_3_2_000002_ReadAttribute +- (void)testSendClusterTest_TC_PCC_2_1_000001_ReadAttribute { - XCTestExpectation * expectation = [self expectationWithDescription:@"3a: TH reads OperationalStatus attribute from DUT"]; + XCTestExpectation * expectation = [self expectationWithDescription:@"read the mandatory attribute: EffectiveOperationMode"]; CHIPDevice * device = GetConnectedDevice(); dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestWindowCovering * cluster = [[CHIPTestWindowCovering alloc] initWithDevice:device endpoint:1 queue:queue]; + CHIPTestPumpConfigurationAndControl * cluster = [[CHIPTestPumpConfigurationAndControl alloc] initWithDevice:device + endpoint:1 + queue:queue]; XCTAssertNotNil(cluster); - [cluster readAttributeOperationalStatusWithResponseHandler:^(NSError * err, NSDictionary * values) { - NSLog(@"3a: TH reads OperationalStatus attribute from DUT Error: %@", err); + [cluster readAttributeEffectiveOperationModeWithResponseHandler:^(NSError * err, NSDictionary * values) { + NSLog(@"read the mandatory attribute: EffectiveOperationMode Error: %@", err); XCTAssertEqual(err.code, 0); - XCTAssertEqual([values[@"value"] unsignedCharValue], 0); - [expectation fulfill]; }]; [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } - -- (void)testSendClusterTest_TC_WNCV_3_3_000000_UpOrOpen +- (void)testSendClusterTest_TC_PCC_2_1_000002_ReadAttribute { - XCTestExpectation * expectation = [self expectationWithDescription:@"1a: TH adjusts the the DUT to a non-open position"]; + XCTestExpectation * expectation = [self expectationWithDescription:@"read the mandatory attribute: EffectiveControlMode"]; CHIPDevice * device = GetConnectedDevice(); dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestWindowCovering * cluster = [[CHIPTestWindowCovering alloc] initWithDevice:device endpoint:1 queue:queue]; + CHIPTestPumpConfigurationAndControl * cluster = [[CHIPTestPumpConfigurationAndControl alloc] initWithDevice:device + endpoint:1 + queue:queue]; XCTAssertNotNil(cluster); - [cluster upOrOpen:^(NSError * err, NSDictionary * values) { - NSLog(@"1a: TH adjusts the the DUT to a non-open position Error: %@", err); + [cluster readAttributeEffectiveControlModeWithResponseHandler:^(NSError * err, NSDictionary * values) { + NSLog(@"read the mandatory attribute: EffectiveControlMode Error: %@", err); XCTAssertEqual(err.code, 0); @@ -4607,17 +4811,19 @@ - (void)testSendClusterTest_TC_WNCV_3_3_000000_UpOrOpen [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTest_TC_WNCV_3_3_000001_StopMotion +- (void)testSendClusterTest_TC_PCC_2_1_000003_ReadAttribute { - XCTestExpectation * expectation = [self expectationWithDescription:@"2a: TH sends StopMotion command to DUT"]; + XCTestExpectation * expectation = [self expectationWithDescription:@"read the mandatory attribute: Capacity"]; CHIPDevice * device = GetConnectedDevice(); dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestWindowCovering * cluster = [[CHIPTestWindowCovering alloc] initWithDevice:device endpoint:1 queue:queue]; + CHIPTestPumpConfigurationAndControl * cluster = [[CHIPTestPumpConfigurationAndControl alloc] initWithDevice:device + endpoint:1 + queue:queue]; XCTAssertNotNil(cluster); - [cluster stopMotion:^(NSError * err, NSDictionary * values) { - NSLog(@"2a: TH sends StopMotion command to DUT Error: %@", err); + [cluster readAttributeCapacityWithResponseHandler:^(NSError * err, NSDictionary * values) { + NSLog(@"read the mandatory attribute: Capacity Error: %@", err); XCTAssertEqual(err.code, 0); @@ -4626,104 +4832,104 @@ - (void)testSendClusterTest_TC_WNCV_3_3_000001_StopMotion [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTest_TC_WNCV_3_3_000002_ReadAttribute +- (void)testSendClusterTest_TC_PCC_2_1_000004_ReadAttribute { - XCTestExpectation * expectation = [self expectationWithDescription:@"2b: TH reads OperationalStatus attribute from DUT"]; + XCTestExpectation * expectation = [self expectationWithDescription:@"read the mandatory attribute: MaxPressure"]; CHIPDevice * device = GetConnectedDevice(); dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestWindowCovering * cluster = [[CHIPTestWindowCovering alloc] initWithDevice:device endpoint:1 queue:queue]; + CHIPTestPumpConfigurationAndControl * cluster = [[CHIPTestPumpConfigurationAndControl alloc] initWithDevice:device + endpoint:1 + queue:queue]; XCTAssertNotNil(cluster); - [cluster readAttributeOperationalStatusWithResponseHandler:^(NSError * err, NSDictionary * values) { - NSLog(@"2b: TH reads OperationalStatus attribute from DUT Error: %@", err); + [cluster readAttributeMaxPressureWithResponseHandler:^(NSError * err, NSDictionary * values) { + NSLog(@"read the mandatory attribute: MaxPressure Error: %@", err); XCTAssertEqual(err.code, 0); - XCTAssertEqual([values[@"value"] unsignedCharValue], 0); - [expectation fulfill]; }]; [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } - -- (void)testSendClusterTest_TC_BI_1_1_000000_ReadAttribute +- (void)testSendClusterTest_TC_PCC_2_1_000005_ReadAttribute { - XCTestExpectation * expectation = [self expectationWithDescription:@"read the global attribute: ClusterRevision"]; + XCTestExpectation * expectation = [self expectationWithDescription:@"read the mandatory attribute: EffectiveOperationMode"]; CHIPDevice * device = GetConnectedDevice(); dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestBinaryInputBasic * cluster = [[CHIPTestBinaryInputBasic alloc] initWithDevice:device endpoint:1 queue:queue]; + CHIPTestPumpConfigurationAndControl * cluster = [[CHIPTestPumpConfigurationAndControl alloc] initWithDevice:device + endpoint:1 + queue:queue]; XCTAssertNotNil(cluster); - [cluster readAttributeClusterRevisionWithResponseHandler:^(NSError * err, NSDictionary * values) { - NSLog(@"read the global attribute: ClusterRevision Error: %@", err); + [cluster readAttributeEffectiveOperationModeWithResponseHandler:^(NSError * err, NSDictionary * values) { + NSLog(@"read the mandatory attribute: EffectiveOperationMode Error: %@", err); XCTAssertEqual(err.code, 0); - XCTAssertEqual([values[@"value"] unsignedShortValue], 1U); - [expectation fulfill]; }]; [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTest_TC_BI_1_1_000001_WriteAttribute +- (void)testSendClusterTest_TC_PCC_2_1_000006_ReadAttribute { - XCTestExpectation * expectation = - [self expectationWithDescription:@"write the default values to mandatory global attribute: ClusterRevision"]; + XCTestExpectation * expectation = [self expectationWithDescription:@"read the mandatory attribute: EffectiveControlMode"]; CHIPDevice * device = GetConnectedDevice(); dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestBinaryInputBasic * cluster = [[CHIPTestBinaryInputBasic alloc] initWithDevice:device endpoint:1 queue:queue]; + CHIPTestPumpConfigurationAndControl * cluster = [[CHIPTestPumpConfigurationAndControl alloc] initWithDevice:device + endpoint:1 + queue:queue]; XCTAssertNotNil(cluster); - uint16_t clusterRevisionArgument = 1U; - [cluster - writeAttributeClusterRevisionWithValue:clusterRevisionArgument - responseHandler:^(NSError * err, NSDictionary * values) { - NSLog(@"write the default values to mandatory global attribute: ClusterRevision Error: %@", err); + [cluster readAttributeEffectiveControlModeWithResponseHandler:^(NSError * err, NSDictionary * values) { + NSLog(@"read the mandatory attribute: EffectiveControlMode Error: %@", err); - XCTAssertEqual(err.code, 1); - [expectation fulfill]; - }]; + XCTAssertEqual(err.code, 0); + + [expectation fulfill]; + }]; [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTest_TC_BI_1_1_000002_ReadAttribute +- (void)testSendClusterTest_TC_PCC_2_1_000007_ReadAttribute { - XCTestExpectation * expectation = [self expectationWithDescription:@"reads back global attribute: ClusterRevision"]; + XCTestExpectation * expectation = [self expectationWithDescription:@"read the mandatory attribute: Capacity"]; CHIPDevice * device = GetConnectedDevice(); dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestBinaryInputBasic * cluster = [[CHIPTestBinaryInputBasic alloc] initWithDevice:device endpoint:1 queue:queue]; + CHIPTestPumpConfigurationAndControl * cluster = [[CHIPTestPumpConfigurationAndControl alloc] initWithDevice:device + endpoint:1 + queue:queue]; XCTAssertNotNil(cluster); - [cluster readAttributeClusterRevisionWithResponseHandler:^(NSError * err, NSDictionary * values) { - NSLog(@"reads back global attribute: ClusterRevision Error: %@", err); + [cluster readAttributeCapacityWithResponseHandler:^(NSError * err, NSDictionary * values) { + NSLog(@"read the mandatory attribute: Capacity Error: %@", err); XCTAssertEqual(err.code, 0); - XCTAssertEqual([values[@"value"] unsignedShortValue], 1U); - [expectation fulfill]; }]; [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTest_TC_FLW_1_1_000000_WriteAttribute +- (void)testSendClusterTest_TC_RH_1_1_000000_WriteAttribute { XCTestExpectation * expectation = [self expectationWithDescription:@"write the default values to mandatory global attribute: ClusterRevision"]; CHIPDevice * device = GetConnectedDevice(); dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestFlowMeasurement * cluster = [[CHIPTestFlowMeasurement alloc] initWithDevice:device endpoint:1 queue:queue]; + CHIPTestRelativeHumidityMeasurement * cluster = [[CHIPTestRelativeHumidityMeasurement alloc] initWithDevice:device + endpoint:1 + queue:queue]; XCTAssertNotNil(cluster); - uint16_t clusterRevisionArgument = 2U; + uint16_t clusterRevisionArgument = 1U; [cluster writeAttributeClusterRevisionWithValue:clusterRevisionArgument responseHandler:^(NSError * err, NSDictionary * values) { @@ -4807,35 +5013,60 @@ - (void)testSendClusterTest_TC_TM_1_1_000002_ReadAttribute [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTest_TC_OCC_1_1_000000_ReadAttribute +- (void)testSendClusterTest_TC_TM_2_1_000000_ReadAttribute { - XCTestExpectation * expectation = [self expectationWithDescription:@"read the global attribute: ClusterRevision"]; + XCTestExpectation * expectation = [self expectationWithDescription:@"read the mandatory attribute: MeasuredValue"]; CHIPDevice * device = GetConnectedDevice(); dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestOccupancySensing * cluster = [[CHIPTestOccupancySensing alloc] initWithDevice:device endpoint:1 queue:queue]; + CHIPTestTemperatureMeasurement * cluster = [[CHIPTestTemperatureMeasurement alloc] initWithDevice:device + endpoint:1 + queue:queue]; XCTAssertNotNil(cluster); - [cluster readAttributeClusterRevisionWithResponseHandler:^(NSError * err, NSDictionary * values) { - NSLog(@"read the global attribute: ClusterRevision Error: %@", err); + [cluster readAttributeMeasuredValueWithResponseHandler:^(NSError * err, NSDictionary * values) { + NSLog(@"read the mandatory attribute: MeasuredValue Error: %@", err); XCTAssertEqual(err.code, 0); - XCTAssertEqual([values[@"value"] unsignedShortValue], 2U); - [expectation fulfill]; }]; [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTest_TC_OCC_1_1_000001_WriteAttribute + +- (void)testSendClusterTest_TC_TSTAT_1_1_000000_WriteAttribute { XCTestExpectation * expectation = [self expectationWithDescription:@"write the default values to mandatory global attribute: ClusterRevision"]; CHIPDevice * device = GetConnectedDevice(); dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestOccupancySensing * cluster = [[CHIPTestOccupancySensing alloc] initWithDevice:device endpoint:1 queue:queue]; + CHIPTestThermostat * cluster = [[CHIPTestThermostat alloc] initWithDevice:device endpoint:1 queue:queue]; + XCTAssertNotNil(cluster); + + uint16_t clusterRevisionArgument = 5U; + [cluster + writeAttributeClusterRevisionWithValue:clusterRevisionArgument + responseHandler:^(NSError * err, NSDictionary * values) { + NSLog(@"write the default values to mandatory global attribute: ClusterRevision Error: %@", err); + + XCTAssertEqual(err.code, 1); + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} + +- (void)testSendClusterTest_TC_TSUIC_1_1_000000_WriteAttribute +{ + XCTestExpectation * expectation = + [self expectationWithDescription:@"write the default values to mandatory global attribute: ClusterRevision"]; + + CHIPDevice * device = GetConnectedDevice(); + dispatch_queue_t queue = dispatch_get_main_queue(); + CHIPTestThermostatUserInterfaceConfiguration * cluster = + [[CHIPTestThermostatUserInterfaceConfiguration alloc] initWithDevice:device endpoint:1 queue:queue]; XCTAssertNotNil(cluster); uint16_t clusterRevisionArgument = 2U; @@ -4851,87 +5082,82 @@ - (void)testSendClusterTest_TC_OCC_1_1_000001_WriteAttribute [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTestOperationalCredentialsCluster_000000_ReadAttribute +- (void)testSendClusterTest_TC_TSUIC_2_1_000000_ReadAttribute { - XCTestExpectation * expectation = [self expectationWithDescription:@"Read number of supported fabrics"]; + XCTestExpectation * expectation = [self expectationWithDescription:@"read the mandatory attribute: TemperatureDisplayMode"]; CHIPDevice * device = GetConnectedDevice(); dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestOperationalCredentials * cluster = [[CHIPTestOperationalCredentials alloc] initWithDevice:device - endpoint:0 - queue:queue]; + CHIPTestThermostatUserInterfaceConfiguration * cluster = + [[CHIPTestThermostatUserInterfaceConfiguration alloc] initWithDevice:device endpoint:1 queue:queue]; XCTAssertNotNil(cluster); - [cluster readAttributeSupportedFabricsWithResponseHandler:^(NSError * err, NSDictionary * values) { - NSLog(@"Read number of supported fabrics Error: %@", err); + [cluster readAttributeTemperatureDisplayModeWithResponseHandler:^(NSError * err, NSDictionary * values) { + NSLog(@"read the mandatory attribute: TemperatureDisplayMode Error: %@", err); XCTAssertEqual(err.code, 0); - XCTAssertGreaterThanOrEqual([values[@"value"] unsignedCharValue], 4); + XCTAssertEqual([values[@"value"] unsignedCharValue], 0); [expectation fulfill]; }]; [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTestOperationalCredentialsCluster_000001_ReadAttribute +- (void)testSendClusterTest_TC_TSUIC_2_1_000001_ReadAttribute { - XCTestExpectation * expectation = [self expectationWithDescription:@"Read number of commissioned fabrics"]; + XCTestExpectation * expectation = [self expectationWithDescription:@"read the mandatory attribute: TemperatureDisplayMode"]; CHIPDevice * device = GetConnectedDevice(); dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestOperationalCredentials * cluster = [[CHIPTestOperationalCredentials alloc] initWithDevice:device - endpoint:0 - queue:queue]; + CHIPTestThermostatUserInterfaceConfiguration * cluster = + [[CHIPTestThermostatUserInterfaceConfiguration alloc] initWithDevice:device endpoint:1 queue:queue]; XCTAssertNotNil(cluster); - [cluster readAttributeCommissionedFabricsWithResponseHandler:^(NSError * err, NSDictionary * values) { - NSLog(@"Read number of commissioned fabrics Error: %@", err); + [cluster readAttributeTemperatureDisplayModeWithResponseHandler:^(NSError * err, NSDictionary * values) { + NSLog(@"read the mandatory attribute: TemperatureDisplayMode Error: %@", err); XCTAssertEqual(err.code, 0); - XCTAssertGreaterThanOrEqual([values[@"value"] unsignedCharValue], 1); - [expectation fulfill]; }]; [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } - -- (void)testSendClusterTest_TC_LVL_1_1_000000_WriteAttribute +- (void)testSendClusterTest_TC_TSUIC_2_1_000002_WriteAttribute { - XCTestExpectation * expectation = - [self expectationWithDescription:@"write the default values to mandatory global attribute: ClusterRevision"]; + XCTestExpectation * expectation = [self expectationWithDescription:@"write to the mandatory attribute: TemperatureDisplayMode"]; CHIPDevice * device = GetConnectedDevice(); dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestLevelControl * cluster = [[CHIPTestLevelControl alloc] initWithDevice:device endpoint:1 queue:queue]; + CHIPTestThermostatUserInterfaceConfiguration * cluster = + [[CHIPTestThermostatUserInterfaceConfiguration alloc] initWithDevice:device endpoint:1 queue:queue]; XCTAssertNotNil(cluster); - uint16_t clusterRevisionArgument = 4U; - [cluster - writeAttributeClusterRevisionWithValue:clusterRevisionArgument - responseHandler:^(NSError * err, NSDictionary * values) { - NSLog(@"write the default values to mandatory global attribute: ClusterRevision Error: %@", err); + uint8_t temperatureDisplayModeArgument = 0; + [cluster writeAttributeTemperatureDisplayModeWithValue:temperatureDisplayModeArgument + responseHandler:^(NSError * err, NSDictionary * values) { + NSLog(@"write to the mandatory attribute: TemperatureDisplayMode Error: %@", err); - XCTAssertEqual(err.code, 1); - [expectation fulfill]; - }]; + XCTAssertEqual(err.code, 0); + + [expectation fulfill]; + }]; [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } - -- (void)testSendClusterTest_TC_LVL_2_1_000000_ReadAttribute +- (void)testSendClusterTest_TC_TSUIC_2_1_000003_ReadAttribute { - XCTestExpectation * expectation = [self expectationWithDescription:@"reads current Level attribute from DUT"]; + XCTestExpectation * expectation = [self expectationWithDescription:@"read the mandatory attribute: TemperatureDisplayMode"]; CHIPDevice * device = GetConnectedDevice(); dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestLevelControl * cluster = [[CHIPTestLevelControl alloc] initWithDevice:device endpoint:1 queue:queue]; + CHIPTestThermostatUserInterfaceConfiguration * cluster = + [[CHIPTestThermostatUserInterfaceConfiguration alloc] initWithDevice:device endpoint:1 queue:queue]; XCTAssertNotNil(cluster); - [cluster readAttributeCurrentLevelWithResponseHandler:^(NSError * err, NSDictionary * values) { - NSLog(@"reads current Level attribute from DUT Error: %@", err); + [cluster readAttributeTemperatureDisplayModeWithResponseHandler:^(NSError * err, NSDictionary * values) { + NSLog(@"read the mandatory attribute: TemperatureDisplayMode Error: %@", err); XCTAssertEqual(err.code, 0); @@ -4942,396 +5168,414 @@ - (void)testSendClusterTest_TC_LVL_2_1_000000_ReadAttribute [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTest_TC_LVL_2_1_000001_MoveToLevel +- (void)testSendClusterTest_TC_TSUIC_2_1_000004_ReadAttribute { - XCTestExpectation * expectation = [self expectationWithDescription:@"sends a Move to level command"]; + XCTestExpectation * expectation = [self expectationWithDescription:@"read the mandatory attribute: TemperatureDisplayMode"]; CHIPDevice * device = GetConnectedDevice(); dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestLevelControl * cluster = [[CHIPTestLevelControl alloc] initWithDevice:device endpoint:1 queue:queue]; + CHIPTestThermostatUserInterfaceConfiguration * cluster = + [[CHIPTestThermostatUserInterfaceConfiguration alloc] initWithDevice:device endpoint:1 queue:queue]; XCTAssertNotNil(cluster); - uint8_t levelArgument = 64; - uint16_t transitionTimeArgument = 0U; - uint8_t optionMaskArgument = 1; - uint8_t optionOverrideArgument = 1; - [cluster moveToLevel:levelArgument - transitionTime:transitionTimeArgument - optionMask:optionMaskArgument - optionOverride:optionOverrideArgument - responseHandler:^(NSError * err, NSDictionary * values) { - NSLog(@"sends a Move to level command Error: %@", err); - - XCTAssertEqual(err.code, 0); + [cluster readAttributeTemperatureDisplayModeWithResponseHandler:^(NSError * err, NSDictionary * values) { + NSLog(@"read the mandatory attribute: TemperatureDisplayMode Error: %@", err); - [expectation fulfill]; - }]; + XCTAssertEqual(err.code, 0); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_LVL_2_1_000002_WaitForMs -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Wait 10ms"]; + [expectation fulfill]; + }]; - dispatch_queue_t queue = dispatch_get_main_queue(); - WaitForMs(expectation, queue, 10); [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTest_TC_LVL_2_1_000003_ReadAttribute +- (void)testSendClusterTest_TC_TSUIC_2_1_000005_ReadAttribute { - XCTestExpectation * expectation = [self expectationWithDescription:@"reads current Level attribute from DUT"]; + XCTestExpectation * expectation = [self expectationWithDescription:@"read the mandatory attribute: KeypadLockout"]; CHIPDevice * device = GetConnectedDevice(); dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestLevelControl * cluster = [[CHIPTestLevelControl alloc] initWithDevice:device endpoint:1 queue:queue]; + CHIPTestThermostatUserInterfaceConfiguration * cluster = + [[CHIPTestThermostatUserInterfaceConfiguration alloc] initWithDevice:device endpoint:1 queue:queue]; XCTAssertNotNil(cluster); - [cluster readAttributeCurrentLevelWithResponseHandler:^(NSError * err, NSDictionary * values) { - NSLog(@"reads current Level attribute from DUT Error: %@", err); + [cluster readAttributeKeypadLockoutWithResponseHandler:^(NSError * err, NSDictionary * values) { + NSLog(@"read the mandatory attribute: KeypadLockout Error: %@", err); XCTAssertEqual(err.code, 0); - XCTAssertEqual([values[@"value"] unsignedCharValue], 64); + XCTAssertEqual([values[@"value"] unsignedCharValue], 0); [expectation fulfill]; }]; [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTest_TC_LVL_2_1_000004_MoveToLevel +- (void)testSendClusterTest_TC_TSUIC_2_1_000006_ReadAttribute { - XCTestExpectation * expectation = [self expectationWithDescription:@"sends a Move to level command"]; + XCTestExpectation * expectation = [self expectationWithDescription:@"read the mandatory attribute: KeypadLockout"]; CHIPDevice * device = GetConnectedDevice(); dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestLevelControl * cluster = [[CHIPTestLevelControl alloc] initWithDevice:device endpoint:1 queue:queue]; + CHIPTestThermostatUserInterfaceConfiguration * cluster = + [[CHIPTestThermostatUserInterfaceConfiguration alloc] initWithDevice:device endpoint:1 queue:queue]; XCTAssertNotNil(cluster); - uint8_t levelArgument = 128; - uint16_t transitionTimeArgument = 1U; - uint8_t optionMaskArgument = 1; - uint8_t optionOverrideArgument = 1; - [cluster moveToLevel:levelArgument - transitionTime:transitionTimeArgument - optionMask:optionMaskArgument - optionOverride:optionOverrideArgument - responseHandler:^(NSError * err, NSDictionary * values) { - NSLog(@"sends a Move to level command Error: %@", err); + [cluster readAttributeKeypadLockoutWithResponseHandler:^(NSError * err, NSDictionary * values) { + NSLog(@"read the mandatory attribute: KeypadLockout Error: %@", err); - XCTAssertEqual(err.code, 0); + XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; + [expectation fulfill]; + }]; [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTest_TC_LVL_2_1_000005_WaitForMs +- (void)testSendClusterTest_TC_TSUIC_2_1_000007_WriteAttribute { - XCTestExpectation * expectation = [self expectationWithDescription:@"Wait 100ms"]; + XCTestExpectation * expectation = [self expectationWithDescription:@"write to the mandatory attribute: KeypadLockout"]; + CHIPDevice * device = GetConnectedDevice(); dispatch_queue_t queue = dispatch_get_main_queue(); - WaitForMs(expectation, queue, 100); + CHIPTestThermostatUserInterfaceConfiguration * cluster = + [[CHIPTestThermostatUserInterfaceConfiguration alloc] initWithDevice:device endpoint:1 queue:queue]; + XCTAssertNotNil(cluster); + + uint8_t keypadLockoutArgument = 0; + [cluster writeAttributeKeypadLockoutWithValue:keypadLockoutArgument + responseHandler:^(NSError * err, NSDictionary * values) { + NSLog(@"write to the mandatory attribute: KeypadLockout Error: %@", err); + + XCTAssertEqual(err.code, 0); + + [expectation fulfill]; + }]; + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTest_TC_LVL_2_1_000006_ReadAttribute +- (void)testSendClusterTest_TC_TSUIC_2_1_000008_ReadAttribute { - XCTestExpectation * expectation = [self expectationWithDescription:@"reads current Level attribute from DUT"]; + XCTestExpectation * expectation = [self expectationWithDescription:@"read the mandatory attribute: KeypadLockout"]; CHIPDevice * device = GetConnectedDevice(); dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestLevelControl * cluster = [[CHIPTestLevelControl alloc] initWithDevice:device endpoint:1 queue:queue]; + CHIPTestThermostatUserInterfaceConfiguration * cluster = + [[CHIPTestThermostatUserInterfaceConfiguration alloc] initWithDevice:device endpoint:1 queue:queue]; XCTAssertNotNil(cluster); - [cluster readAttributeCurrentLevelWithResponseHandler:^(NSError * err, NSDictionary * values) { - NSLog(@"reads current Level attribute from DUT Error: %@", err); + [cluster readAttributeKeypadLockoutWithResponseHandler:^(NSError * err, NSDictionary * values) { + NSLog(@"read the mandatory attribute: KeypadLockout Error: %@", err); XCTAssertEqual(err.code, 0); - XCTAssertEqual([values[@"value"] unsignedCharValue], 128); + XCTAssertEqual([values[@"value"] unsignedCharValue], 0); [expectation fulfill]; }]; [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTest_TC_LVL_2_1_000007_ReadAttribute +- (void)testSendClusterTest_TC_TSUIC_2_1_000009_ReadAttribute { - XCTestExpectation * expectation = [self expectationWithDescription:@"reads On Off Transition Time attribute from DUT"]; + XCTestExpectation * expectation = [self expectationWithDescription:@"read the mandatory attribute: KeypadLockout"]; CHIPDevice * device = GetConnectedDevice(); dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestLevelControl * cluster = [[CHIPTestLevelControl alloc] initWithDevice:device endpoint:1 queue:queue]; + CHIPTestThermostatUserInterfaceConfiguration * cluster = + [[CHIPTestThermostatUserInterfaceConfiguration alloc] initWithDevice:device endpoint:1 queue:queue]; XCTAssertNotNil(cluster); - [cluster readAttributeOnOffTransitionTimeWithResponseHandler:^(NSError * err, NSDictionary * values) { - NSLog(@"reads On Off Transition Time attribute from DUT Error: %@", err); + [cluster readAttributeKeypadLockoutWithResponseHandler:^(NSError * err, NSDictionary * values) { + NSLog(@"read the mandatory attribute: KeypadLockout Error: %@", err); XCTAssertEqual(err.code, 0); - XCTAssertEqual([values[@"value"] unsignedShortValue], 0U); - [expectation fulfill]; }]; [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTest_TC_LVL_2_1_000008_MoveToLevel +- (void)testSendClusterTest_TC_TSUIC_2_1_000010_ReadAttribute { - XCTestExpectation * expectation = [self expectationWithDescription:@"sends a Move to level command"]; + XCTestExpectation * expectation = + [self expectationWithDescription:@"read the optional attribute: ScheduleProgrammingVisibility"]; CHIPDevice * device = GetConnectedDevice(); dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestLevelControl * cluster = [[CHIPTestLevelControl alloc] initWithDevice:device endpoint:1 queue:queue]; + CHIPTestThermostatUserInterfaceConfiguration * cluster = + [[CHIPTestThermostatUserInterfaceConfiguration alloc] initWithDevice:device endpoint:1 queue:queue]; XCTAssertNotNil(cluster); - uint8_t levelArgument = 254; - uint16_t transitionTimeArgument = 65535U; - uint8_t optionMaskArgument = 1; - uint8_t optionOverrideArgument = 1; - [cluster moveToLevel:levelArgument - transitionTime:transitionTimeArgument - optionMask:optionMaskArgument - optionOverride:optionOverrideArgument - responseHandler:^(NSError * err, NSDictionary * values) { - NSLog(@"sends a Move to level command Error: %@", err); + [cluster readAttributeScheduleProgrammingVisibilityWithResponseHandler:^(NSError * err, NSDictionary * values) { + NSLog(@"read the optional attribute: ScheduleProgrammingVisibility Error: %@", err); - XCTAssertEqual(err.code, 0); + XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; + XCTAssertEqual([values[@"value"] unsignedCharValue], 0); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_LVL_2_1_000009_WaitForMs -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Wait 1ms"]; + [expectation fulfill]; + }]; - dispatch_queue_t queue = dispatch_get_main_queue(); - WaitForMs(expectation, queue, 1); [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTest_TC_LVL_2_1_000010_ReadAttribute +- (void)testSendClusterTest_TC_TSUIC_2_1_000011_ReadAttribute { - XCTestExpectation * expectation = [self expectationWithDescription:@"reads current Level attribute from DUT"]; + XCTestExpectation * expectation = + [self expectationWithDescription:@"read the optional attribute: ScheduleProgrammingVisibility"]; CHIPDevice * device = GetConnectedDevice(); dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestLevelControl * cluster = [[CHIPTestLevelControl alloc] initWithDevice:device endpoint:1 queue:queue]; + CHIPTestThermostatUserInterfaceConfiguration * cluster = + [[CHIPTestThermostatUserInterfaceConfiguration alloc] initWithDevice:device endpoint:1 queue:queue]; XCTAssertNotNil(cluster); - [cluster readAttributeCurrentLevelWithResponseHandler:^(NSError * err, NSDictionary * values) { - NSLog(@"reads current Level attribute from DUT Error: %@", err); + [cluster readAttributeScheduleProgrammingVisibilityWithResponseHandler:^(NSError * err, NSDictionary * values) { + NSLog(@"read the optional attribute: ScheduleProgrammingVisibility Error: %@", err); XCTAssertEqual(err.code, 0); - XCTAssertEqual([values[@"value"] unsignedCharValue], 254); - [expectation fulfill]; }]; [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTest_TC_LVL_2_1_000011_MoveToLevel +- (void)testSendClusterTest_TC_TSUIC_2_1_000012_WriteAttribute { - XCTestExpectation * expectation = [self expectationWithDescription:@"Reset level to 0"]; + XCTestExpectation * expectation = + [self expectationWithDescription:@"write to the mandatory attribute: ScheduleProgrammingVisibility"]; CHIPDevice * device = GetConnectedDevice(); dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestLevelControl * cluster = [[CHIPTestLevelControl alloc] initWithDevice:device endpoint:1 queue:queue]; + CHIPTestThermostatUserInterfaceConfiguration * cluster = + [[CHIPTestThermostatUserInterfaceConfiguration alloc] initWithDevice:device endpoint:1 queue:queue]; XCTAssertNotNil(cluster); - uint8_t levelArgument = 0; - uint16_t transitionTimeArgument = 0U; - uint8_t optionMaskArgument = 1; - uint8_t optionOverrideArgument = 1; - [cluster moveToLevel:levelArgument - transitionTime:transitionTimeArgument - optionMask:optionMaskArgument - optionOverride:optionOverrideArgument - responseHandler:^(NSError * err, NSDictionary * values) { - NSLog(@"Reset level to 0 Error: %@", err); + uint8_t scheduleProgrammingVisibilityArgument = 0; + [cluster + writeAttributeScheduleProgrammingVisibilityWithValue:scheduleProgrammingVisibilityArgument + responseHandler:^(NSError * err, NSDictionary * values) { + NSLog(@"write to the mandatory attribute: ScheduleProgrammingVisibility Error: %@", + err); - XCTAssertEqual(err.code, 0); + XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; + [expectation fulfill]; + }]; [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTest_TC_LVL_2_1_000012_WaitForMs +- (void)testSendClusterTest_TC_TSUIC_2_1_000013_ReadAttribute { - XCTestExpectation * expectation = [self expectationWithDescription:@"Wait 10ms"]; + XCTestExpectation * expectation = + [self expectationWithDescription:@"read the optional attribute: ScheduleProgrammingVisibility"]; + CHIPDevice * device = GetConnectedDevice(); dispatch_queue_t queue = dispatch_get_main_queue(); - WaitForMs(expectation, queue, 10); + CHIPTestThermostatUserInterfaceConfiguration * cluster = + [[CHIPTestThermostatUserInterfaceConfiguration alloc] initWithDevice:device endpoint:1 queue:queue]; + XCTAssertNotNil(cluster); + + [cluster readAttributeScheduleProgrammingVisibilityWithResponseHandler:^(NSError * err, NSDictionary * values) { + NSLog(@"read the optional attribute: ScheduleProgrammingVisibility Error: %@", err); + + XCTAssertEqual(err.code, 0); + + XCTAssertEqual([values[@"value"] unsignedCharValue], 0); + + [expectation fulfill]; + }]; + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } - -- (void)testSendClusterTest_TC_LVL_3_1_000000_ReadAttribute +- (void)testSendClusterTest_TC_TSUIC_2_1_000014_ReadAttribute { - XCTestExpectation * expectation = [self expectationWithDescription:@"reads current level attribute from DUT"]; + XCTestExpectation * expectation = + [self expectationWithDescription:@"read the optional attribute: ScheduleProgrammingVisibility"]; CHIPDevice * device = GetConnectedDevice(); dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestLevelControl * cluster = [[CHIPTestLevelControl alloc] initWithDevice:device endpoint:1 queue:queue]; + CHIPTestThermostatUserInterfaceConfiguration * cluster = + [[CHIPTestThermostatUserInterfaceConfiguration alloc] initWithDevice:device endpoint:1 queue:queue]; XCTAssertNotNil(cluster); - [cluster readAttributeCurrentLevelWithResponseHandler:^(NSError * err, NSDictionary * values) { - NSLog(@"reads current level attribute from DUT Error: %@", err); + [cluster readAttributeScheduleProgrammingVisibilityWithResponseHandler:^(NSError * err, NSDictionary * values) { + NSLog(@"read the optional attribute: ScheduleProgrammingVisibility Error: %@", err); XCTAssertEqual(err.code, 0); - XCTAssertEqual([values[@"value"] unsignedCharValue], 0); - [expectation fulfill]; }]; [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTest_TC_LVL_3_1_000001_ReadAttribute + +- (void)testSendClusterTest_TC_DIAGTH_1_1_000000_ReadAttribute { - XCTestExpectation * expectation = [self expectationWithDescription:@"reads max level attribute from DUT"]; + XCTestExpectation * expectation = [self expectationWithDescription:@"read the global attribute: ClusterRevision"]; CHIPDevice * device = GetConnectedDevice(); dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestLevelControl * cluster = [[CHIPTestLevelControl alloc] initWithDevice:device endpoint:1 queue:queue]; + CHIPTestThreadNetworkDiagnostics * cluster = [[CHIPTestThreadNetworkDiagnostics alloc] initWithDevice:device + endpoint:0 + queue:queue]; XCTAssertNotNil(cluster); - [cluster readAttributeMaxLevelWithResponseHandler:^(NSError * err, NSDictionary * values) { - NSLog(@"reads max level attribute from DUT Error: %@", err); + [cluster readAttributeClusterRevisionWithResponseHandler:^(NSError * err, NSDictionary * values) { + NSLog(@"read the global attribute: ClusterRevision Error: %@", err); XCTAssertEqual(err.code, 0); - XCTAssertEqual([values[@"value"] unsignedCharValue], 255); + XCTAssertEqual([values[@"value"] unsignedShortValue], 1U); [expectation fulfill]; }]; [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTest_TC_LVL_3_1_000002_Move +- (void)testSendClusterTest_TC_DIAGTH_1_1_000001_WriteAttribute { - XCTestExpectation * expectation = [self expectationWithDescription:@"sends a Move up command"]; + XCTestExpectation * expectation = + [self expectationWithDescription:@"write the default values to mandatory global attribute: ClusterRevision"]; CHIPDevice * device = GetConnectedDevice(); dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestLevelControl * cluster = [[CHIPTestLevelControl alloc] initWithDevice:device endpoint:1 queue:queue]; + CHIPTestThreadNetworkDiagnostics * cluster = [[CHIPTestThreadNetworkDiagnostics alloc] initWithDevice:device + endpoint:0 + queue:queue]; XCTAssertNotNil(cluster); - uint8_t moveModeArgument = 0; - uint8_t rateArgument = 200; - uint8_t optionMaskArgument = 1; - uint8_t optionOverrideArgument = 1; - [cluster move:moveModeArgument - rate:rateArgument - optionMask:optionMaskArgument - optionOverride:optionOverrideArgument - responseHandler:^(NSError * err, NSDictionary * values) { - NSLog(@"sends a Move up command Error: %@", err); - - XCTAssertEqual(err.code, 0); + uint16_t clusterRevisionArgument = 1U; + [cluster + writeAttributeClusterRevisionWithValue:clusterRevisionArgument + responseHandler:^(NSError * err, NSDictionary * values) { + NSLog(@"write the default values to mandatory global attribute: ClusterRevision Error: %@", err); - [expectation fulfill]; - }]; + XCTAssertEqual(err.code, 1); + [expectation fulfill]; + }]; [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTest_TC_LVL_3_1_000003_WaitForMs +- (void)testSendClusterTest_TC_DIAGTH_1_1_000002_ReadAttribute { - XCTestExpectation * expectation = [self expectationWithDescription:@"Wait 2500ms"]; + XCTestExpectation * expectation = [self expectationWithDescription:@"reads back global attribute: ClusterRevision"]; + CHIPDevice * device = GetConnectedDevice(); dispatch_queue_t queue = dispatch_get_main_queue(); - WaitForMs(expectation, queue, 2500); + CHIPTestThreadNetworkDiagnostics * cluster = [[CHIPTestThreadNetworkDiagnostics alloc] initWithDevice:device + endpoint:0 + queue:queue]; + XCTAssertNotNil(cluster); + + [cluster readAttributeClusterRevisionWithResponseHandler:^(NSError * err, NSDictionary * values) { + NSLog(@"reads back global attribute: ClusterRevision Error: %@", err); + + XCTAssertEqual(err.code, 0); + + XCTAssertEqual([values[@"value"] unsignedShortValue], 1U); + + [expectation fulfill]; + }]; + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTest_TC_LVL_3_1_000004_ReadAttribute + +- (void)testSendClusterTest_TC_WNCV_1_1_000000_ReadAttribute { - XCTestExpectation * expectation = [self expectationWithDescription:@"reads current level attribute from DUT"]; + XCTestExpectation * expectation = [self expectationWithDescription:@"read the global attribute: ClusterRevision"]; CHIPDevice * device = GetConnectedDevice(); dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestLevelControl * cluster = [[CHIPTestLevelControl alloc] initWithDevice:device endpoint:1 queue:queue]; + CHIPTestWindowCovering * cluster = [[CHIPTestWindowCovering alloc] initWithDevice:device endpoint:1 queue:queue]; XCTAssertNotNil(cluster); - [cluster readAttributeCurrentLevelWithResponseHandler:^(NSError * err, NSDictionary * values) { - NSLog(@"reads current level attribute from DUT Error: %@", err); + [cluster readAttributeClusterRevisionWithResponseHandler:^(NSError * err, NSDictionary * values) { + NSLog(@"read the global attribute: ClusterRevision Error: %@", err); XCTAssertEqual(err.code, 0); - XCTAssertEqual([values[@"value"] unsignedCharValue], 255); + XCTAssertEqual([values[@"value"] unsignedShortValue], 5U); [expectation fulfill]; }]; [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTest_TC_LVL_3_1_000005_ReadAttribute +- (void)testSendClusterTest_TC_WNCV_1_1_000001_WriteAttribute { - XCTestExpectation * expectation = [self expectationWithDescription:@"reads min level attribute from DUT"]; + XCTestExpectation * expectation = + [self expectationWithDescription:@"write the default value to mandatory global attribute: ClusterRevision"]; CHIPDevice * device = GetConnectedDevice(); dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestLevelControl * cluster = [[CHIPTestLevelControl alloc] initWithDevice:device endpoint:1 queue:queue]; + CHIPTestWindowCovering * cluster = [[CHIPTestWindowCovering alloc] initWithDevice:device endpoint:1 queue:queue]; XCTAssertNotNil(cluster); - [cluster readAttributeMinLevelWithResponseHandler:^(NSError * err, NSDictionary * values) { - NSLog(@"reads min level attribute from DUT Error: %@", err); + uint16_t clusterRevisionArgument = 5U; + [cluster + writeAttributeClusterRevisionWithValue:clusterRevisionArgument + responseHandler:^(NSError * err, NSDictionary * values) { + NSLog(@"write the default value to mandatory global attribute: ClusterRevision Error: %@", err); + + XCTAssertEqual(err.code, 1); + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} +- (void)testSendClusterTest_TC_WNCV_1_1_000002_ReadAttribute +{ + XCTestExpectation * expectation = [self expectationWithDescription:@"reads back global attribute: ClusterRevision"]; + + CHIPDevice * device = GetConnectedDevice(); + dispatch_queue_t queue = dispatch_get_main_queue(); + CHIPTestWindowCovering * cluster = [[CHIPTestWindowCovering alloc] initWithDevice:device endpoint:1 queue:queue]; + XCTAssertNotNil(cluster); + + [cluster readAttributeClusterRevisionWithResponseHandler:^(NSError * err, NSDictionary * values) { + NSLog(@"reads back global attribute: ClusterRevision Error: %@", err); XCTAssertEqual(err.code, 0); - XCTAssertEqual([values[@"value"] unsignedCharValue], 0); + XCTAssertEqual([values[@"value"] unsignedShortValue], 5U); [expectation fulfill]; }]; [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTest_TC_LVL_3_1_000006_Move + +- (void)testSendClusterTest_TC_WNCV_2_1_000000_ReadAttribute { - XCTestExpectation * expectation = [self expectationWithDescription:@"sends a Move down command"]; + XCTestExpectation * expectation = [self expectationWithDescription:@"read the RO mandatory attribute default: Type"]; CHIPDevice * device = GetConnectedDevice(); dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestLevelControl * cluster = [[CHIPTestLevelControl alloc] initWithDevice:device endpoint:1 queue:queue]; + CHIPTestWindowCovering * cluster = [[CHIPTestWindowCovering alloc] initWithDevice:device endpoint:1 queue:queue]; XCTAssertNotNil(cluster); - uint8_t moveModeArgument = 1; - uint8_t rateArgument = 250; - uint8_t optionMaskArgument = 1; - uint8_t optionOverrideArgument = 1; - [cluster move:moveModeArgument - rate:rateArgument - optionMask:optionMaskArgument - optionOverride:optionOverrideArgument - responseHandler:^(NSError * err, NSDictionary * values) { - NSLog(@"sends a Move down command Error: %@", err); + [cluster readAttributeTypeWithResponseHandler:^(NSError * err, NSDictionary * values) { + NSLog(@"read the RO mandatory attribute default: Type Error: %@", err); - XCTAssertEqual(err.code, 0); + XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; + XCTAssertEqual([values[@"value"] unsignedCharValue], 0); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_LVL_3_1_000007_WaitForMs -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Wait 2500ms"]; + [expectation fulfill]; + }]; - dispatch_queue_t queue = dispatch_get_main_queue(); - WaitForMs(expectation, queue, 2500); [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTest_TC_LVL_3_1_000008_ReadAttribute +- (void)testSendClusterTest_TC_WNCV_2_1_000001_ReadAttribute { - XCTestExpectation * expectation = [self expectationWithDescription:@"reads current level attribute from DUT"]; + XCTestExpectation * expectation = [self expectationWithDescription:@"reads back the RO mandatory attribute: Type"]; CHIPDevice * device = GetConnectedDevice(); dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestLevelControl * cluster = [[CHIPTestLevelControl alloc] initWithDevice:device endpoint:1 queue:queue]; + CHIPTestWindowCovering * cluster = [[CHIPTestWindowCovering alloc] initWithDevice:device endpoint:1 queue:queue]; XCTAssertNotNil(cluster); - [cluster readAttributeCurrentLevelWithResponseHandler:^(NSError * err, NSDictionary * values) { - NSLog(@"reads current level attribute from DUT Error: %@", err); + [cluster readAttributeTypeWithResponseHandler:^(NSError * err, NSDictionary * values) { + NSLog(@"reads back the RO mandatory attribute: Type Error: %@", err); XCTAssertEqual(err.code, 0); @@ -5342,334 +5586,287 @@ - (void)testSendClusterTest_TC_LVL_3_1_000008_ReadAttribute [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTest_TC_LVL_3_1_000009_WriteAttribute +- (void)testSendClusterTest_TC_WNCV_2_1_000002_ReadAttribute { - XCTestExpectation * expectation = [self expectationWithDescription:@"Write default move rate attribute from DUT"]; + XCTestExpectation * expectation = [self expectationWithDescription:@"read the RO mandatory attribute default: ConfigStatus"]; CHIPDevice * device = GetConnectedDevice(); dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestLevelControl * cluster = [[CHIPTestLevelControl alloc] initWithDevice:device endpoint:1 queue:queue]; + CHIPTestWindowCovering * cluster = [[CHIPTestWindowCovering alloc] initWithDevice:device endpoint:1 queue:queue]; XCTAssertNotNil(cluster); - uint8_t defaultMoveRateArgument = 20; - [cluster writeAttributeDefaultMoveRateWithValue:defaultMoveRateArgument - responseHandler:^(NSError * err, NSDictionary * values) { - NSLog(@"Write default move rate attribute from DUT Error: %@", err); + [cluster readAttributeConfigStatusWithResponseHandler:^(NSError * err, NSDictionary * values) { + NSLog(@"read the RO mandatory attribute default: ConfigStatus Error: %@", err); - XCTAssertEqual(err.code, 0); + XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; + XCTAssertEqual([values[@"value"] unsignedCharValue], 3); + + [expectation fulfill]; + }]; [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTest_TC_LVL_3_1_000010_ReadAttribute +- (void)testSendClusterTest_TC_WNCV_2_1_000003_ReadAttribute { - XCTestExpectation * expectation = [self expectationWithDescription:@"reads default move rate attribute from DUT"]; + XCTestExpectation * expectation = [self expectationWithDescription:@"reads back the RO mandatory attribute: ConfigStatus"]; CHIPDevice * device = GetConnectedDevice(); dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestLevelControl * cluster = [[CHIPTestLevelControl alloc] initWithDevice:device endpoint:1 queue:queue]; + CHIPTestWindowCovering * cluster = [[CHIPTestWindowCovering alloc] initWithDevice:device endpoint:1 queue:queue]; XCTAssertNotNil(cluster); - [cluster readAttributeDefaultMoveRateWithResponseHandler:^(NSError * err, NSDictionary * values) { - NSLog(@"reads default move rate attribute from DUT Error: %@", err); + [cluster readAttributeConfigStatusWithResponseHandler:^(NSError * err, NSDictionary * values) { + NSLog(@"reads back the RO mandatory attribute: ConfigStatus Error: %@", err); XCTAssertEqual(err.code, 0); - XCTAssertEqual([values[@"value"] unsignedCharValue], 20); + XCTAssertEqual([values[@"value"] unsignedCharValue], 3); [expectation fulfill]; }]; [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTest_TC_LVL_3_1_000011_Move +- (void)testSendClusterTest_TC_WNCV_2_1_000004_ReadAttribute { - XCTestExpectation * expectation = [self expectationWithDescription:@"sends a Move up command at default move rate"]; + XCTestExpectation * expectation = + [self expectationWithDescription:@"read the RO mandatory attribute default: OperationalStatus"]; CHIPDevice * device = GetConnectedDevice(); dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestLevelControl * cluster = [[CHIPTestLevelControl alloc] initWithDevice:device endpoint:1 queue:queue]; + CHIPTestWindowCovering * cluster = [[CHIPTestWindowCovering alloc] initWithDevice:device endpoint:1 queue:queue]; XCTAssertNotNil(cluster); - uint8_t moveModeArgument = 1; - uint8_t rateArgument = 255; - uint8_t optionMaskArgument = 1; - uint8_t optionOverrideArgument = 1; - [cluster move:moveModeArgument - rate:rateArgument - optionMask:optionMaskArgument - optionOverride:optionOverrideArgument - responseHandler:^(NSError * err, NSDictionary * values) { - NSLog(@"sends a Move up command at default move rate Error: %@", err); + [cluster readAttributeOperationalStatusWithResponseHandler:^(NSError * err, NSDictionary * values) { + NSLog(@"read the RO mandatory attribute default: OperationalStatus Error: %@", err); - XCTAssertEqual(err.code, 0); + XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; + XCTAssertEqual([values[@"value"] unsignedCharValue], 0); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_LVL_3_1_000012_WaitForMs -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Wait 10ms"]; + [expectation fulfill]; + }]; - dispatch_queue_t queue = dispatch_get_main_queue(); - WaitForMs(expectation, queue, 10); [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTest_TC_LVL_3_1_000013_ReadAttribute +- (void)testSendClusterTest_TC_WNCV_2_1_000005_ReadAttribute { - XCTestExpectation * expectation = [self expectationWithDescription:@"reads current level attribute from DUT"]; + XCTestExpectation * expectation = [self expectationWithDescription:@"reads back the RO mandatory attribute: OperationalStatus"]; CHIPDevice * device = GetConnectedDevice(); dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestLevelControl * cluster = [[CHIPTestLevelControl alloc] initWithDevice:device endpoint:1 queue:queue]; + CHIPTestWindowCovering * cluster = [[CHIPTestWindowCovering alloc] initWithDevice:device endpoint:1 queue:queue]; XCTAssertNotNil(cluster); - [cluster readAttributeCurrentLevelWithResponseHandler:^(NSError * err, NSDictionary * values) { - NSLog(@"reads current level attribute from DUT Error: %@", err); + [cluster readAttributeOperationalStatusWithResponseHandler:^(NSError * err, NSDictionary * values) { + NSLog(@"reads back the RO mandatory attribute: OperationalStatus Error: %@", err); XCTAssertEqual(err.code, 0); - XCTAssertNotEqual([values[@"value"] unsignedCharValue], 255); + XCTAssertEqual([values[@"value"] unsignedCharValue], 0); [expectation fulfill]; }]; [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } - -- (void)testSendClusterTest_TC_CC_1_1_000000_WriteAttribute +- (void)testSendClusterTest_TC_WNCV_2_1_000006_ReadAttribute { - XCTestExpectation * expectation = - [self expectationWithDescription:@"write the default values to mandatory global attribute: ClusterRevision"]; + XCTestExpectation * expectation = [self expectationWithDescription:@"read the RO mandatory attribute default: EndProductType"]; CHIPDevice * device = GetConnectedDevice(); dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; + CHIPTestWindowCovering * cluster = [[CHIPTestWindowCovering alloc] initWithDevice:device endpoint:1 queue:queue]; XCTAssertNotNil(cluster); - uint16_t clusterRevisionArgument = 4U; - [cluster - writeAttributeClusterRevisionWithValue:clusterRevisionArgument - responseHandler:^(NSError * err, NSDictionary * values) { - NSLog(@"write the default values to mandatory global attribute: ClusterRevision Error: %@", err); + [cluster readAttributeEndProductTypeWithResponseHandler:^(NSError * err, NSDictionary * values) { + NSLog(@"read the RO mandatory attribute default: EndProductType Error: %@", err); - XCTAssertEqual(err.code, 1); - [expectation fulfill]; - }]; + XCTAssertEqual(err.code, 0); + + XCTAssertEqual([values[@"value"] unsignedCharValue], 0); + + [expectation fulfill]; + }]; [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } - -- (void)testSendClusterTest_TC_RH_1_1_000000_WriteAttribute +- (void)testSendClusterTest_TC_WNCV_2_1_000007_ReadAttribute { - XCTestExpectation * expectation = - [self expectationWithDescription:@"write the default values to mandatory global attribute: ClusterRevision"]; + XCTestExpectation * expectation = [self expectationWithDescription:@"reads back the RO mandatory attribute: EndProductType"]; CHIPDevice * device = GetConnectedDevice(); dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestRelativeHumidityMeasurement * cluster = [[CHIPTestRelativeHumidityMeasurement alloc] initWithDevice:device - endpoint:1 - queue:queue]; + CHIPTestWindowCovering * cluster = [[CHIPTestWindowCovering alloc] initWithDevice:device endpoint:1 queue:queue]; XCTAssertNotNil(cluster); - uint16_t clusterRevisionArgument = 1U; - [cluster - writeAttributeClusterRevisionWithValue:clusterRevisionArgument - responseHandler:^(NSError * err, NSDictionary * values) { - NSLog(@"write the default values to mandatory global attribute: ClusterRevision Error: %@", err); + [cluster readAttributeEndProductTypeWithResponseHandler:^(NSError * err, NSDictionary * values) { + NSLog(@"reads back the RO mandatory attribute: EndProductType Error: %@", err); - XCTAssertEqual(err.code, 1); - [expectation fulfill]; - }]; + XCTAssertEqual(err.code, 0); + + XCTAssertEqual([values[@"value"] unsignedCharValue], 0); + + [expectation fulfill]; + }]; [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } - -- (void)testSendClusterTest_TC_MC_1_1_000000_WriteAttribute +- (void)testSendClusterTest_TC_WNCV_2_1_000008_ReadAttribute { - XCTestExpectation * expectation = - [self expectationWithDescription:@"write the default values to mandatory global attribute: ClusterRevision"]; + XCTestExpectation * expectation = [self expectationWithDescription:@"read the RW mandatory attribute default: Mode"]; CHIPDevice * device = GetConnectedDevice(); dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestRelativeHumidityMeasurement * cluster = [[CHIPTestRelativeHumidityMeasurement alloc] initWithDevice:device - endpoint:1 - queue:queue]; + CHIPTestWindowCovering * cluster = [[CHIPTestWindowCovering alloc] initWithDevice:device endpoint:1 queue:queue]; XCTAssertNotNil(cluster); - uint16_t clusterRevisionArgument = 1U; - [cluster - writeAttributeClusterRevisionWithValue:clusterRevisionArgument - responseHandler:^(NSError * err, NSDictionary * values) { - NSLog(@"write the default values to mandatory global attribute: ClusterRevision Error: %@", err); + [cluster readAttributeModeWithResponseHandler:^(NSError * err, NSDictionary * values) { + NSLog(@"read the RW mandatory attribute default: Mode Error: %@", err); - XCTAssertEqual(err.code, 1); - [expectation fulfill]; - }]; + XCTAssertEqual(err.code, 0); + + XCTAssertEqual([values[@"value"] unsignedCharValue], 0); + + [expectation fulfill]; + }]; [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } - -- (void)testSendClusterTest_TC_TSTAT_1_1_000000_WriteAttribute +- (void)testSendClusterTest_TC_WNCV_2_1_000009_WriteAttribute { - XCTestExpectation * expectation = - [self expectationWithDescription:@"write the default values to mandatory global attribute: ClusterRevision"]; + XCTestExpectation * expectation = [self expectationWithDescription:@"write a value into the RW mandatory attribute:: Mode"]; CHIPDevice * device = GetConnectedDevice(); dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestThermostat * cluster = [[CHIPTestThermostat alloc] initWithDevice:device endpoint:1 queue:queue]; + CHIPTestWindowCovering * cluster = [[CHIPTestWindowCovering alloc] initWithDevice:device endpoint:1 queue:queue]; XCTAssertNotNil(cluster); - uint16_t clusterRevisionArgument = 5U; - [cluster - writeAttributeClusterRevisionWithValue:clusterRevisionArgument - responseHandler:^(NSError * err, NSDictionary * values) { - NSLog(@"write the default values to mandatory global attribute: ClusterRevision Error: %@", err); + uint8_t modeArgument = 7; + [cluster writeAttributeModeWithValue:modeArgument + responseHandler:^(NSError * err, NSDictionary * values) { + NSLog(@"write a value into the RW mandatory attribute:: Mode Error: %@", err); - XCTAssertEqual(err.code, 1); - [expectation fulfill]; - }]; + XCTAssertEqual(err.code, 0); + + [expectation fulfill]; + }]; [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } - -- (void)testSendClusterTest_TC_PCC_1_1_000000_WriteAttribute +- (void)testSendClusterTest_TC_WNCV_2_1_000010_ReadAttribute { - XCTestExpectation * expectation = - [self expectationWithDescription:@"write the default values to mandatory global attribute: ClusterRevision"]; + XCTestExpectation * expectation = [self expectationWithDescription:@"reads back the RW mandatory attribute: Mode"]; CHIPDevice * device = GetConnectedDevice(); dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestPumpConfigurationAndControl * cluster = [[CHIPTestPumpConfigurationAndControl alloc] initWithDevice:device - endpoint:1 - queue:queue]; + CHIPTestWindowCovering * cluster = [[CHIPTestWindowCovering alloc] initWithDevice:device endpoint:1 queue:queue]; XCTAssertNotNil(cluster); - uint16_t clusterRevisionArgument = 3U; - [cluster - writeAttributeClusterRevisionWithValue:clusterRevisionArgument - responseHandler:^(NSError * err, NSDictionary * values) { - NSLog(@"write the default values to mandatory global attribute: ClusterRevision Error: %@", err); + [cluster readAttributeModeWithResponseHandler:^(NSError * err, NSDictionary * values) { + NSLog(@"reads back the RW mandatory attribute: Mode Error: %@", err); - XCTAssertEqual(err.code, 1); - [expectation fulfill]; - }]; + XCTAssertEqual(err.code, 0); + + XCTAssertEqual([values[@"value"] unsignedCharValue], 7); + + [expectation fulfill]; + }]; [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTest_TC_TSUIC_1_1_000000_WriteAttribute +- (void)testSendClusterTest_TC_WNCV_3_1_000000_DownOrClose { - XCTestExpectation * expectation = - [self expectationWithDescription:@"write the default values to mandatory global attribute: ClusterRevision"]; + XCTestExpectation * expectation = [self expectationWithDescription:@"1a: TH adjusts the the DUT to a non-open position"]; CHIPDevice * device = GetConnectedDevice(); dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestThermostatUserInterfaceConfiguration * cluster = - [[CHIPTestThermostatUserInterfaceConfiguration alloc] initWithDevice:device endpoint:1 queue:queue]; + CHIPTestWindowCovering * cluster = [[CHIPTestWindowCovering alloc] initWithDevice:device endpoint:1 queue:queue]; XCTAssertNotNil(cluster); - uint16_t clusterRevisionArgument = 2U; - [cluster - writeAttributeClusterRevisionWithValue:clusterRevisionArgument - responseHandler:^(NSError * err, NSDictionary * values) { - NSLog(@"write the default values to mandatory global attribute: ClusterRevision Error: %@", err); + [cluster downOrClose:^(NSError * err, NSDictionary * values) { + NSLog(@"1a: TH adjusts the the DUT to a non-open position Error: %@", err); - XCTAssertEqual(err.code, 1); - [expectation fulfill]; - }]; + XCTAssertEqual(err.code, 0); + + [expectation fulfill]; + }]; [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } - -- (void)testSendClusterTest_TC_DIAGTH_1_1_000000_ReadAttribute +- (void)testSendClusterTest_TC_WNCV_3_1_000001_UpOrOpen { - XCTestExpectation * expectation = [self expectationWithDescription:@"read the global attribute: ClusterRevision"]; + XCTestExpectation * expectation = [self expectationWithDescription:@"2a: TH sends UpOrOpen command to DUT"]; CHIPDevice * device = GetConnectedDevice(); dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestThreadNetworkDiagnostics * cluster = [[CHIPTestThreadNetworkDiagnostics alloc] initWithDevice:device - endpoint:0 - queue:queue]; + CHIPTestWindowCovering * cluster = [[CHIPTestWindowCovering alloc] initWithDevice:device endpoint:1 queue:queue]; XCTAssertNotNil(cluster); - [cluster readAttributeClusterRevisionWithResponseHandler:^(NSError * err, NSDictionary * values) { - NSLog(@"read the global attribute: ClusterRevision Error: %@", err); + [cluster upOrOpen:^(NSError * err, NSDictionary * values) { + NSLog(@"2a: TH sends UpOrOpen command to DUT Error: %@", err); XCTAssertEqual(err.code, 0); - XCTAssertEqual([values[@"value"] unsignedShortValue], 1U); - [expectation fulfill]; }]; [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTest_TC_DIAGTH_1_1_000001_WriteAttribute +- (void)testSendClusterTest_TC_WNCV_3_1_000002_ReadAttribute { - XCTestExpectation * expectation = - [self expectationWithDescription:@"write the default values to mandatory global attribute: ClusterRevision"]; + XCTestExpectation * expectation = [self expectationWithDescription:@"3a: TH reads OperationalStatus attribute from DUT"]; CHIPDevice * device = GetConnectedDevice(); dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestThreadNetworkDiagnostics * cluster = [[CHIPTestThreadNetworkDiagnostics alloc] initWithDevice:device - endpoint:0 - queue:queue]; + CHIPTestWindowCovering * cluster = [[CHIPTestWindowCovering alloc] initWithDevice:device endpoint:1 queue:queue]; XCTAssertNotNil(cluster); - uint16_t clusterRevisionArgument = 1U; - [cluster - writeAttributeClusterRevisionWithValue:clusterRevisionArgument - responseHandler:^(NSError * err, NSDictionary * values) { - NSLog(@"write the default values to mandatory global attribute: ClusterRevision Error: %@", err); + [cluster readAttributeOperationalStatusWithResponseHandler:^(NSError * err, NSDictionary * values) { + NSLog(@"3a: TH reads OperationalStatus attribute from DUT Error: %@", err); - XCTAssertEqual(err.code, 1); - [expectation fulfill]; - }]; + XCTAssertEqual(err.code, 0); + + XCTAssertEqual([values[@"value"] unsignedCharValue], 0); + + [expectation fulfill]; + }]; [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTest_TC_DIAGTH_1_1_000002_ReadAttribute + +- (void)testSendClusterTest_TC_WNCV_3_2_000000_UpOrOpen { - XCTestExpectation * expectation = [self expectationWithDescription:@"reads back global attribute: ClusterRevision"]; + XCTestExpectation * expectation = [self expectationWithDescription:@"1a: TH adjusts the the DUT to a non-closed position"]; CHIPDevice * device = GetConnectedDevice(); dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestThreadNetworkDiagnostics * cluster = [[CHIPTestThreadNetworkDiagnostics alloc] initWithDevice:device - endpoint:0 - queue:queue]; + CHIPTestWindowCovering * cluster = [[CHIPTestWindowCovering alloc] initWithDevice:device endpoint:1 queue:queue]; XCTAssertNotNil(cluster); - [cluster readAttributeClusterRevisionWithResponseHandler:^(NSError * err, NSDictionary * values) { - NSLog(@"reads back global attribute: ClusterRevision Error: %@", err); + [cluster upOrOpen:^(NSError * err, NSDictionary * values) { + NSLog(@"1a: TH adjusts the the DUT to a non-closed position Error: %@", err); XCTAssertEqual(err.code, 0); - XCTAssertEqual([values[@"value"] unsignedShortValue], 1U); - [expectation fulfill]; }]; [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } - -- (void)testSendClusterTest_TC_TM_2_1_000000_ReadAttribute +- (void)testSendClusterTest_TC_WNCV_3_2_000001_DownOrClose { - XCTestExpectation * expectation = [self expectationWithDescription:@"read the mandatory attribute: MeasuredValue"]; + XCTestExpectation * expectation = [self expectationWithDescription:@"2a: TH sends DownOrClose command to DUT"]; CHIPDevice * device = GetConnectedDevice(); dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTemperatureMeasurement * cluster = [[CHIPTestTemperatureMeasurement alloc] initWithDevice:device - endpoint:1 - queue:queue]; + CHIPTestWindowCovering * cluster = [[CHIPTestWindowCovering alloc] initWithDevice:device endpoint:1 queue:queue]; XCTAssertNotNil(cluster); - [cluster readAttributeMeasuredValueWithResponseHandler:^(NSError * err, NSDictionary * values) { - NSLog(@"read the mandatory attribute: MeasuredValue Error: %@", err); + [cluster downOrClose:^(NSError * err, NSDictionary * values) { + NSLog(@"2a: TH sends DownOrClose command to DUT Error: %@", err); XCTAssertEqual(err.code, 0); @@ -5678,19 +5875,17 @@ - (void)testSendClusterTest_TC_TM_2_1_000000_ReadAttribute [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } - -- (void)testSendClusterTest_TC_TSUIC_2_1_000000_ReadAttribute +- (void)testSendClusterTest_TC_WNCV_3_2_000002_ReadAttribute { - XCTestExpectation * expectation = [self expectationWithDescription:@"read the mandatory attribute: TemperatureDisplayMode"]; + XCTestExpectation * expectation = [self expectationWithDescription:@"3a: TH reads OperationalStatus attribute from DUT"]; CHIPDevice * device = GetConnectedDevice(); dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestThermostatUserInterfaceConfiguration * cluster = - [[CHIPTestThermostatUserInterfaceConfiguration alloc] initWithDevice:device endpoint:1 queue:queue]; + CHIPTestWindowCovering * cluster = [[CHIPTestWindowCovering alloc] initWithDevice:device endpoint:1 queue:queue]; XCTAssertNotNil(cluster); - [cluster readAttributeTemperatureDisplayModeWithResponseHandler:^(NSError * err, NSDictionary * values) { - NSLog(@"read the mandatory attribute: TemperatureDisplayMode Error: %@", err); + [cluster readAttributeOperationalStatusWithResponseHandler:^(NSError * err, NSDictionary * values) { + NSLog(@"3a: TH reads OperationalStatus attribute from DUT Error: %@", err); XCTAssertEqual(err.code, 0); @@ -5701,18 +5896,18 @@ - (void)testSendClusterTest_TC_TSUIC_2_1_000000_ReadAttribute [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTest_TC_TSUIC_2_1_000001_ReadAttribute + +- (void)testSendClusterTest_TC_WNCV_3_3_000000_UpOrOpen { - XCTestExpectation * expectation = [self expectationWithDescription:@"read the mandatory attribute: TemperatureDisplayMode"]; + XCTestExpectation * expectation = [self expectationWithDescription:@"1a: TH adjusts the the DUT to a non-open position"]; CHIPDevice * device = GetConnectedDevice(); dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestThermostatUserInterfaceConfiguration * cluster = - [[CHIPTestThermostatUserInterfaceConfiguration alloc] initWithDevice:device endpoint:1 queue:queue]; + CHIPTestWindowCovering * cluster = [[CHIPTestWindowCovering alloc] initWithDevice:device endpoint:1 queue:queue]; XCTAssertNotNil(cluster); - [cluster readAttributeTemperatureDisplayModeWithResponseHandler:^(NSError * err, NSDictionary * values) { - NSLog(@"read the mandatory attribute: TemperatureDisplayMode Error: %@", err); + [cluster upOrOpen:^(NSError * err, NSDictionary * values) { + NSLog(@"1a: TH adjusts the the DUT to a non-open position Error: %@", err); XCTAssertEqual(err.code, 0); @@ -5721,40 +5916,36 @@ - (void)testSendClusterTest_TC_TSUIC_2_1_000001_ReadAttribute [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTest_TC_TSUIC_2_1_000002_WriteAttribute +- (void)testSendClusterTest_TC_WNCV_3_3_000001_StopMotion { - XCTestExpectation * expectation = [self expectationWithDescription:@"write to the mandatory attribute: TemperatureDisplayMode"]; + XCTestExpectation * expectation = [self expectationWithDescription:@"2a: TH sends StopMotion command to DUT"]; CHIPDevice * device = GetConnectedDevice(); dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestThermostatUserInterfaceConfiguration * cluster = - [[CHIPTestThermostatUserInterfaceConfiguration alloc] initWithDevice:device endpoint:1 queue:queue]; + CHIPTestWindowCovering * cluster = [[CHIPTestWindowCovering alloc] initWithDevice:device endpoint:1 queue:queue]; XCTAssertNotNil(cluster); - uint8_t temperatureDisplayModeArgument = 0; - [cluster writeAttributeTemperatureDisplayModeWithValue:temperatureDisplayModeArgument - responseHandler:^(NSError * err, NSDictionary * values) { - NSLog(@"write to the mandatory attribute: TemperatureDisplayMode Error: %@", err); + [cluster stopMotion:^(NSError * err, NSDictionary * values) { + NSLog(@"2a: TH sends StopMotion command to DUT Error: %@", err); - XCTAssertEqual(err.code, 0); + XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; + [expectation fulfill]; + }]; [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTest_TC_TSUIC_2_1_000003_ReadAttribute +- (void)testSendClusterTest_TC_WNCV_3_3_000002_ReadAttribute { - XCTestExpectation * expectation = [self expectationWithDescription:@"read the mandatory attribute: TemperatureDisplayMode"]; + XCTestExpectation * expectation = [self expectationWithDescription:@"2b: TH reads OperationalStatus attribute from DUT"]; CHIPDevice * device = GetConnectedDevice(); dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestThermostatUserInterfaceConfiguration * cluster = - [[CHIPTestThermostatUserInterfaceConfiguration alloc] initWithDevice:device endpoint:1 queue:queue]; + CHIPTestWindowCovering * cluster = [[CHIPTestWindowCovering alloc] initWithDevice:device endpoint:1 queue:queue]; XCTAssertNotNil(cluster); - [cluster readAttributeTemperatureDisplayModeWithResponseHandler:^(NSError * err, NSDictionary * values) { - NSLog(@"read the mandatory attribute: TemperatureDisplayMode Error: %@", err); + [cluster readAttributeOperationalStatusWithResponseHandler:^(NSError * err, NSDictionary * values) { + NSLog(@"2b: TH reads OperationalStatus attribute from DUT Error: %@", err); XCTAssertEqual(err.code, 0); @@ -5765,18 +5956,18 @@ - (void)testSendClusterTest_TC_TSUIC_2_1_000003_ReadAttribute [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTest_TC_TSUIC_2_1_000004_ReadAttribute + +- (void)testSendClusterTestCluster_000000_Test { - XCTestExpectation * expectation = [self expectationWithDescription:@"read the mandatory attribute: TemperatureDisplayMode"]; + XCTestExpectation * expectation = [self expectationWithDescription:@"Send Test Command"]; CHIPDevice * device = GetConnectedDevice(); dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestThermostatUserInterfaceConfiguration * cluster = - [[CHIPTestThermostatUserInterfaceConfiguration alloc] initWithDevice:device endpoint:1 queue:queue]; + CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; XCTAssertNotNil(cluster); - [cluster readAttributeTemperatureDisplayModeWithResponseHandler:^(NSError * err, NSDictionary * values) { - NSLog(@"read the mandatory attribute: TemperatureDisplayMode Error: %@", err); + [cluster test:^(NSError * err, NSDictionary * values) { + NSLog(@"Send Test Command Error: %@", err); XCTAssertEqual(err.code, 0); @@ -5785,3106 +5976,2915 @@ - (void)testSendClusterTest_TC_TSUIC_2_1_000004_ReadAttribute [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTest_TC_TSUIC_2_1_000005_ReadAttribute +- (void)testSendClusterTestCluster_000001_TestNotHandled { - XCTestExpectation * expectation = [self expectationWithDescription:@"read the mandatory attribute: KeypadLockout"]; + XCTestExpectation * expectation = [self expectationWithDescription:@"Send Test Not Handled Command"]; CHIPDevice * device = GetConnectedDevice(); dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestThermostatUserInterfaceConfiguration * cluster = - [[CHIPTestThermostatUserInterfaceConfiguration alloc] initWithDevice:device endpoint:1 queue:queue]; + CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; XCTAssertNotNil(cluster); - [cluster readAttributeKeypadLockoutWithResponseHandler:^(NSError * err, NSDictionary * values) { - NSLog(@"read the mandatory attribute: KeypadLockout Error: %@", err); - - XCTAssertEqual(err.code, 0); - - XCTAssertEqual([values[@"value"] unsignedCharValue], 0); + [cluster testNotHandled:^(NSError * err, NSDictionary * values) { + NSLog(@"Send Test Not Handled Command Error: %@", err); + XCTAssertEqual(err.code, 1); [expectation fulfill]; }]; [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTest_TC_TSUIC_2_1_000006_ReadAttribute +- (void)testSendClusterTestCluster_000002_TestSpecific { - XCTestExpectation * expectation = [self expectationWithDescription:@"read the mandatory attribute: KeypadLockout"]; + XCTestExpectation * expectation = [self expectationWithDescription:@"Send Test Specific Command"]; CHIPDevice * device = GetConnectedDevice(); dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestThermostatUserInterfaceConfiguration * cluster = - [[CHIPTestThermostatUserInterfaceConfiguration alloc] initWithDevice:device endpoint:1 queue:queue]; + CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; XCTAssertNotNil(cluster); - [cluster readAttributeKeypadLockoutWithResponseHandler:^(NSError * err, NSDictionary * values) { - NSLog(@"read the mandatory attribute: KeypadLockout Error: %@", err); + [cluster testSpecific:^(NSError * err, NSDictionary * values) { + NSLog(@"Send Test Specific Command Error: %@", err); XCTAssertEqual(err.code, 0); + XCTAssertEqual([values[@"returnValue"] unsignedCharValue], 7); + [expectation fulfill]; }]; [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTest_TC_TSUIC_2_1_000007_WriteAttribute +- (void)testSendClusterTestCluster_000003_TestAddArguments { - XCTestExpectation * expectation = [self expectationWithDescription:@"write to the mandatory attribute: KeypadLockout"]; + XCTestExpectation * expectation = [self expectationWithDescription:@"Send Test Add Arguments Command"]; CHIPDevice * device = GetConnectedDevice(); dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestThermostatUserInterfaceConfiguration * cluster = - [[CHIPTestThermostatUserInterfaceConfiguration alloc] initWithDevice:device endpoint:1 queue:queue]; + CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; XCTAssertNotNil(cluster); - uint8_t keypadLockoutArgument = 0; - [cluster writeAttributeKeypadLockoutWithValue:keypadLockoutArgument - responseHandler:^(NSError * err, NSDictionary * values) { - NSLog(@"write to the mandatory attribute: KeypadLockout Error: %@", err); + uint8_t arg1Argument = 3; + uint8_t arg2Argument = 17; + [cluster testAddArguments:arg1Argument + arg2:arg2Argument + responseHandler:^(NSError * err, NSDictionary * values) { + NSLog(@"Send Test Add Arguments Command Error: %@", err); - XCTAssertEqual(err.code, 0); + XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; + XCTAssertEqual([values[@"returnValue"] unsignedCharValue], 20); + + [expectation fulfill]; + }]; [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTest_TC_TSUIC_2_1_000008_ReadAttribute +- (void)testSendClusterTestCluster_000004_TestAddArguments { - XCTestExpectation * expectation = [self expectationWithDescription:@"read the mandatory attribute: KeypadLockout"]; + XCTestExpectation * expectation = [self expectationWithDescription:@"Send failing Test Add Arguments Command"]; CHIPDevice * device = GetConnectedDevice(); dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestThermostatUserInterfaceConfiguration * cluster = - [[CHIPTestThermostatUserInterfaceConfiguration alloc] initWithDevice:device endpoint:1 queue:queue]; + CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; XCTAssertNotNil(cluster); - [cluster readAttributeKeypadLockoutWithResponseHandler:^(NSError * err, NSDictionary * values) { - NSLog(@"read the mandatory attribute: KeypadLockout Error: %@", err); - - XCTAssertEqual(err.code, 0); - - XCTAssertEqual([values[@"value"] unsignedCharValue], 0); + uint8_t arg1Argument = 250; + uint8_t arg2Argument = 6; + [cluster testAddArguments:arg1Argument + arg2:arg2Argument + responseHandler:^(NSError * err, NSDictionary * values) { + NSLog(@"Send failing Test Add Arguments Command Error: %@", err); - [expectation fulfill]; - }]; + XCTAssertEqual(err.code, 1); + [expectation fulfill]; + }]; [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTest_TC_TSUIC_2_1_000009_ReadAttribute +- (void)testSendClusterTestCluster_000005_ReadAttribute { - XCTestExpectation * expectation = [self expectationWithDescription:@"read the mandatory attribute: KeypadLockout"]; + XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute BOOLEAN Default Value"]; CHIPDevice * device = GetConnectedDevice(); dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestThermostatUserInterfaceConfiguration * cluster = - [[CHIPTestThermostatUserInterfaceConfiguration alloc] initWithDevice:device endpoint:1 queue:queue]; + CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; XCTAssertNotNil(cluster); - [cluster readAttributeKeypadLockoutWithResponseHandler:^(NSError * err, NSDictionary * values) { - NSLog(@"read the mandatory attribute: KeypadLockout Error: %@", err); + [cluster readAttributeBooleanWithResponseHandler:^(NSError * err, NSDictionary * values) { + NSLog(@"Read attribute BOOLEAN Default Value Error: %@", err); XCTAssertEqual(err.code, 0); + XCTAssertEqual([values[@"value"] boolValue], 0); + [expectation fulfill]; }]; [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTest_TC_TSUIC_2_1_000010_ReadAttribute +- (void)testSendClusterTestCluster_000006_WriteAttribute { - XCTestExpectation * expectation = - [self expectationWithDescription:@"read the optional attribute: ScheduleProgrammingVisibility"]; + XCTestExpectation * expectation = [self expectationWithDescription:@"Write attribute BOOLEAN True"]; CHIPDevice * device = GetConnectedDevice(); dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestThermostatUserInterfaceConfiguration * cluster = - [[CHIPTestThermostatUserInterfaceConfiguration alloc] initWithDevice:device endpoint:1 queue:queue]; + CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; XCTAssertNotNil(cluster); - [cluster readAttributeScheduleProgrammingVisibilityWithResponseHandler:^(NSError * err, NSDictionary * values) { - NSLog(@"read the optional attribute: ScheduleProgrammingVisibility Error: %@", err); - - XCTAssertEqual(err.code, 0); + bool booleanArgument = 1; + [cluster writeAttributeBooleanWithValue:booleanArgument + responseHandler:^(NSError * err, NSDictionary * values) { + NSLog(@"Write attribute BOOLEAN True Error: %@", err); - XCTAssertEqual([values[@"value"] unsignedCharValue], 0); + XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; + [expectation fulfill]; + }]; [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTest_TC_TSUIC_2_1_000011_ReadAttribute +- (void)testSendClusterTestCluster_000007_ReadAttribute { - XCTestExpectation * expectation = - [self expectationWithDescription:@"read the optional attribute: ScheduleProgrammingVisibility"]; + XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute BOOLEAN True"]; CHIPDevice * device = GetConnectedDevice(); dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestThermostatUserInterfaceConfiguration * cluster = - [[CHIPTestThermostatUserInterfaceConfiguration alloc] initWithDevice:device endpoint:1 queue:queue]; + CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; XCTAssertNotNil(cluster); - [cluster readAttributeScheduleProgrammingVisibilityWithResponseHandler:^(NSError * err, NSDictionary * values) { - NSLog(@"read the optional attribute: ScheduleProgrammingVisibility Error: %@", err); + [cluster readAttributeBooleanWithResponseHandler:^(NSError * err, NSDictionary * values) { + NSLog(@"Read attribute BOOLEAN True Error: %@", err); XCTAssertEqual(err.code, 0); + XCTAssertEqual([values[@"value"] boolValue], 1); + [expectation fulfill]; }]; [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTest_TC_TSUIC_2_1_000012_WriteAttribute +- (void)testSendClusterTestCluster_000008_WriteAttribute { - XCTestExpectation * expectation = - [self expectationWithDescription:@"write to the mandatory attribute: ScheduleProgrammingVisibility"]; + XCTestExpectation * expectation = [self expectationWithDescription:@"Write attribute BOOLEAN False"]; CHIPDevice * device = GetConnectedDevice(); dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestThermostatUserInterfaceConfiguration * cluster = - [[CHIPTestThermostatUserInterfaceConfiguration alloc] initWithDevice:device endpoint:1 queue:queue]; + CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; XCTAssertNotNil(cluster); - uint8_t scheduleProgrammingVisibilityArgument = 0; - [cluster - writeAttributeScheduleProgrammingVisibilityWithValue:scheduleProgrammingVisibilityArgument - responseHandler:^(NSError * err, NSDictionary * values) { - NSLog(@"write to the mandatory attribute: ScheduleProgrammingVisibility Error: %@", - err); + bool booleanArgument = 0; + [cluster writeAttributeBooleanWithValue:booleanArgument + responseHandler:^(NSError * err, NSDictionary * values) { + NSLog(@"Write attribute BOOLEAN False Error: %@", err); - XCTAssertEqual(err.code, 0); + XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; + [expectation fulfill]; + }]; [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTest_TC_TSUIC_2_1_000013_ReadAttribute +- (void)testSendClusterTestCluster_000009_ReadAttribute { - XCTestExpectation * expectation = - [self expectationWithDescription:@"read the optional attribute: ScheduleProgrammingVisibility"]; + XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute BOOLEAN False"]; CHIPDevice * device = GetConnectedDevice(); dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestThermostatUserInterfaceConfiguration * cluster = - [[CHIPTestThermostatUserInterfaceConfiguration alloc] initWithDevice:device endpoint:1 queue:queue]; + CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; XCTAssertNotNil(cluster); - [cluster readAttributeScheduleProgrammingVisibilityWithResponseHandler:^(NSError * err, NSDictionary * values) { - NSLog(@"read the optional attribute: ScheduleProgrammingVisibility Error: %@", err); + [cluster readAttributeBooleanWithResponseHandler:^(NSError * err, NSDictionary * values) { + NSLog(@"Read attribute BOOLEAN False Error: %@", err); XCTAssertEqual(err.code, 0); - XCTAssertEqual([values[@"value"] unsignedCharValue], 0); + XCTAssertEqual([values[@"value"] boolValue], 0); [expectation fulfill]; }]; [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTest_TC_TSUIC_2_1_000014_ReadAttribute +- (void)testSendClusterTestCluster_000010_ReadAttribute { - XCTestExpectation * expectation = - [self expectationWithDescription:@"read the optional attribute: ScheduleProgrammingVisibility"]; + XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute BITMAP8 Default Value"]; CHIPDevice * device = GetConnectedDevice(); dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestThermostatUserInterfaceConfiguration * cluster = - [[CHIPTestThermostatUserInterfaceConfiguration alloc] initWithDevice:device endpoint:1 queue:queue]; + CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; XCTAssertNotNil(cluster); - [cluster readAttributeScheduleProgrammingVisibilityWithResponseHandler:^(NSError * err, NSDictionary * values) { - NSLog(@"read the optional attribute: ScheduleProgrammingVisibility Error: %@", err); + [cluster readAttributeBitmap8WithResponseHandler:^(NSError * err, NSDictionary * values) { + NSLog(@"Read attribute BITMAP8 Default Value Error: %@", err); XCTAssertEqual(err.code, 0); + XCTAssertEqual([values[@"value"] unsignedCharValue], 0); + [expectation fulfill]; }]; [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } - -- (void)testSendClusterTest_TC_PCC_2_1_000000_ReadAttribute +- (void)testSendClusterTestCluster_000011_WriteAttribute { - XCTestExpectation * expectation = [self expectationWithDescription:@"read the mandatory attribute: MaxPressure"]; + XCTestExpectation * expectation = [self expectationWithDescription:@"Write attribute BITMAP8 Max Value"]; CHIPDevice * device = GetConnectedDevice(); dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestPumpConfigurationAndControl * cluster = [[CHIPTestPumpConfigurationAndControl alloc] initWithDevice:device - endpoint:1 - queue:queue]; + CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; XCTAssertNotNil(cluster); - [cluster readAttributeMaxPressureWithResponseHandler:^(NSError * err, NSDictionary * values) { - NSLog(@"read the mandatory attribute: MaxPressure Error: %@", err); + uint8_t bitmap8Argument = 255; + [cluster writeAttributeBitmap8WithValue:bitmap8Argument + responseHandler:^(NSError * err, NSDictionary * values) { + NSLog(@"Write attribute BITMAP8 Max Value Error: %@", err); - XCTAssertEqual(err.code, 0); + XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; + [expectation fulfill]; + }]; [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTest_TC_PCC_2_1_000001_ReadAttribute +- (void)testSendClusterTestCluster_000012_ReadAttribute { - XCTestExpectation * expectation = [self expectationWithDescription:@"read the mandatory attribute: EffectiveOperationMode"]; + XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute BITMAP8 Max Value"]; CHIPDevice * device = GetConnectedDevice(); dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestPumpConfigurationAndControl * cluster = [[CHIPTestPumpConfigurationAndControl alloc] initWithDevice:device - endpoint:1 - queue:queue]; + CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; XCTAssertNotNil(cluster); - [cluster readAttributeEffectiveOperationModeWithResponseHandler:^(NSError * err, NSDictionary * values) { - NSLog(@"read the mandatory attribute: EffectiveOperationMode Error: %@", err); + [cluster readAttributeBitmap8WithResponseHandler:^(NSError * err, NSDictionary * values) { + NSLog(@"Read attribute BITMAP8 Max Value Error: %@", err); XCTAssertEqual(err.code, 0); + XCTAssertEqual([values[@"value"] unsignedCharValue], 255); + [expectation fulfill]; }]; [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTest_TC_PCC_2_1_000002_ReadAttribute +- (void)testSendClusterTestCluster_000013_WriteAttribute { - XCTestExpectation * expectation = [self expectationWithDescription:@"read the mandatory attribute: EffectiveControlMode"]; + XCTestExpectation * expectation = [self expectationWithDescription:@"Write attribute BITMAP8 Min Value"]; CHIPDevice * device = GetConnectedDevice(); dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestPumpConfigurationAndControl * cluster = [[CHIPTestPumpConfigurationAndControl alloc] initWithDevice:device - endpoint:1 - queue:queue]; + CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; XCTAssertNotNil(cluster); - [cluster readAttributeEffectiveControlModeWithResponseHandler:^(NSError * err, NSDictionary * values) { - NSLog(@"read the mandatory attribute: EffectiveControlMode Error: %@", err); + uint8_t bitmap8Argument = 0; + [cluster writeAttributeBitmap8WithValue:bitmap8Argument + responseHandler:^(NSError * err, NSDictionary * values) { + NSLog(@"Write attribute BITMAP8 Min Value Error: %@", err); - XCTAssertEqual(err.code, 0); + XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; + [expectation fulfill]; + }]; [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTest_TC_PCC_2_1_000003_ReadAttribute +- (void)testSendClusterTestCluster_000014_ReadAttribute { - XCTestExpectation * expectation = [self expectationWithDescription:@"read the mandatory attribute: Capacity"]; + XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute BITMAP8 Min Value"]; CHIPDevice * device = GetConnectedDevice(); dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestPumpConfigurationAndControl * cluster = [[CHIPTestPumpConfigurationAndControl alloc] initWithDevice:device - endpoint:1 - queue:queue]; + CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; XCTAssertNotNil(cluster); - [cluster readAttributeCapacityWithResponseHandler:^(NSError * err, NSDictionary * values) { - NSLog(@"read the mandatory attribute: Capacity Error: %@", err); + [cluster readAttributeBitmap8WithResponseHandler:^(NSError * err, NSDictionary * values) { + NSLog(@"Read attribute BITMAP8 Min Value Error: %@", err); XCTAssertEqual(err.code, 0); + XCTAssertEqual([values[@"value"] unsignedCharValue], 0); + [expectation fulfill]; }]; [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTest_TC_PCC_2_1_000004_ReadAttribute +- (void)testSendClusterTestCluster_000015_ReadAttribute { - XCTestExpectation * expectation = [self expectationWithDescription:@"read the mandatory attribute: MaxPressure"]; + XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute BITMAP16 Default Value"]; CHIPDevice * device = GetConnectedDevice(); dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestPumpConfigurationAndControl * cluster = [[CHIPTestPumpConfigurationAndControl alloc] initWithDevice:device - endpoint:1 - queue:queue]; + CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; XCTAssertNotNil(cluster); - [cluster readAttributeMaxPressureWithResponseHandler:^(NSError * err, NSDictionary * values) { - NSLog(@"read the mandatory attribute: MaxPressure Error: %@", err); + [cluster readAttributeBitmap16WithResponseHandler:^(NSError * err, NSDictionary * values) { + NSLog(@"Read attribute BITMAP16 Default Value Error: %@", err); XCTAssertEqual(err.code, 0); + XCTAssertEqual([values[@"value"] unsignedShortValue], 0U); + [expectation fulfill]; }]; [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTest_TC_PCC_2_1_000005_ReadAttribute +- (void)testSendClusterTestCluster_000016_WriteAttribute { - XCTestExpectation * expectation = [self expectationWithDescription:@"read the mandatory attribute: EffectiveOperationMode"]; + XCTestExpectation * expectation = [self expectationWithDescription:@"Write attribute BITMAP16 Max Value"]; CHIPDevice * device = GetConnectedDevice(); dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestPumpConfigurationAndControl * cluster = [[CHIPTestPumpConfigurationAndControl alloc] initWithDevice:device - endpoint:1 - queue:queue]; + CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; XCTAssertNotNil(cluster); - [cluster readAttributeEffectiveOperationModeWithResponseHandler:^(NSError * err, NSDictionary * values) { - NSLog(@"read the mandatory attribute: EffectiveOperationMode Error: %@", err); + uint16_t bitmap16Argument = 65535U; + [cluster writeAttributeBitmap16WithValue:bitmap16Argument + responseHandler:^(NSError * err, NSDictionary * values) { + NSLog(@"Write attribute BITMAP16 Max Value Error: %@", err); - XCTAssertEqual(err.code, 0); + XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; + [expectation fulfill]; + }]; [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTest_TC_PCC_2_1_000006_ReadAttribute +- (void)testSendClusterTestCluster_000017_ReadAttribute { - XCTestExpectation * expectation = [self expectationWithDescription:@"read the mandatory attribute: EffectiveControlMode"]; + XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute BITMAP16 Max Value"]; CHIPDevice * device = GetConnectedDevice(); dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestPumpConfigurationAndControl * cluster = [[CHIPTestPumpConfigurationAndControl alloc] initWithDevice:device - endpoint:1 - queue:queue]; + CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; XCTAssertNotNil(cluster); - [cluster readAttributeEffectiveControlModeWithResponseHandler:^(NSError * err, NSDictionary * values) { - NSLog(@"read the mandatory attribute: EffectiveControlMode Error: %@", err); + [cluster readAttributeBitmap16WithResponseHandler:^(NSError * err, NSDictionary * values) { + NSLog(@"Read attribute BITMAP16 Max Value Error: %@", err); XCTAssertEqual(err.code, 0); + XCTAssertEqual([values[@"value"] unsignedShortValue], 65535U); + [expectation fulfill]; }]; [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTest_TC_PCC_2_1_000007_ReadAttribute +- (void)testSendClusterTestCluster_000018_WriteAttribute { - XCTestExpectation * expectation = [self expectationWithDescription:@"read the mandatory attribute: Capacity"]; + XCTestExpectation * expectation = [self expectationWithDescription:@"Write attribute BITMAP16 Min Value"]; CHIPDevice * device = GetConnectedDevice(); dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestPumpConfigurationAndControl * cluster = [[CHIPTestPumpConfigurationAndControl alloc] initWithDevice:device - endpoint:1 - queue:queue]; + CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; XCTAssertNotNil(cluster); - [cluster readAttributeCapacityWithResponseHandler:^(NSError * err, NSDictionary * values) { - NSLog(@"read the mandatory attribute: Capacity Error: %@", err); + uint16_t bitmap16Argument = 0U; + [cluster writeAttributeBitmap16WithValue:bitmap16Argument + responseHandler:^(NSError * err, NSDictionary * values) { + NSLog(@"Write attribute BITMAP16 Min Value Error: %@", err); - XCTAssertEqual(err.code, 0); + XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; + [expectation fulfill]; + }]; [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } - -- (void)testSendClusterTest_TC_CC_3_1_000000_On +- (void)testSendClusterTestCluster_000019_ReadAttribute { - XCTestExpectation * expectation = [self expectationWithDescription:@"Turn on light for color control tests"]; + XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute BITMAP16 Min Value"]; CHIPDevice * device = GetConnectedDevice(); dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:queue]; + CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; XCTAssertNotNil(cluster); - [cluster on:^(NSError * err, NSDictionary * values) { - NSLog(@"Turn on light for color control tests Error: %@", err); + [cluster readAttributeBitmap16WithResponseHandler:^(NSError * err, NSDictionary * values) { + NSLog(@"Read attribute BITMAP16 Min Value Error: %@", err); XCTAssertEqual(err.code, 0); + XCTAssertEqual([values[@"value"] unsignedShortValue], 0U); + [expectation fulfill]; }]; [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTest_TC_CC_3_1_000001_ReadAttribute +- (void)testSendClusterTestCluster_000020_ReadAttribute { - XCTestExpectation * expectation = [self expectationWithDescription:@"Check on/off attribute value is true after on command"]; + XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute BITMAP32 Default Value"]; CHIPDevice * device = GetConnectedDevice(); dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:queue]; + CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; XCTAssertNotNil(cluster); - [cluster readAttributeOnOffWithResponseHandler:^(NSError * err, NSDictionary * values) { - NSLog(@"Check on/off attribute value is true after on command Error: %@", err); + [cluster readAttributeBitmap32WithResponseHandler:^(NSError * err, NSDictionary * values) { + NSLog(@"Read attribute BITMAP32 Default Value Error: %@", err); XCTAssertEqual(err.code, 0); - XCTAssertEqual([values[@"value"] boolValue], 1); + XCTAssertEqual([values[@"value"] unsignedLongValue], 0UL); [expectation fulfill]; }]; [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTest_TC_CC_3_1_000002_MoveToHue -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Move to hue shortest distance command"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - uint8_t hueArgument = 150; - uint8_t directionArgument = 0; - uint16_t transitionTimeArgument = 100U; - uint8_t optionsMaskArgument = 0; - uint8_t optionsOverrideArgument = 0; - [cluster moveToHue:hueArgument - direction:directionArgument - transitionTime:transitionTimeArgument - optionsMask:optionsMaskArgument - optionsOverride:optionsOverrideArgument - responseHandler:^(NSError * err, NSDictionary * values) { - NSLog(@"Move to hue shortest distance command Error: %@", err); - - XCTAssertEqual(err.code, 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_CC_3_1_000003_MoveToHue +- (void)testSendClusterTestCluster_000021_WriteAttribute { - XCTestExpectation * expectation = [self expectationWithDescription:@"Move to hue longest distance command"]; + XCTestExpectation * expectation = [self expectationWithDescription:@"Write attribute BITMAP32 Max Value"]; CHIPDevice * device = GetConnectedDevice(); dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; + CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; XCTAssertNotNil(cluster); - uint8_t hueArgument = 200; - uint8_t directionArgument = 1; - uint16_t transitionTimeArgument = 100U; - uint8_t optionsMaskArgument = 0; - uint8_t optionsOverrideArgument = 0; - [cluster moveToHue:hueArgument - direction:directionArgument - transitionTime:transitionTimeArgument - optionsMask:optionsMaskArgument - optionsOverride:optionsOverrideArgument - responseHandler:^(NSError * err, NSDictionary * values) { - NSLog(@"Move to hue longest distance command Error: %@", err); + uint32_t bitmap32Argument = 4294967295UL; + [cluster writeAttributeBitmap32WithValue:bitmap32Argument + responseHandler:^(NSError * err, NSDictionary * values) { + NSLog(@"Write attribute BITMAP32 Max Value Error: %@", err); - XCTAssertEqual(err.code, 0); + XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; + [expectation fulfill]; + }]; [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTest_TC_CC_3_1_000004_MoveToHue +- (void)testSendClusterTestCluster_000022_ReadAttribute { - XCTestExpectation * expectation = [self expectationWithDescription:@"Move to hue up command"]; + XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute BITMAP32 Max Value"]; CHIPDevice * device = GetConnectedDevice(); dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; + CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; XCTAssertNotNil(cluster); - uint8_t hueArgument = 250; - uint8_t directionArgument = 2; - uint16_t transitionTimeArgument = 100U; - uint8_t optionsMaskArgument = 0; - uint8_t optionsOverrideArgument = 0; - [cluster moveToHue:hueArgument - direction:directionArgument - transitionTime:transitionTimeArgument - optionsMask:optionsMaskArgument - optionsOverride:optionsOverrideArgument - responseHandler:^(NSError * err, NSDictionary * values) { - NSLog(@"Move to hue up command Error: %@", err); + [cluster readAttributeBitmap32WithResponseHandler:^(NSError * err, NSDictionary * values) { + NSLog(@"Read attribute BITMAP32 Max Value Error: %@", err); - XCTAssertEqual(err.code, 0); + XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; + XCTAssertEqual([values[@"value"] unsignedLongValue], 4294967295UL); + + [expectation fulfill]; + }]; [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTest_TC_CC_3_1_000005_MoveToHue +- (void)testSendClusterTestCluster_000023_WriteAttribute { - XCTestExpectation * expectation = [self expectationWithDescription:@"Move to hue down command"]; + XCTestExpectation * expectation = [self expectationWithDescription:@"Write attribute BITMAP32 Min Value"]; CHIPDevice * device = GetConnectedDevice(); dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; + CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; XCTAssertNotNil(cluster); - uint8_t hueArgument = 225; - uint8_t directionArgument = 3; - uint16_t transitionTimeArgument = 100U; - uint8_t optionsMaskArgument = 0; - uint8_t optionsOverrideArgument = 0; - [cluster moveToHue:hueArgument - direction:directionArgument - transitionTime:transitionTimeArgument - optionsMask:optionsMaskArgument - optionsOverride:optionsOverrideArgument - responseHandler:^(NSError * err, NSDictionary * values) { - NSLog(@"Move to hue down command Error: %@", err); + uint32_t bitmap32Argument = 0UL; + [cluster writeAttributeBitmap32WithValue:bitmap32Argument + responseHandler:^(NSError * err, NSDictionary * values) { + NSLog(@"Write attribute BITMAP32 Min Value Error: %@", err); - XCTAssertEqual(err.code, 0); + XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; + [expectation fulfill]; + }]; [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTest_TC_CC_3_1_000006_Off +- (void)testSendClusterTestCluster_000024_ReadAttribute { - XCTestExpectation * expectation = [self expectationWithDescription:@"Turn off light that we turned on"]; + XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute BITMAP32 Min Value"]; CHIPDevice * device = GetConnectedDevice(); dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:queue]; + CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; XCTAssertNotNil(cluster); - [cluster off:^(NSError * err, NSDictionary * values) { - NSLog(@"Turn off light that we turned on Error: %@", err); + [cluster readAttributeBitmap32WithResponseHandler:^(NSError * err, NSDictionary * values) { + NSLog(@"Read attribute BITMAP32 Min Value Error: %@", err); XCTAssertEqual(err.code, 0); + XCTAssertEqual([values[@"value"] unsignedLongValue], 0UL); + [expectation fulfill]; }]; [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTest_TC_CC_3_1_000007_ReadAttribute +- (void)testSendClusterTestCluster_000025_ReadAttribute { - XCTestExpectation * expectation = [self expectationWithDescription:@"Check on/off attribute value is false after off command"]; + XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute BITMAP64 Default Value"]; CHIPDevice * device = GetConnectedDevice(); dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:queue]; + CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; XCTAssertNotNil(cluster); - [cluster readAttributeOnOffWithResponseHandler:^(NSError * err, NSDictionary * values) { - NSLog(@"Check on/off attribute value is false after off command Error: %@", err); + [cluster readAttributeBitmap64WithResponseHandler:^(NSError * err, NSDictionary * values) { + NSLog(@"Read attribute BITMAP64 Default Value Error: %@", err); XCTAssertEqual(err.code, 0); - XCTAssertEqual([values[@"value"] boolValue], 0); + XCTAssertEqual([values[@"value"] unsignedLongLongValue], 0ULL); [expectation fulfill]; }]; [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } - -- (void)testSendClusterTest_TC_CC_3_2_000000_On +- (void)testSendClusterTestCluster_000026_WriteAttribute { - XCTestExpectation * expectation = [self expectationWithDescription:@"Turn on light for color control tests"]; + XCTestExpectation * expectation = [self expectationWithDescription:@"Write attribute BITMAP64 Max Value"]; CHIPDevice * device = GetConnectedDevice(); dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:queue]; + CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; XCTAssertNotNil(cluster); - [cluster on:^(NSError * err, NSDictionary * values) { - NSLog(@"Turn on light for color control tests Error: %@", err); + uint64_t bitmap64Argument = 18446744073709551615ULL; + [cluster writeAttributeBitmap64WithValue:bitmap64Argument + responseHandler:^(NSError * err, NSDictionary * values) { + NSLog(@"Write attribute BITMAP64 Max Value Error: %@", err); - XCTAssertEqual(err.code, 0); + XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; + [expectation fulfill]; + }]; [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTest_TC_CC_3_2_000001_ReadAttribute +- (void)testSendClusterTestCluster_000027_ReadAttribute { - XCTestExpectation * expectation = [self expectationWithDescription:@"Check on/off attribute value is true after on command"]; + XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute BITMAP64 Max Value"]; CHIPDevice * device = GetConnectedDevice(); dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:queue]; + CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; XCTAssertNotNil(cluster); - [cluster readAttributeOnOffWithResponseHandler:^(NSError * err, NSDictionary * values) { - NSLog(@"Check on/off attribute value is true after on command Error: %@", err); + [cluster readAttributeBitmap64WithResponseHandler:^(NSError * err, NSDictionary * values) { + NSLog(@"Read attribute BITMAP64 Max Value Error: %@", err); XCTAssertEqual(err.code, 0); - XCTAssertEqual([values[@"value"] boolValue], 1); + XCTAssertEqual([values[@"value"] unsignedLongLongValue], 18446744073709551615ULL); [expectation fulfill]; }]; [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTest_TC_CC_3_2_000002_MoveHue +- (void)testSendClusterTestCluster_000028_WriteAttribute { - XCTestExpectation * expectation = [self expectationWithDescription:@"Move hue up command"]; + XCTestExpectation * expectation = [self expectationWithDescription:@"Write attribute BITMAP64 Min Value"]; CHIPDevice * device = GetConnectedDevice(); dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; + CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; XCTAssertNotNil(cluster); - uint8_t moveModeArgument = 1; - uint8_t rateArgument = 50; - uint8_t optionsMaskArgument = 0; - uint8_t optionsOverrideArgument = 0; - [cluster moveHue:moveModeArgument - rate:rateArgument - optionsMask:optionsMaskArgument - optionsOverride:optionsOverrideArgument - responseHandler:^(NSError * err, NSDictionary * values) { - NSLog(@"Move hue up command Error: %@", err); + uint64_t bitmap64Argument = 0ULL; + [cluster writeAttributeBitmap64WithValue:bitmap64Argument + responseHandler:^(NSError * err, NSDictionary * values) { + NSLog(@"Write attribute BITMAP64 Min Value Error: %@", err); - XCTAssertEqual(err.code, 0); + XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; + [expectation fulfill]; + }]; [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTest_TC_CC_3_2_000003_MoveHue +- (void)testSendClusterTestCluster_000029_ReadAttribute { - XCTestExpectation * expectation = [self expectationWithDescription:@"Move hue stop command"]; + XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute BITMAP64 Min Value"]; CHIPDevice * device = GetConnectedDevice(); dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; + CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; XCTAssertNotNil(cluster); - uint8_t moveModeArgument = 0; - uint8_t rateArgument = 50; - uint8_t optionsMaskArgument = 0; - uint8_t optionsOverrideArgument = 0; - [cluster moveHue:moveModeArgument - rate:rateArgument - optionsMask:optionsMaskArgument - optionsOverride:optionsOverrideArgument - responseHandler:^(NSError * err, NSDictionary * values) { - NSLog(@"Move hue stop command Error: %@", err); + [cluster readAttributeBitmap64WithResponseHandler:^(NSError * err, NSDictionary * values) { + NSLog(@"Read attribute BITMAP64 Min Value Error: %@", err); - XCTAssertEqual(err.code, 0); + XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; + XCTAssertEqual([values[@"value"] unsignedLongLongValue], 0ULL); + + [expectation fulfill]; + }]; [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTest_TC_CC_3_2_000004_MoveHue +- (void)testSendClusterTestCluster_000030_ReadAttribute { - XCTestExpectation * expectation = [self expectationWithDescription:@"Move hue down command"]; + XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute INT8U Default Value"]; CHIPDevice * device = GetConnectedDevice(); dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; + CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; XCTAssertNotNil(cluster); - uint8_t moveModeArgument = 3; - uint8_t rateArgument = 50; - uint8_t optionsMaskArgument = 0; - uint8_t optionsOverrideArgument = 0; - [cluster moveHue:moveModeArgument - rate:rateArgument - optionsMask:optionsMaskArgument - optionsOverride:optionsOverrideArgument - responseHandler:^(NSError * err, NSDictionary * values) { - NSLog(@"Move hue down command Error: %@", err); + [cluster readAttributeInt8uWithResponseHandler:^(NSError * err, NSDictionary * values) { + NSLog(@"Read attribute INT8U Default Value Error: %@", err); - XCTAssertEqual(err.code, 0); + XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; + XCTAssertEqual([values[@"value"] unsignedCharValue], 0); + + [expectation fulfill]; + }]; [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTest_TC_CC_3_2_000005_MoveHue +- (void)testSendClusterTestCluster_000031_WriteAttribute { - XCTestExpectation * expectation = [self expectationWithDescription:@"Move hue stop command"]; + XCTestExpectation * expectation = [self expectationWithDescription:@"Write attribute INT8U Max Value"]; CHIPDevice * device = GetConnectedDevice(); dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; + CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; XCTAssertNotNil(cluster); - uint8_t moveModeArgument = 0; - uint8_t rateArgument = 50; - uint8_t optionsMaskArgument = 0; - uint8_t optionsOverrideArgument = 0; - [cluster moveHue:moveModeArgument - rate:rateArgument - optionsMask:optionsMaskArgument - optionsOverride:optionsOverrideArgument - responseHandler:^(NSError * err, NSDictionary * values) { - NSLog(@"Move hue stop command Error: %@", err); + uint8_t int8uArgument = 255; + [cluster writeAttributeInt8uWithValue:int8uArgument + responseHandler:^(NSError * err, NSDictionary * values) { + NSLog(@"Write attribute INT8U Max Value Error: %@", err); + + XCTAssertEqual(err.code, 0); + + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} +- (void)testSendClusterTestCluster_000032_ReadAttribute +{ + XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute INT8U Max Value"]; + + CHIPDevice * device = GetConnectedDevice(); + dispatch_queue_t queue = dispatch_get_main_queue(); + CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; + XCTAssertNotNil(cluster); + + [cluster readAttributeInt8uWithResponseHandler:^(NSError * err, NSDictionary * values) { + NSLog(@"Read attribute INT8U Max Value Error: %@", err); + + XCTAssertEqual(err.code, 0); - XCTAssertEqual(err.code, 0); + XCTAssertEqual([values[@"value"] unsignedCharValue], 255); - [expectation fulfill]; - }]; + [expectation fulfill]; + }]; [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTest_TC_CC_3_2_000006_Off +- (void)testSendClusterTestCluster_000033_WriteAttribute { - XCTestExpectation * expectation = [self expectationWithDescription:@"Turn off light that we turned on"]; + XCTestExpectation * expectation = [self expectationWithDescription:@"Write attribute INT8U Min Value"]; CHIPDevice * device = GetConnectedDevice(); dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:queue]; + CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; XCTAssertNotNil(cluster); - [cluster off:^(NSError * err, NSDictionary * values) { - NSLog(@"Turn off light that we turned on Error: %@", err); + uint8_t int8uArgument = 0; + [cluster writeAttributeInt8uWithValue:int8uArgument + responseHandler:^(NSError * err, NSDictionary * values) { + NSLog(@"Write attribute INT8U Min Value Error: %@", err); - XCTAssertEqual(err.code, 0); + XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; + [expectation fulfill]; + }]; [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTest_TC_CC_3_2_000007_ReadAttribute +- (void)testSendClusterTestCluster_000034_ReadAttribute { - XCTestExpectation * expectation = [self expectationWithDescription:@"Check on/off attribute value is false after off command"]; + XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute INT8U Min Value"]; CHIPDevice * device = GetConnectedDevice(); dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:queue]; + CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; XCTAssertNotNil(cluster); - [cluster readAttributeOnOffWithResponseHandler:^(NSError * err, NSDictionary * values) { - NSLog(@"Check on/off attribute value is false after off command Error: %@", err); + [cluster readAttributeInt8uWithResponseHandler:^(NSError * err, NSDictionary * values) { + NSLog(@"Read attribute INT8U Min Value Error: %@", err); XCTAssertEqual(err.code, 0); - XCTAssertEqual([values[@"value"] boolValue], 0); + XCTAssertEqual([values[@"value"] unsignedCharValue], 0); [expectation fulfill]; }]; [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } - -- (void)testSendClusterTest_TC_CC_3_3_000000_On +- (void)testSendClusterTestCluster_000035_ReadAttribute { - XCTestExpectation * expectation = [self expectationWithDescription:@"Turn on light for color control tests"]; + XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute INT16U Default Value"]; CHIPDevice * device = GetConnectedDevice(); dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:queue]; + CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; XCTAssertNotNil(cluster); - [cluster on:^(NSError * err, NSDictionary * values) { - NSLog(@"Turn on light for color control tests Error: %@", err); + [cluster readAttributeInt16uWithResponseHandler:^(NSError * err, NSDictionary * values) { + NSLog(@"Read attribute INT16U Default Value Error: %@", err); XCTAssertEqual(err.code, 0); + XCTAssertEqual([values[@"value"] unsignedShortValue], 0U); + [expectation fulfill]; }]; [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTest_TC_CC_3_3_000001_ReadAttribute +- (void)testSendClusterTestCluster_000036_WriteAttribute { - XCTestExpectation * expectation = [self expectationWithDescription:@"Check on/off attribute value is true after on command"]; + XCTestExpectation * expectation = [self expectationWithDescription:@"Write attribute INT16U Max Value"]; CHIPDevice * device = GetConnectedDevice(); dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:queue]; + CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; XCTAssertNotNil(cluster); - [cluster readAttributeOnOffWithResponseHandler:^(NSError * err, NSDictionary * values) { - NSLog(@"Check on/off attribute value is true after on command Error: %@", err); - - XCTAssertEqual(err.code, 0); + uint16_t int16uArgument = 65535U; + [cluster writeAttributeInt16uWithValue:int16uArgument + responseHandler:^(NSError * err, NSDictionary * values) { + NSLog(@"Write attribute INT16U Max Value Error: %@", err); - XCTAssertEqual([values[@"value"] boolValue], 1); + XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; + [expectation fulfill]; + }]; [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTest_TC_CC_3_3_000002_StepHue +- (void)testSendClusterTestCluster_000037_ReadAttribute { - XCTestExpectation * expectation = [self expectationWithDescription:@"Step hue up command"]; + XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute INT16U Max Value"]; CHIPDevice * device = GetConnectedDevice(); dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; + CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; XCTAssertNotNil(cluster); - uint8_t stepModeArgument = 1; - uint8_t stepSizeArgument = 5; - uint8_t transitionTimeArgument = 25; - uint8_t optionsMaskArgument = 0; - uint8_t optionsOverrideArgument = 0; - [cluster stepHue:stepModeArgument - stepSize:stepSizeArgument - transitionTime:transitionTimeArgument - optionsMask:optionsMaskArgument - optionsOverride:optionsOverrideArgument - responseHandler:^(NSError * err, NSDictionary * values) { - NSLog(@"Step hue up command Error: %@", err); + [cluster readAttributeInt16uWithResponseHandler:^(NSError * err, NSDictionary * values) { + NSLog(@"Read attribute INT16U Max Value Error: %@", err); - XCTAssertEqual(err.code, 0); + XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; + XCTAssertEqual([values[@"value"] unsignedShortValue], 65535U); + + [expectation fulfill]; + }]; [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTest_TC_CC_3_3_000003_StepHue +- (void)testSendClusterTestCluster_000038_WriteAttribute { - XCTestExpectation * expectation = [self expectationWithDescription:@"Step hue down command"]; + XCTestExpectation * expectation = [self expectationWithDescription:@"Write attribute INT16U Min Value"]; CHIPDevice * device = GetConnectedDevice(); dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; + CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; XCTAssertNotNil(cluster); - uint8_t stepModeArgument = 3; - uint8_t stepSizeArgument = 5; - uint8_t transitionTimeArgument = 25; - uint8_t optionsMaskArgument = 0; - uint8_t optionsOverrideArgument = 0; - [cluster stepHue:stepModeArgument - stepSize:stepSizeArgument - transitionTime:transitionTimeArgument - optionsMask:optionsMaskArgument - optionsOverride:optionsOverrideArgument - responseHandler:^(NSError * err, NSDictionary * values) { - NSLog(@"Step hue down command Error: %@", err); + uint16_t int16uArgument = 0U; + [cluster writeAttributeInt16uWithValue:int16uArgument + responseHandler:^(NSError * err, NSDictionary * values) { + NSLog(@"Write attribute INT16U Min Value Error: %@", err); - XCTAssertEqual(err.code, 0); + XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; + [expectation fulfill]; + }]; [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTest_TC_CC_3_3_000004_Off +- (void)testSendClusterTestCluster_000039_ReadAttribute { - XCTestExpectation * expectation = [self expectationWithDescription:@"Turn off light that we turned on"]; + XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute INT16U Min Value"]; CHIPDevice * device = GetConnectedDevice(); dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:queue]; + CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; XCTAssertNotNil(cluster); - [cluster off:^(NSError * err, NSDictionary * values) { - NSLog(@"Turn off light that we turned on Error: %@", err); + [cluster readAttributeInt16uWithResponseHandler:^(NSError * err, NSDictionary * values) { + NSLog(@"Read attribute INT16U Min Value Error: %@", err); XCTAssertEqual(err.code, 0); + XCTAssertEqual([values[@"value"] unsignedShortValue], 0U); + [expectation fulfill]; }]; [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTest_TC_CC_3_3_000005_ReadAttribute +- (void)testSendClusterTestCluster_000040_ReadAttribute { - XCTestExpectation * expectation = [self expectationWithDescription:@"Check on/off attribute value is false after off command"]; + XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute INT32U Default Value"]; CHIPDevice * device = GetConnectedDevice(); dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:queue]; + CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; XCTAssertNotNil(cluster); - [cluster readAttributeOnOffWithResponseHandler:^(NSError * err, NSDictionary * values) { - NSLog(@"Check on/off attribute value is false after off command Error: %@", err); + [cluster readAttributeInt32uWithResponseHandler:^(NSError * err, NSDictionary * values) { + NSLog(@"Read attribute INT32U Default Value Error: %@", err); XCTAssertEqual(err.code, 0); - XCTAssertEqual([values[@"value"] boolValue], 0); + XCTAssertEqual([values[@"value"] unsignedLongValue], 0UL); [expectation fulfill]; }]; [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } - -- (void)testSendClusterTest_TC_CC_4_1_000000_On +- (void)testSendClusterTestCluster_000041_WriteAttribute { - XCTestExpectation * expectation = [self expectationWithDescription:@"Turn on light for color control tests"]; + XCTestExpectation * expectation = [self expectationWithDescription:@"Write attribute INT32U Max Value"]; CHIPDevice * device = GetConnectedDevice(); dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:queue]; + CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; XCTAssertNotNil(cluster); - [cluster on:^(NSError * err, NSDictionary * values) { - NSLog(@"Turn on light for color control tests Error: %@", err); + uint32_t int32uArgument = 4294967295UL; + [cluster writeAttributeInt32uWithValue:int32uArgument + responseHandler:^(NSError * err, NSDictionary * values) { + NSLog(@"Write attribute INT32U Max Value Error: %@", err); - XCTAssertEqual(err.code, 0); + XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; + [expectation fulfill]; + }]; [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTest_TC_CC_4_1_000001_ReadAttribute +- (void)testSendClusterTestCluster_000042_ReadAttribute { - XCTestExpectation * expectation = [self expectationWithDescription:@"Check on/off attribute value is true after on command"]; + XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute INT32U Max Value"]; CHIPDevice * device = GetConnectedDevice(); dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:queue]; + CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; XCTAssertNotNil(cluster); - [cluster readAttributeOnOffWithResponseHandler:^(NSError * err, NSDictionary * values) { - NSLog(@"Check on/off attribute value is true after on command Error: %@", err); + [cluster readAttributeInt32uWithResponseHandler:^(NSError * err, NSDictionary * values) { + NSLog(@"Read attribute INT32U Max Value Error: %@", err); XCTAssertEqual(err.code, 0); - XCTAssertEqual([values[@"value"] boolValue], 1); + XCTAssertEqual([values[@"value"] unsignedLongValue], 4294967295UL); [expectation fulfill]; }]; [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTest_TC_CC_4_1_000002_MoveToSaturation +- (void)testSendClusterTestCluster_000043_WriteAttribute { - XCTestExpectation * expectation = [self expectationWithDescription:@"Move to saturation command"]; + XCTestExpectation * expectation = [self expectationWithDescription:@"Write attribute INT32U Min Value"]; CHIPDevice * device = GetConnectedDevice(); dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; + CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; XCTAssertNotNil(cluster); - uint8_t saturationArgument = 90; - uint16_t transitionTimeArgument = 10U; - uint8_t optionsMaskArgument = 0; - uint8_t optionsOverrideArgument = 0; - [cluster moveToSaturation:saturationArgument - transitionTime:transitionTimeArgument - optionsMask:optionsMaskArgument - optionsOverride:optionsOverrideArgument - responseHandler:^(NSError * err, NSDictionary * values) { - NSLog(@"Move to saturation command Error: %@", err); + uint32_t int32uArgument = 0UL; + [cluster writeAttributeInt32uWithValue:int32uArgument + responseHandler:^(NSError * err, NSDictionary * values) { + NSLog(@"Write attribute INT32U Min Value Error: %@", err); - XCTAssertEqual(err.code, 0); + XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; + [expectation fulfill]; + }]; [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTest_TC_CC_4_1_000003_Off +- (void)testSendClusterTestCluster_000044_ReadAttribute { - XCTestExpectation * expectation = [self expectationWithDescription:@"Turn off light that we turned on"]; + XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute INT32U Min Value"]; CHIPDevice * device = GetConnectedDevice(); dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:queue]; + CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; XCTAssertNotNil(cluster); - [cluster off:^(NSError * err, NSDictionary * values) { - NSLog(@"Turn off light that we turned on Error: %@", err); + [cluster readAttributeInt32uWithResponseHandler:^(NSError * err, NSDictionary * values) { + NSLog(@"Read attribute INT32U Min Value Error: %@", err); XCTAssertEqual(err.code, 0); + XCTAssertEqual([values[@"value"] unsignedLongValue], 0UL); + [expectation fulfill]; }]; [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTest_TC_CC_4_1_000004_ReadAttribute +- (void)testSendClusterTestCluster_000045_ReadAttribute { - XCTestExpectation * expectation = [self expectationWithDescription:@"Check on/off attribute value is false after off command"]; + XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute INT64U Default Value"]; CHIPDevice * device = GetConnectedDevice(); dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:queue]; + CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; XCTAssertNotNil(cluster); - [cluster readAttributeOnOffWithResponseHandler:^(NSError * err, NSDictionary * values) { - NSLog(@"Check on/off attribute value is false after off command Error: %@", err); + [cluster readAttributeInt64uWithResponseHandler:^(NSError * err, NSDictionary * values) { + NSLog(@"Read attribute INT64U Default Value Error: %@", err); XCTAssertEqual(err.code, 0); - XCTAssertEqual([values[@"value"] boolValue], 0); + XCTAssertEqual([values[@"value"] unsignedLongLongValue], 0ULL); [expectation fulfill]; }]; [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } - -- (void)testSendClusterTest_TC_CC_4_2_000000_On +- (void)testSendClusterTestCluster_000046_WriteAttribute { - XCTestExpectation * expectation = [self expectationWithDescription:@"Turn on light for color control tests"]; + XCTestExpectation * expectation = [self expectationWithDescription:@"Write attribute INT64U Max Value"]; CHIPDevice * device = GetConnectedDevice(); dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:queue]; + CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; XCTAssertNotNil(cluster); - [cluster on:^(NSError * err, NSDictionary * values) { - NSLog(@"Turn on light for color control tests Error: %@", err); + uint64_t int64uArgument = 18446744073709551615ULL; + [cluster writeAttributeInt64uWithValue:int64uArgument + responseHandler:^(NSError * err, NSDictionary * values) { + NSLog(@"Write attribute INT64U Max Value Error: %@", err); - XCTAssertEqual(err.code, 0); + XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; + [expectation fulfill]; + }]; [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTest_TC_CC_4_2_000001_ReadAttribute +- (void)testSendClusterTestCluster_000047_ReadAttribute { - XCTestExpectation * expectation = [self expectationWithDescription:@"Check on/off attribute value is true after on command"]; + XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute INT64U Max Value"]; CHIPDevice * device = GetConnectedDevice(); dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:queue]; + CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; XCTAssertNotNil(cluster); - [cluster readAttributeOnOffWithResponseHandler:^(NSError * err, NSDictionary * values) { - NSLog(@"Check on/off attribute value is true after on command Error: %@", err); + [cluster readAttributeInt64uWithResponseHandler:^(NSError * err, NSDictionary * values) { + NSLog(@"Read attribute INT64U Max Value Error: %@", err); XCTAssertEqual(err.code, 0); - XCTAssertEqual([values[@"value"] boolValue], 1); + XCTAssertEqual([values[@"value"] unsignedLongLongValue], 18446744073709551615ULL); [expectation fulfill]; }]; [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTest_TC_CC_4_2_000002_MoveSaturation +- (void)testSendClusterTestCluster_000048_WriteAttribute { - XCTestExpectation * expectation = [self expectationWithDescription:@"Move saturation up command"]; + XCTestExpectation * expectation = [self expectationWithDescription:@"Write attribute INT64U Min Value"]; CHIPDevice * device = GetConnectedDevice(); dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; + CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; XCTAssertNotNil(cluster); - uint8_t moveModeArgument = 1; - uint8_t rateArgument = 5; - uint8_t optionsMaskArgument = 0; - uint8_t optionsOverrideArgument = 0; - [cluster moveSaturation:moveModeArgument - rate:rateArgument - optionsMask:optionsMaskArgument - optionsOverride:optionsOverrideArgument - responseHandler:^(NSError * err, NSDictionary * values) { - NSLog(@"Move saturation up command Error: %@", err); + uint64_t int64uArgument = 0ULL; + [cluster writeAttributeInt64uWithValue:int64uArgument + responseHandler:^(NSError * err, NSDictionary * values) { + NSLog(@"Write attribute INT64U Min Value Error: %@", err); - XCTAssertEqual(err.code, 0); + XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; + [expectation fulfill]; + }]; [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTest_TC_CC_4_2_000003_MoveSaturation +- (void)testSendClusterTestCluster_000049_ReadAttribute { - XCTestExpectation * expectation = [self expectationWithDescription:@"Move saturation down command"]; + XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute INT64U Min Value"]; CHIPDevice * device = GetConnectedDevice(); dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; + CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; XCTAssertNotNil(cluster); - uint8_t moveModeArgument = 3; - uint8_t rateArgument = 5; - uint8_t optionsMaskArgument = 0; - uint8_t optionsOverrideArgument = 0; - [cluster moveSaturation:moveModeArgument - rate:rateArgument - optionsMask:optionsMaskArgument - optionsOverride:optionsOverrideArgument - responseHandler:^(NSError * err, NSDictionary * values) { - NSLog(@"Move saturation down command Error: %@", err); + [cluster readAttributeInt64uWithResponseHandler:^(NSError * err, NSDictionary * values) { + NSLog(@"Read attribute INT64U Min Value Error: %@", err); - XCTAssertEqual(err.code, 0); + XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; + XCTAssertEqual([values[@"value"] unsignedLongLongValue], 0ULL); + + [expectation fulfill]; + }]; [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTest_TC_CC_4_2_000004_Off +- (void)testSendClusterTestCluster_000050_ReadAttribute { - XCTestExpectation * expectation = [self expectationWithDescription:@"Turn off light that we turned on"]; + XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute INT8S Default Value"]; CHIPDevice * device = GetConnectedDevice(); dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:queue]; + CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; XCTAssertNotNil(cluster); - [cluster off:^(NSError * err, NSDictionary * values) { - NSLog(@"Turn off light that we turned on Error: %@", err); + [cluster readAttributeInt8sWithResponseHandler:^(NSError * err, NSDictionary * values) { + NSLog(@"Read attribute INT8S Default Value Error: %@", err); XCTAssertEqual(err.code, 0); + XCTAssertEqual([values[@"value"] charValue], 0); + [expectation fulfill]; }]; [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTest_TC_CC_4_2_000005_ReadAttribute +- (void)testSendClusterTestCluster_000051_WriteAttribute { - XCTestExpectation * expectation = [self expectationWithDescription:@"Check on/off attribute value is false after off command"]; + XCTestExpectation * expectation = [self expectationWithDescription:@"Write attribute INT8S Max Value"]; CHIPDevice * device = GetConnectedDevice(); dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:queue]; + CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; XCTAssertNotNil(cluster); - [cluster readAttributeOnOffWithResponseHandler:^(NSError * err, NSDictionary * values) { - NSLog(@"Check on/off attribute value is false after off command Error: %@", err); - - XCTAssertEqual(err.code, 0); + int8_t int8sArgument = 127; + [cluster writeAttributeInt8sWithValue:int8sArgument + responseHandler:^(NSError * err, NSDictionary * values) { + NSLog(@"Write attribute INT8S Max Value Error: %@", err); - XCTAssertEqual([values[@"value"] boolValue], 0); + XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; + [expectation fulfill]; + }]; [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } - -- (void)testSendClusterTest_TC_CC_4_3_000000_On +- (void)testSendClusterTestCluster_000052_ReadAttribute { - XCTestExpectation * expectation = [self expectationWithDescription:@"Turn on light for color control tests"]; + XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute INT8S Max Value"]; CHIPDevice * device = GetConnectedDevice(); dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:queue]; + CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; XCTAssertNotNil(cluster); - [cluster on:^(NSError * err, NSDictionary * values) { - NSLog(@"Turn on light for color control tests Error: %@", err); + [cluster readAttributeInt8sWithResponseHandler:^(NSError * err, NSDictionary * values) { + NSLog(@"Read attribute INT8S Max Value Error: %@", err); XCTAssertEqual(err.code, 0); + XCTAssertEqual([values[@"value"] charValue], 127); + [expectation fulfill]; }]; [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTest_TC_CC_4_3_000001_ReadAttribute +- (void)testSendClusterTestCluster_000053_WriteAttribute { - XCTestExpectation * expectation = [self expectationWithDescription:@"Check on/off attribute value is true after on command"]; + XCTestExpectation * expectation = [self expectationWithDescription:@"Write attribute INT8S Min Value"]; CHIPDevice * device = GetConnectedDevice(); dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:queue]; + CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; XCTAssertNotNil(cluster); - [cluster readAttributeOnOffWithResponseHandler:^(NSError * err, NSDictionary * values) { - NSLog(@"Check on/off attribute value is true after on command Error: %@", err); - - XCTAssertEqual(err.code, 0); + int8_t int8sArgument = -128; + [cluster writeAttributeInt8sWithValue:int8sArgument + responseHandler:^(NSError * err, NSDictionary * values) { + NSLog(@"Write attribute INT8S Min Value Error: %@", err); - XCTAssertEqual([values[@"value"] boolValue], 1); + XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; + [expectation fulfill]; + }]; [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTest_TC_CC_4_3_000002_StepSaturation +- (void)testSendClusterTestCluster_000054_ReadAttribute { - XCTestExpectation * expectation = [self expectationWithDescription:@"Step saturation up command"]; + XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute INT8S Min Value"]; CHIPDevice * device = GetConnectedDevice(); dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; + CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; XCTAssertNotNil(cluster); - uint8_t stepModeArgument = 1; - uint8_t stepSizeArgument = 15; - uint8_t transitionTimeArgument = 10; - uint8_t optionsMaskArgument = 0; - uint8_t optionsOverrideArgument = 0; - [cluster stepSaturation:stepModeArgument - stepSize:stepSizeArgument - transitionTime:transitionTimeArgument - optionsMask:optionsMaskArgument - optionsOverride:optionsOverrideArgument - responseHandler:^(NSError * err, NSDictionary * values) { - NSLog(@"Step saturation up command Error: %@", err); + [cluster readAttributeInt8sWithResponseHandler:^(NSError * err, NSDictionary * values) { + NSLog(@"Read attribute INT8S Min Value Error: %@", err); - XCTAssertEqual(err.code, 0); + XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; + XCTAssertEqual([values[@"value"] charValue], -128); + + [expectation fulfill]; + }]; [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTest_TC_CC_4_3_000003_StepSaturation +- (void)testSendClusterTestCluster_000055_WriteAttribute { - XCTestExpectation * expectation = [self expectationWithDescription:@"Step saturation down command"]; + XCTestExpectation * expectation = [self expectationWithDescription:@"Write attribute INT8S Default Value"]; CHIPDevice * device = GetConnectedDevice(); dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; + CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; XCTAssertNotNil(cluster); - uint8_t stepModeArgument = 3; - uint8_t stepSizeArgument = 20; - uint8_t transitionTimeArgument = 10; - uint8_t optionsMaskArgument = 0; - uint8_t optionsOverrideArgument = 0; - [cluster stepSaturation:stepModeArgument - stepSize:stepSizeArgument - transitionTime:transitionTimeArgument - optionsMask:optionsMaskArgument - optionsOverride:optionsOverrideArgument - responseHandler:^(NSError * err, NSDictionary * values) { - NSLog(@"Step saturation down command Error: %@", err); + int8_t int8sArgument = 0; + [cluster writeAttributeInt8sWithValue:int8sArgument + responseHandler:^(NSError * err, NSDictionary * values) { + NSLog(@"Write attribute INT8S Default Value Error: %@", err); - XCTAssertEqual(err.code, 0); + XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; + [expectation fulfill]; + }]; [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTest_TC_CC_4_3_000004_Off +- (void)testSendClusterTestCluster_000056_ReadAttribute { - XCTestExpectation * expectation = [self expectationWithDescription:@"Turn off light that we turned on"]; + XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute INT8S Default Value"]; CHIPDevice * device = GetConnectedDevice(); dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:queue]; + CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; XCTAssertNotNil(cluster); - [cluster off:^(NSError * err, NSDictionary * values) { - NSLog(@"Turn off light that we turned on Error: %@", err); + [cluster readAttributeInt8sWithResponseHandler:^(NSError * err, NSDictionary * values) { + NSLog(@"Read attribute INT8S Default Value Error: %@", err); XCTAssertEqual(err.code, 0); + XCTAssertEqual([values[@"value"] charValue], 0); + [expectation fulfill]; }]; [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTest_TC_CC_4_3_000005_ReadAttribute +- (void)testSendClusterTestCluster_000057_ReadAttribute { - XCTestExpectation * expectation = [self expectationWithDescription:@"Check on/off attribute value is false after off command"]; + XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute INT16S Default Value"]; CHIPDevice * device = GetConnectedDevice(); dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:queue]; + CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; XCTAssertNotNil(cluster); - [cluster readAttributeOnOffWithResponseHandler:^(NSError * err, NSDictionary * values) { - NSLog(@"Check on/off attribute value is false after off command Error: %@", err); + [cluster readAttributeInt16sWithResponseHandler:^(NSError * err, NSDictionary * values) { + NSLog(@"Read attribute INT16S Default Value Error: %@", err); XCTAssertEqual(err.code, 0); - XCTAssertEqual([values[@"value"] boolValue], 0); + XCTAssertEqual([values[@"value"] shortValue], 0); [expectation fulfill]; }]; [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } - -- (void)testSendClusterTest_TC_CC_4_4_000000_On +- (void)testSendClusterTestCluster_000058_WriteAttribute { - XCTestExpectation * expectation = [self expectationWithDescription:@"Turn on light for color control tests"]; + XCTestExpectation * expectation = [self expectationWithDescription:@"Write attribute INT16S Max Value"]; CHIPDevice * device = GetConnectedDevice(); dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:queue]; + CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; XCTAssertNotNil(cluster); - [cluster on:^(NSError * err, NSDictionary * values) { - NSLog(@"Turn on light for color control tests Error: %@", err); + int16_t int16sArgument = 32767; + [cluster writeAttributeInt16sWithValue:int16sArgument + responseHandler:^(NSError * err, NSDictionary * values) { + NSLog(@"Write attribute INT16S Max Value Error: %@", err); - XCTAssertEqual(err.code, 0); + XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; + [expectation fulfill]; + }]; [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTest_TC_CC_4_4_000001_ReadAttribute +- (void)testSendClusterTestCluster_000059_ReadAttribute { - XCTestExpectation * expectation = [self expectationWithDescription:@"Check on/off attribute value is true after on command"]; + XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute INT16S Max Value"]; CHIPDevice * device = GetConnectedDevice(); dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:queue]; + CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; XCTAssertNotNil(cluster); - [cluster readAttributeOnOffWithResponseHandler:^(NSError * err, NSDictionary * values) { - NSLog(@"Check on/off attribute value is true after on command Error: %@", err); + [cluster readAttributeInt16sWithResponseHandler:^(NSError * err, NSDictionary * values) { + NSLog(@"Read attribute INT16S Max Value Error: %@", err); XCTAssertEqual(err.code, 0); - XCTAssertEqual([values[@"value"] boolValue], 1); + XCTAssertEqual([values[@"value"] shortValue], 32767); [expectation fulfill]; }]; [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTest_TC_CC_4_4_000002_MoveToHueAndSaturation +- (void)testSendClusterTestCluster_000060_WriteAttribute { - XCTestExpectation * expectation = [self expectationWithDescription:@"Move To current hue and saturation command"]; + XCTestExpectation * expectation = [self expectationWithDescription:@"Write attribute INT16S Min Value"]; CHIPDevice * device = GetConnectedDevice(); dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; + CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; XCTAssertNotNil(cluster); - uint8_t hueArgument = 40; - uint8_t saturationArgument = 160; - uint16_t transitionTimeArgument = 10U; - uint8_t optionsMaskArgument = 0; - uint8_t optionsOverrideArgument = 0; - [cluster moveToHueAndSaturation:hueArgument - saturation:saturationArgument - transitionTime:transitionTimeArgument - optionsMask:optionsMaskArgument - optionsOverride:optionsOverrideArgument - responseHandler:^(NSError * err, NSDictionary * values) { - NSLog(@"Move To current hue and saturation command Error: %@", err); + int16_t int16sArgument = -32768; + [cluster writeAttributeInt16sWithValue:int16sArgument + responseHandler:^(NSError * err, NSDictionary * values) { + NSLog(@"Write attribute INT16S Min Value Error: %@", err); - XCTAssertEqual(err.code, 0); + XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; + [expectation fulfill]; + }]; [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTest_TC_CC_4_4_000003_Off +- (void)testSendClusterTestCluster_000061_ReadAttribute { - XCTestExpectation * expectation = [self expectationWithDescription:@"Turn off light that we turned on"]; + XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute INT16S Min Value"]; CHIPDevice * device = GetConnectedDevice(); dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:queue]; + CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; XCTAssertNotNil(cluster); - [cluster off:^(NSError * err, NSDictionary * values) { - NSLog(@"Turn off light that we turned on Error: %@", err); + [cluster readAttributeInt16sWithResponseHandler:^(NSError * err, NSDictionary * values) { + NSLog(@"Read attribute INT16S Min Value Error: %@", err); XCTAssertEqual(err.code, 0); + XCTAssertEqual([values[@"value"] shortValue], -32768); + [expectation fulfill]; }]; [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTest_TC_CC_4_4_000004_ReadAttribute +- (void)testSendClusterTestCluster_000062_WriteAttribute { - XCTestExpectation * expectation = [self expectationWithDescription:@"Check on/off attribute value is false after off command"]; + XCTestExpectation * expectation = [self expectationWithDescription:@"Write attribute INT16S Default Value"]; CHIPDevice * device = GetConnectedDevice(); dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:queue]; + CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; XCTAssertNotNil(cluster); - [cluster readAttributeOnOffWithResponseHandler:^(NSError * err, NSDictionary * values) { - NSLog(@"Check on/off attribute value is false after off command Error: %@", err); - - XCTAssertEqual(err.code, 0); + int16_t int16sArgument = 0; + [cluster writeAttributeInt16sWithValue:int16sArgument + responseHandler:^(NSError * err, NSDictionary * values) { + NSLog(@"Write attribute INT16S Default Value Error: %@", err); - XCTAssertEqual([values[@"value"] boolValue], 0); + XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; + [expectation fulfill]; + }]; [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } - -- (void)testSendClusterTest_TC_CC_5_1_000000_On +- (void)testSendClusterTestCluster_000063_ReadAttribute { - XCTestExpectation * expectation = [self expectationWithDescription:@"Turn on light for color control tests"]; + XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute INT16S Default Value"]; CHIPDevice * device = GetConnectedDevice(); dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:queue]; + CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; XCTAssertNotNil(cluster); - [cluster on:^(NSError * err, NSDictionary * values) { - NSLog(@"Turn on light for color control tests Error: %@", err); + [cluster readAttributeInt16sWithResponseHandler:^(NSError * err, NSDictionary * values) { + NSLog(@"Read attribute INT16S Default Value Error: %@", err); XCTAssertEqual(err.code, 0); + XCTAssertEqual([values[@"value"] shortValue], 0); + [expectation fulfill]; }]; [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTest_TC_CC_5_1_000001_ReadAttribute +- (void)testSendClusterTestCluster_000064_ReadAttribute { - XCTestExpectation * expectation = [self expectationWithDescription:@"Check on/off attribute value is true after on command"]; + XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute INT32S Default Value"]; CHIPDevice * device = GetConnectedDevice(); dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:queue]; + CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; XCTAssertNotNil(cluster); - [cluster readAttributeOnOffWithResponseHandler:^(NSError * err, NSDictionary * values) { - NSLog(@"Check on/off attribute value is true after on command Error: %@", err); + [cluster readAttributeInt32sWithResponseHandler:^(NSError * err, NSDictionary * values) { + NSLog(@"Read attribute INT32S Default Value Error: %@", err); XCTAssertEqual(err.code, 0); - XCTAssertEqual([values[@"value"] boolValue], 1); + XCTAssertEqual([values[@"value"] longValue], 0L); [expectation fulfill]; }]; [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTest_TC_CC_5_1_000002_MoveToColor +- (void)testSendClusterTestCluster_000065_WriteAttribute { - XCTestExpectation * expectation = [self expectationWithDescription:@"Move to Color command"]; + XCTestExpectation * expectation = [self expectationWithDescription:@"Write attribute INT32S Max Value"]; CHIPDevice * device = GetConnectedDevice(); dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; + CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; XCTAssertNotNil(cluster); - uint16_t colorXArgument = 200U; - uint16_t colorYArgument = 300U; - uint16_t transitionTimeArgument = 20U; - uint8_t optionsMaskArgument = 0; - uint8_t optionsOverrideArgument = 0; - [cluster moveToColor:colorXArgument - colorY:colorYArgument - transitionTime:transitionTimeArgument - optionsMask:optionsMaskArgument - optionsOverride:optionsOverrideArgument - responseHandler:^(NSError * err, NSDictionary * values) { - NSLog(@"Move to Color command Error: %@", err); + int32_t int32sArgument = 2147483647L; + [cluster writeAttributeInt32sWithValue:int32sArgument + responseHandler:^(NSError * err, NSDictionary * values) { + NSLog(@"Write attribute INT32S Max Value Error: %@", err); - XCTAssertEqual(err.code, 0); + XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; + [expectation fulfill]; + }]; [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTest_TC_CC_5_1_000003_Off +- (void)testSendClusterTestCluster_000066_ReadAttribute { - XCTestExpectation * expectation = [self expectationWithDescription:@"Turn off light that we turned on"]; + XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute INT32S Max Value"]; CHIPDevice * device = GetConnectedDevice(); dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:queue]; + CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; XCTAssertNotNil(cluster); - [cluster off:^(NSError * err, NSDictionary * values) { - NSLog(@"Turn off light that we turned on Error: %@", err); + [cluster readAttributeInt32sWithResponseHandler:^(NSError * err, NSDictionary * values) { + NSLog(@"Read attribute INT32S Max Value Error: %@", err); XCTAssertEqual(err.code, 0); + XCTAssertEqual([values[@"value"] longValue], 2147483647L); + [expectation fulfill]; }]; [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTest_TC_CC_5_1_000004_ReadAttribute +- (void)testSendClusterTestCluster_000067_WriteAttribute { - XCTestExpectation * expectation = [self expectationWithDescription:@"Check on/off attribute value is false after off command"]; + XCTestExpectation * expectation = [self expectationWithDescription:@"Write attribute INT32S Min Value"]; CHIPDevice * device = GetConnectedDevice(); dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:queue]; + CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; XCTAssertNotNil(cluster); - [cluster readAttributeOnOffWithResponseHandler:^(NSError * err, NSDictionary * values) { - NSLog(@"Check on/off attribute value is false after off command Error: %@", err); - - XCTAssertEqual(err.code, 0); + int32_t int32sArgument = -2147483648L; + [cluster writeAttributeInt32sWithValue:int32sArgument + responseHandler:^(NSError * err, NSDictionary * values) { + NSLog(@"Write attribute INT32S Min Value Error: %@", err); - XCTAssertEqual([values[@"value"] boolValue], 0); + XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; + [expectation fulfill]; + }]; [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } - -- (void)testSendClusterTest_TC_CC_5_2_000000_On +- (void)testSendClusterTestCluster_000068_ReadAttribute { - XCTestExpectation * expectation = [self expectationWithDescription:@"Turn on light for color control tests"]; + XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute INT32S Min Value"]; CHIPDevice * device = GetConnectedDevice(); dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:queue]; + CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; XCTAssertNotNil(cluster); - [cluster on:^(NSError * err, NSDictionary * values) { - NSLog(@"Turn on light for color control tests Error: %@", err); + [cluster readAttributeInt32sWithResponseHandler:^(NSError * err, NSDictionary * values) { + NSLog(@"Read attribute INT32S Min Value Error: %@", err); XCTAssertEqual(err.code, 0); + XCTAssertEqual([values[@"value"] longValue], -2147483648L); + [expectation fulfill]; }]; [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTest_TC_CC_5_2_000001_ReadAttribute +- (void)testSendClusterTestCluster_000069_WriteAttribute { - XCTestExpectation * expectation = [self expectationWithDescription:@"Check on/off attribute value is true after on command"]; + XCTestExpectation * expectation = [self expectationWithDescription:@"Write attribute INT32S Default Value"]; CHIPDevice * device = GetConnectedDevice(); dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:queue]; + CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; XCTAssertNotNil(cluster); - [cluster readAttributeOnOffWithResponseHandler:^(NSError * err, NSDictionary * values) { - NSLog(@"Check on/off attribute value is true after on command Error: %@", err); - - XCTAssertEqual(err.code, 0); + int32_t int32sArgument = 0L; + [cluster writeAttributeInt32sWithValue:int32sArgument + responseHandler:^(NSError * err, NSDictionary * values) { + NSLog(@"Write attribute INT32S Default Value Error: %@", err); - XCTAssertEqual([values[@"value"] boolValue], 1); + XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; + [expectation fulfill]; + }]; [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTest_TC_CC_5_2_000002_MoveColor +- (void)testSendClusterTestCluster_000070_ReadAttribute { - XCTestExpectation * expectation = [self expectationWithDescription:@"Move Color command"]; + XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute INT32S Default Value"]; CHIPDevice * device = GetConnectedDevice(); dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; + CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; XCTAssertNotNil(cluster); - int16_t rateXArgument = 15; - int16_t rateYArgument = 20; - uint8_t optionsMaskArgument = 0; - uint8_t optionsOverrideArgument = 0; - [cluster moveColor:rateXArgument - rateY:rateYArgument - optionsMask:optionsMaskArgument - optionsOverride:optionsOverrideArgument - responseHandler:^(NSError * err, NSDictionary * values) { - NSLog(@"Move Color command Error: %@", err); + [cluster readAttributeInt32sWithResponseHandler:^(NSError * err, NSDictionary * values) { + NSLog(@"Read attribute INT32S Default Value Error: %@", err); - XCTAssertEqual(err.code, 0); + XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; + XCTAssertEqual([values[@"value"] longValue], 0L); + + [expectation fulfill]; + }]; [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTest_TC_CC_5_2_000003_StopMoveStep +- (void)testSendClusterTestCluster_000071_ReadAttribute { - XCTestExpectation * expectation = [self expectationWithDescription:@"Stop Move Step command"]; + XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute INT64S Default Value"]; CHIPDevice * device = GetConnectedDevice(); dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; + CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; XCTAssertNotNil(cluster); - uint8_t optionsMaskArgument = 0; - uint8_t optionsOverrideArgument = 0; - [cluster stopMoveStep:optionsMaskArgument - optionsOverride:optionsOverrideArgument - responseHandler:^(NSError * err, NSDictionary * values) { - NSLog(@"Stop Move Step command Error: %@", err); + [cluster readAttributeInt64sWithResponseHandler:^(NSError * err, NSDictionary * values) { + NSLog(@"Read attribute INT64S Default Value Error: %@", err); - XCTAssertEqual(err.code, 0); + XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; + XCTAssertEqual([values[@"value"] longLongValue], 0LL); + + [expectation fulfill]; + }]; [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTest_TC_CC_5_2_000004_Off +- (void)testSendClusterTestCluster_000072_WriteAttribute { - XCTestExpectation * expectation = [self expectationWithDescription:@"Turn off light that we turned on"]; + XCTestExpectation * expectation = [self expectationWithDescription:@"Write attribute INT64S Max Value"]; CHIPDevice * device = GetConnectedDevice(); dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:queue]; + CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; XCTAssertNotNil(cluster); - [cluster off:^(NSError * err, NSDictionary * values) { - NSLog(@"Turn off light that we turned on Error: %@", err); + int64_t int64sArgument = 9223372036854775807LL; + [cluster writeAttributeInt64sWithValue:int64sArgument + responseHandler:^(NSError * err, NSDictionary * values) { + NSLog(@"Write attribute INT64S Max Value Error: %@", err); - XCTAssertEqual(err.code, 0); + XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; + [expectation fulfill]; + }]; [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTest_TC_CC_5_2_000005_ReadAttribute +- (void)testSendClusterTestCluster_000073_ReadAttribute { - XCTestExpectation * expectation = [self expectationWithDescription:@"Check on/off attribute value is false after off command"]; + XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute INT64S Max Value"]; CHIPDevice * device = GetConnectedDevice(); dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:queue]; + CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; XCTAssertNotNil(cluster); - [cluster readAttributeOnOffWithResponseHandler:^(NSError * err, NSDictionary * values) { - NSLog(@"Check on/off attribute value is false after off command Error: %@", err); + [cluster readAttributeInt64sWithResponseHandler:^(NSError * err, NSDictionary * values) { + NSLog(@"Read attribute INT64S Max Value Error: %@", err); XCTAssertEqual(err.code, 0); - XCTAssertEqual([values[@"value"] boolValue], 0); + XCTAssertEqual([values[@"value"] longLongValue], 9223372036854775807LL); [expectation fulfill]; }]; [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } - -- (void)testSendClusterTest_TC_CC_5_3_000000_On +- (void)testSendClusterTestCluster_000074_WriteAttribute { - XCTestExpectation * expectation = [self expectationWithDescription:@"Turn on light for color control tests"]; + XCTestExpectation * expectation = [self expectationWithDescription:@"Write attribute INT64S Min Value"]; CHIPDevice * device = GetConnectedDevice(); dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:queue]; + CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; XCTAssertNotNil(cluster); - [cluster on:^(NSError * err, NSDictionary * values) { - NSLog(@"Turn on light for color control tests Error: %@", err); + int64_t int64sArgument = -9223372036854775807LL; + [cluster writeAttributeInt64sWithValue:int64sArgument + responseHandler:^(NSError * err, NSDictionary * values) { + NSLog(@"Write attribute INT64S Min Value Error: %@", err); - XCTAssertEqual(err.code, 0); + XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; + [expectation fulfill]; + }]; [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTest_TC_CC_5_3_000001_ReadAttribute +- (void)testSendClusterTestCluster_000075_ReadAttribute { - XCTestExpectation * expectation = [self expectationWithDescription:@"Check on/off attribute value is true after on command"]; + XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute INT64S Min Value"]; CHIPDevice * device = GetConnectedDevice(); dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:queue]; + CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; XCTAssertNotNil(cluster); - [cluster readAttributeOnOffWithResponseHandler:^(NSError * err, NSDictionary * values) { - NSLog(@"Check on/off attribute value is true after on command Error: %@", err); + [cluster readAttributeInt64sWithResponseHandler:^(NSError * err, NSDictionary * values) { + NSLog(@"Read attribute INT64S Min Value Error: %@", err); XCTAssertEqual(err.code, 0); - XCTAssertEqual([values[@"value"] boolValue], 1); + XCTAssertEqual([values[@"value"] longLongValue], -9223372036854775807LL); [expectation fulfill]; }]; [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTest_TC_CC_5_3_000002_StepColor +- (void)testSendClusterTestCluster_000076_WriteAttribute { - XCTestExpectation * expectation = [self expectationWithDescription:@"Step Color command"]; + XCTestExpectation * expectation = [self expectationWithDescription:@"Write attribute INT64S Default Value"]; CHIPDevice * device = GetConnectedDevice(); dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; + CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; XCTAssertNotNil(cluster); - int16_t stepXArgument = 15; - int16_t stepYArgument = 20; - uint16_t transitionTimeArgument = 50U; - uint8_t optionsMaskArgument = 0; - uint8_t optionsOverrideArgument = 0; - [cluster stepColor:stepXArgument - stepY:stepYArgument - transitionTime:transitionTimeArgument - optionsMask:optionsMaskArgument - optionsOverride:optionsOverrideArgument - responseHandler:^(NSError * err, NSDictionary * values) { - NSLog(@"Step Color command Error: %@", err); + int64_t int64sArgument = 0LL; + [cluster writeAttributeInt64sWithValue:int64sArgument + responseHandler:^(NSError * err, NSDictionary * values) { + NSLog(@"Write attribute INT64S Default Value Error: %@", err); - XCTAssertEqual(err.code, 0); + XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; + [expectation fulfill]; + }]; [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTest_TC_CC_5_3_000003_Off +- (void)testSendClusterTestCluster_000077_ReadAttribute { - XCTestExpectation * expectation = [self expectationWithDescription:@"Turn off light that we turned on"]; + XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute INT64S Default Value"]; CHIPDevice * device = GetConnectedDevice(); dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:queue]; + CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; XCTAssertNotNil(cluster); - [cluster off:^(NSError * err, NSDictionary * values) { - NSLog(@"Turn off light that we turned on Error: %@", err); + [cluster readAttributeInt64sWithResponseHandler:^(NSError * err, NSDictionary * values) { + NSLog(@"Read attribute INT64S Default Value Error: %@", err); XCTAssertEqual(err.code, 0); + XCTAssertEqual([values[@"value"] longLongValue], 0LL); + [expectation fulfill]; }]; [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTest_TC_CC_5_3_000004_ReadAttribute +- (void)testSendClusterTestCluster_000078_ReadAttribute { - XCTestExpectation * expectation = [self expectationWithDescription:@"Check on/off attribute value is false after off command"]; + XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute ENUM8 Default Value"]; CHIPDevice * device = GetConnectedDevice(); dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:queue]; + CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; XCTAssertNotNil(cluster); - [cluster readAttributeOnOffWithResponseHandler:^(NSError * err, NSDictionary * values) { - NSLog(@"Check on/off attribute value is false after off command Error: %@", err); + [cluster readAttributeEnum8WithResponseHandler:^(NSError * err, NSDictionary * values) { + NSLog(@"Read attribute ENUM8 Default Value Error: %@", err); XCTAssertEqual(err.code, 0); - XCTAssertEqual([values[@"value"] boolValue], 0); + XCTAssertEqual([values[@"value"] unsignedCharValue], 0); [expectation fulfill]; }]; [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } - -- (void)testSendClusterTest_TC_CC_6_1_000000_On +- (void)testSendClusterTestCluster_000079_WriteAttribute { - XCTestExpectation * expectation = [self expectationWithDescription:@"Turn on light for color control tests"]; + XCTestExpectation * expectation = [self expectationWithDescription:@"Write attribute ENUM8 Max Value"]; CHIPDevice * device = GetConnectedDevice(); dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:queue]; + CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; XCTAssertNotNil(cluster); - [cluster on:^(NSError * err, NSDictionary * values) { - NSLog(@"Turn on light for color control tests Error: %@", err); + uint8_t enum8Argument = 255; + [cluster writeAttributeEnum8WithValue:enum8Argument + responseHandler:^(NSError * err, NSDictionary * values) { + NSLog(@"Write attribute ENUM8 Max Value Error: %@", err); - XCTAssertEqual(err.code, 0); + XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; + [expectation fulfill]; + }]; [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTest_TC_CC_6_1_000001_ReadAttribute +- (void)testSendClusterTestCluster_000080_ReadAttribute { - XCTestExpectation * expectation = [self expectationWithDescription:@"Check on/off attribute value is true after on command"]; + XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute ENUM8 Max Value"]; CHIPDevice * device = GetConnectedDevice(); dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:queue]; + CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; XCTAssertNotNil(cluster); - [cluster readAttributeOnOffWithResponseHandler:^(NSError * err, NSDictionary * values) { - NSLog(@"Check on/off attribute value is true after on command Error: %@", err); + [cluster readAttributeEnum8WithResponseHandler:^(NSError * err, NSDictionary * values) { + NSLog(@"Read attribute ENUM8 Max Value Error: %@", err); XCTAssertEqual(err.code, 0); - XCTAssertEqual([values[@"value"] boolValue], 1); + XCTAssertEqual([values[@"value"] unsignedCharValue], 255); [expectation fulfill]; }]; [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTest_TC_CC_6_1_000002_MoveToColorTemperature +- (void)testSendClusterTestCluster_000081_WriteAttribute { - XCTestExpectation * expectation = [self expectationWithDescription:@"Move To Color Temperature command"]; + XCTestExpectation * expectation = [self expectationWithDescription:@"Write attribute ENUM8 Min Value"]; CHIPDevice * device = GetConnectedDevice(); dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; + CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; XCTAssertNotNil(cluster); - uint16_t colorTemperatureArgument = 100U; - uint16_t transitionTimeArgument = 10U; - uint8_t optionsMaskArgument = 0; - uint8_t optionsOverrideArgument = 0; - [cluster moveToColorTemperature:colorTemperatureArgument - transitionTime:transitionTimeArgument - optionsMask:optionsMaskArgument - optionsOverride:optionsOverrideArgument - responseHandler:^(NSError * err, NSDictionary * values) { - NSLog(@"Move To Color Temperature command Error: %@", err); + uint8_t enum8Argument = 0; + [cluster writeAttributeEnum8WithValue:enum8Argument + responseHandler:^(NSError * err, NSDictionary * values) { + NSLog(@"Write attribute ENUM8 Min Value Error: %@", err); - XCTAssertEqual(err.code, 0); + XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; + [expectation fulfill]; + }]; [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTest_TC_CC_6_1_000003_Off +- (void)testSendClusterTestCluster_000082_ReadAttribute { - XCTestExpectation * expectation = [self expectationWithDescription:@"Turn off light that we turned on"]; + XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute ENUM8 Min Value"]; CHIPDevice * device = GetConnectedDevice(); dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:queue]; + CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; XCTAssertNotNil(cluster); - [cluster off:^(NSError * err, NSDictionary * values) { - NSLog(@"Turn off light that we turned on Error: %@", err); + [cluster readAttributeEnum8WithResponseHandler:^(NSError * err, NSDictionary * values) { + NSLog(@"Read attribute ENUM8 Min Value Error: %@", err); XCTAssertEqual(err.code, 0); + XCTAssertEqual([values[@"value"] unsignedCharValue], 0); + [expectation fulfill]; }]; [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTest_TC_CC_6_1_000004_ReadAttribute +- (void)testSendClusterTestCluster_000083_ReadAttribute { - XCTestExpectation * expectation = [self expectationWithDescription:@"Check on/off attribute value is false after off command"]; + XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute ENUM16 Default Value"]; CHIPDevice * device = GetConnectedDevice(); dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:queue]; + CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; XCTAssertNotNil(cluster); - [cluster readAttributeOnOffWithResponseHandler:^(NSError * err, NSDictionary * values) { - NSLog(@"Check on/off attribute value is false after off command Error: %@", err); + [cluster readAttributeEnum16WithResponseHandler:^(NSError * err, NSDictionary * values) { + NSLog(@"Read attribute ENUM16 Default Value Error: %@", err); XCTAssertEqual(err.code, 0); - XCTAssertEqual([values[@"value"] boolValue], 0); + XCTAssertEqual([values[@"value"] unsignedShortValue], 0U); [expectation fulfill]; }]; [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } - -- (void)testSendClusterTest_TC_CC_6_2_000000_On +- (void)testSendClusterTestCluster_000084_WriteAttribute { - XCTestExpectation * expectation = [self expectationWithDescription:@"Turn on light for color control tests"]; + XCTestExpectation * expectation = [self expectationWithDescription:@"Write attribute ENUM16 Max Value"]; CHIPDevice * device = GetConnectedDevice(); dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:queue]; + CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; XCTAssertNotNil(cluster); - [cluster on:^(NSError * err, NSDictionary * values) { - NSLog(@"Turn on light for color control tests Error: %@", err); + uint16_t enum16Argument = 65535U; + [cluster writeAttributeEnum16WithValue:enum16Argument + responseHandler:^(NSError * err, NSDictionary * values) { + NSLog(@"Write attribute ENUM16 Max Value Error: %@", err); - XCTAssertEqual(err.code, 0); + XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; + [expectation fulfill]; + }]; [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTest_TC_CC_6_2_000001_ReadAttribute +- (void)testSendClusterTestCluster_000085_ReadAttribute { - XCTestExpectation * expectation = [self expectationWithDescription:@"Check on/off attribute value is true after on command"]; + XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute ENUM16 Max Value"]; CHIPDevice * device = GetConnectedDevice(); dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:queue]; + CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; XCTAssertNotNil(cluster); - [cluster readAttributeOnOffWithResponseHandler:^(NSError * err, NSDictionary * values) { - NSLog(@"Check on/off attribute value is true after on command Error: %@", err); + [cluster readAttributeEnum16WithResponseHandler:^(NSError * err, NSDictionary * values) { + NSLog(@"Read attribute ENUM16 Max Value Error: %@", err); XCTAssertEqual(err.code, 0); - XCTAssertEqual([values[@"value"] boolValue], 1); + XCTAssertEqual([values[@"value"] unsignedShortValue], 65535U); [expectation fulfill]; }]; [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTest_TC_CC_6_2_000002_MoveColorTemperature +- (void)testSendClusterTestCluster_000086_WriteAttribute { - XCTestExpectation * expectation = [self expectationWithDescription:@"Move up color temperature command"]; + XCTestExpectation * expectation = [self expectationWithDescription:@"Write attribute ENUM16 Min Value"]; CHIPDevice * device = GetConnectedDevice(); dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; + CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; XCTAssertNotNil(cluster); - uint8_t moveModeArgument = 1; - uint16_t rateArgument = 10U; - uint16_t colorTemperatureMinimumArgument = 1U; - uint16_t colorTemperatureMaximumArgument = 255U; - uint8_t optionsMaskArgument = 0; - uint8_t optionsOverrideArgument = 0; - [cluster moveColorTemperature:moveModeArgument - rate:rateArgument - colorTemperatureMinimum:colorTemperatureMinimumArgument - colorTemperatureMaximum:colorTemperatureMaximumArgument - optionsMask:optionsMaskArgument - optionsOverride:optionsOverrideArgument - responseHandler:^(NSError * err, NSDictionary * values) { - NSLog(@"Move up color temperature command Error: %@", err); + uint16_t enum16Argument = 0U; + [cluster writeAttributeEnum16WithValue:enum16Argument + responseHandler:^(NSError * err, NSDictionary * values) { + NSLog(@"Write attribute ENUM16 Min Value Error: %@", err); - XCTAssertEqual(err.code, 0); + XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; + [expectation fulfill]; + }]; [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTest_TC_CC_6_2_000003_MoveColorTemperature +- (void)testSendClusterTestCluster_000087_ReadAttribute { - XCTestExpectation * expectation = [self expectationWithDescription:@"Stop Color Temperature command"]; + XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute ENUM16 Min Value"]; CHIPDevice * device = GetConnectedDevice(); dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; + CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; XCTAssertNotNil(cluster); - uint8_t moveModeArgument = 0; - uint16_t rateArgument = 10U; - uint16_t colorTemperatureMinimumArgument = 1U; - uint16_t colorTemperatureMaximumArgument = 255U; - uint8_t optionsMaskArgument = 0; - uint8_t optionsOverrideArgument = 0; - [cluster moveColorTemperature:moveModeArgument - rate:rateArgument - colorTemperatureMinimum:colorTemperatureMinimumArgument - colorTemperatureMaximum:colorTemperatureMaximumArgument - optionsMask:optionsMaskArgument - optionsOverride:optionsOverrideArgument - responseHandler:^(NSError * err, NSDictionary * values) { - NSLog(@"Stop Color Temperature command Error: %@", err); + [cluster readAttributeEnum16WithResponseHandler:^(NSError * err, NSDictionary * values) { + NSLog(@"Read attribute ENUM16 Min Value Error: %@", err); - XCTAssertEqual(err.code, 0); + XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; + XCTAssertEqual([values[@"value"] unsignedShortValue], 0U); + + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} +- (void)testSendClusterTestCluster_000088_ReadAttribute +{ + XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute OCTET_STRING Default Value"]; + + CHIPDevice * device = GetConnectedDevice(); + dispatch_queue_t queue = dispatch_get_main_queue(); + CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; + XCTAssertNotNil(cluster); + + [cluster readAttributeOctetStringWithResponseHandler:^(NSError * err, NSDictionary * values) { + NSLog(@"Read attribute OCTET_STRING Default Value Error: %@", err); + + XCTAssertEqual(err.code, 0); + + NSString * octetStringArgumentString = @""; + NSData * octetStringArgument = [octetStringArgumentString dataUsingEncoding:NSUTF8StringEncoding]; + XCTAssertTrue([values[@"value"] isEqualToData:octetStringArgument]); + + [expectation fulfill]; + }]; [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTest_TC_CC_6_2_000004_MoveColorTemperature +- (void)testSendClusterTestCluster_000089_WriteAttribute { - XCTestExpectation * expectation = [self expectationWithDescription:@"Move down color temperature command"]; + XCTestExpectation * expectation = [self expectationWithDescription:@"Write attribute OCTET_STRING"]; CHIPDevice * device = GetConnectedDevice(); dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; + CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; XCTAssertNotNil(cluster); - uint8_t moveModeArgument = 3; - uint16_t rateArgument = 20U; - uint16_t colorTemperatureMinimumArgument = 1U; - uint16_t colorTemperatureMaximumArgument = 255U; - uint8_t optionsMaskArgument = 0; - uint8_t optionsOverrideArgument = 0; - [cluster moveColorTemperature:moveModeArgument - rate:rateArgument - colorTemperatureMinimum:colorTemperatureMinimumArgument - colorTemperatureMaximum:colorTemperatureMaximumArgument - optionsMask:optionsMaskArgument - optionsOverride:optionsOverrideArgument - responseHandler:^(NSError * err, NSDictionary * values) { - NSLog(@"Move down color temperature command Error: %@", err); + NSString * octetStringArgumentString = @"TestValue"; + NSData * octetStringArgument = [octetStringArgumentString dataUsingEncoding:NSUTF8StringEncoding]; + [cluster writeAttributeOctetStringWithValue:octetStringArgument + responseHandler:^(NSError * err, NSDictionary * values) { + NSLog(@"Write attribute OCTET_STRING Error: %@", err); - XCTAssertEqual(err.code, 0); + XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; + [expectation fulfill]; + }]; [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTest_TC_CC_6_2_000005_Off +- (void)testSendClusterTestCluster_000090_ReadAttribute { - XCTestExpectation * expectation = [self expectationWithDescription:@"Turn off light that we turned on"]; + XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute OCTET_STRING"]; CHIPDevice * device = GetConnectedDevice(); dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:queue]; + CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; XCTAssertNotNil(cluster); - [cluster off:^(NSError * err, NSDictionary * values) { - NSLog(@"Turn off light that we turned on Error: %@", err); + [cluster readAttributeOctetStringWithResponseHandler:^(NSError * err, NSDictionary * values) { + NSLog(@"Read attribute OCTET_STRING Error: %@", err); XCTAssertEqual(err.code, 0); + NSString * octetStringArgumentString = @"TestValue"; + NSData * octetStringArgument = [octetStringArgumentString dataUsingEncoding:NSUTF8StringEncoding]; + XCTAssertTrue([values[@"value"] isEqualToData:octetStringArgument]); + [expectation fulfill]; }]; [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTest_TC_CC_6_2_000006_ReadAttribute +- (void)testSendClusterTestCluster_000091_WriteAttribute { - XCTestExpectation * expectation = [self expectationWithDescription:@"Check on/off attribute value is false after off command"]; + XCTestExpectation * expectation = [self expectationWithDescription:@"Write attribute OCTET_STRING"]; CHIPDevice * device = GetConnectedDevice(); dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:queue]; + CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; XCTAssertNotNil(cluster); - [cluster readAttributeOnOffWithResponseHandler:^(NSError * err, NSDictionary * values) { - NSLog(@"Check on/off attribute value is false after off command Error: %@", err); + NSString * octetStringArgumentString = @"TestValueLongerThan10"; + NSData * octetStringArgument = [octetStringArgumentString dataUsingEncoding:NSUTF8StringEncoding]; + [cluster writeAttributeOctetStringWithValue:octetStringArgument + responseHandler:^(NSError * err, NSDictionary * values) { + NSLog(@"Write attribute OCTET_STRING Error: %@", err); + + XCTAssertEqual(err.code, true); + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} +- (void)testSendClusterTestCluster_000092_ReadAttribute +{ + XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute OCTET_STRING"]; + + CHIPDevice * device = GetConnectedDevice(); + dispatch_queue_t queue = dispatch_get_main_queue(); + CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; + XCTAssertNotNil(cluster); + + [cluster readAttributeOctetStringWithResponseHandler:^(NSError * err, NSDictionary * values) { + NSLog(@"Read attribute OCTET_STRING Error: %@", err); XCTAssertEqual(err.code, 0); - XCTAssertEqual([values[@"value"] boolValue], 0); + NSString * octetStringArgumentString = @"TestValue"; + NSData * octetStringArgument = [octetStringArgumentString dataUsingEncoding:NSUTF8StringEncoding]; + XCTAssertTrue([values[@"value"] isEqualToData:octetStringArgument]); [expectation fulfill]; }]; [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } - -- (void)testSendClusterTest_TC_CC_6_3_000000_On +- (void)testSendClusterTestCluster_000093_WriteAttribute { - XCTestExpectation * expectation = [self expectationWithDescription:@"Turn on light for color control tests"]; + XCTestExpectation * expectation = [self expectationWithDescription:@"Write attribute OCTET_STRING"]; CHIPDevice * device = GetConnectedDevice(); dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:queue]; + CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; XCTAssertNotNil(cluster); - [cluster on:^(NSError * err, NSDictionary * values) { - NSLog(@"Turn on light for color control tests Error: %@", err); + NSString * octetStringArgumentString = @""; + NSData * octetStringArgument = [octetStringArgumentString dataUsingEncoding:NSUTF8StringEncoding]; + [cluster writeAttributeOctetStringWithValue:octetStringArgument + responseHandler:^(NSError * err, NSDictionary * values) { + NSLog(@"Write attribute OCTET_STRING Error: %@", err); - XCTAssertEqual(err.code, 0); + XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; + [expectation fulfill]; + }]; [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTest_TC_CC_6_3_000001_ReadAttribute +- (void)testSendClusterTestCluster_000094_ReadAttribute { - XCTestExpectation * expectation = [self expectationWithDescription:@"Check on/off attribute value is true after on command"]; + XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute LONG_OCTET_STRING Default Value"]; CHIPDevice * device = GetConnectedDevice(); dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:queue]; + CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; XCTAssertNotNil(cluster); - [cluster readAttributeOnOffWithResponseHandler:^(NSError * err, NSDictionary * values) { - NSLog(@"Check on/off attribute value is true after on command Error: %@", err); + [cluster readAttributeLongOctetStringWithResponseHandler:^(NSError * err, NSDictionary * values) { + NSLog(@"Read attribute LONG_OCTET_STRING Default Value Error: %@", err); XCTAssertEqual(err.code, 0); - XCTAssertEqual([values[@"value"] boolValue], 1); + NSString * longOctetStringArgumentString = @""; + NSData * longOctetStringArgument = [longOctetStringArgumentString dataUsingEncoding:NSUTF8StringEncoding]; + XCTAssertTrue([values[@"value"] isEqualToData:longOctetStringArgument]); [expectation fulfill]; }]; [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTest_TC_CC_6_3_000002_StepColorTemperature +- (void)testSendClusterTestCluster_000095_WriteAttribute { - XCTestExpectation * expectation = [self expectationWithDescription:@"Step up color temperature command"]; + XCTestExpectation * expectation = [self expectationWithDescription:@"Write attribute LONG_OCTET_STRING"]; CHIPDevice * device = GetConnectedDevice(); dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; + CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; XCTAssertNotNil(cluster); - 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; - [cluster stepColorTemperature:stepModeArgument - stepSize:stepSizeArgument - transitionTime:transitionTimeArgument - colorTemperatureMinimum:colorTemperatureMinimumArgument - colorTemperatureMaximum:colorTemperatureMaximumArgument - optionsMask:optionsMaskArgument - optionsOverride:optionsOverrideArgument - responseHandler:^(NSError * err, NSDictionary * values) { - NSLog(@"Step up color temperature command Error: %@", err); + NSString * longOctetStringArgumentString + = @"11111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111" + @"11111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111" + @"11111111111111111111111111111111111111111111111111111111111111"; + NSData * longOctetStringArgument = [longOctetStringArgumentString dataUsingEncoding:NSUTF8StringEncoding]; + [cluster writeAttributeLongOctetStringWithValue:longOctetStringArgument + responseHandler:^(NSError * err, NSDictionary * values) { + NSLog(@"Write attribute LONG_OCTET_STRING Error: %@", err); - XCTAssertEqual(err.code, 0); + XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; + [expectation fulfill]; + }]; [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTest_TC_CC_6_3_000003_StepColorTemperature +- (void)testSendClusterTestCluster_000096_ReadAttribute { - XCTestExpectation * expectation = [self expectationWithDescription:@"Step down color temperature command"]; + XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute LONG_OCTET_STRING"]; CHIPDevice * device = GetConnectedDevice(); dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; + CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; XCTAssertNotNil(cluster); - 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; - [cluster stepColorTemperature:stepModeArgument - stepSize:stepSizeArgument - transitionTime:transitionTimeArgument - colorTemperatureMinimum:colorTemperatureMinimumArgument - colorTemperatureMaximum:colorTemperatureMaximumArgument - optionsMask:optionsMaskArgument - optionsOverride:optionsOverrideArgument - responseHandler:^(NSError * err, NSDictionary * values) { - NSLog(@"Step down color temperature command Error: %@", err); + [cluster readAttributeLongOctetStringWithResponseHandler:^(NSError * err, NSDictionary * values) { + NSLog(@"Read attribute LONG_OCTET_STRING Error: %@", err); - XCTAssertEqual(err.code, 0); + XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; + NSString * longOctetStringArgumentString + = @"1111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111" + @"1111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111" + @"1111111111111111111111111111111111111111111111111111111111111111111111"; + NSData * longOctetStringArgument = [longOctetStringArgumentString dataUsingEncoding:NSUTF8StringEncoding]; + XCTAssertTrue([values[@"value"] isEqualToData:longOctetStringArgument]); + + [expectation fulfill]; + }]; [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTest_TC_CC_6_3_000004_Off +- (void)testSendClusterTestCluster_000097_WriteAttribute { - XCTestExpectation * expectation = [self expectationWithDescription:@"Turn off light that we turned on"]; + XCTestExpectation * expectation = [self expectationWithDescription:@"Write attribute LONG_OCTET_STRING"]; CHIPDevice * device = GetConnectedDevice(); dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:queue]; + CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; XCTAssertNotNil(cluster); - [cluster off:^(NSError * err, NSDictionary * values) { - NSLog(@"Turn off light that we turned on Error: %@", err); + NSString * longOctetStringArgumentString = @""; + NSData * longOctetStringArgument = [longOctetStringArgumentString dataUsingEncoding:NSUTF8StringEncoding]; + [cluster writeAttributeLongOctetStringWithValue:longOctetStringArgument + responseHandler:^(NSError * err, NSDictionary * values) { + NSLog(@"Write attribute LONG_OCTET_STRING Error: %@", err); - XCTAssertEqual(err.code, 0); + XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; + [expectation fulfill]; + }]; [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTest_TC_CC_6_3_000005_ReadAttribute +- (void)testSendClusterTestCluster_000098_ReadAttribute { - XCTestExpectation * expectation = [self expectationWithDescription:@"Check on/off attribute value is false after off command"]; + XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute CHAR_STRING Default Value"]; CHIPDevice * device = GetConnectedDevice(); dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:queue]; + CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; XCTAssertNotNil(cluster); - [cluster readAttributeOnOffWithResponseHandler:^(NSError * err, NSDictionary * values) { - NSLog(@"Check on/off attribute value is false after off command Error: %@", err); + [cluster readAttributeCharStringWithResponseHandler:^(NSError * err, NSDictionary * values) { + NSLog(@"Read attribute CHAR_STRING Default Value Error: %@", err); XCTAssertEqual(err.code, 0); - XCTAssertEqual([values[@"value"] boolValue], 0); + NSString * charStringArgument = @""; + XCTAssertTrue([values[@"value"] isEqualToString:charStringArgument]); [expectation fulfill]; }]; [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } - -- (void)testSendClusterTest_TC_CC_7_1_000000_On +- (void)testSendClusterTestCluster_000099_WriteAttribute { - XCTestExpectation * expectation = [self expectationWithDescription:@"Turn on light for color control tests"]; + XCTestExpectation * expectation = [self expectationWithDescription:@"Write attribute CHAR_STRING"]; CHIPDevice * device = GetConnectedDevice(); dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:queue]; + CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; XCTAssertNotNil(cluster); - [cluster on:^(NSError * err, NSDictionary * values) { - NSLog(@"Turn on light for color control tests Error: %@", err); + NSString * charStringArgument = @"☉T☉"; + [cluster writeAttributeCharStringWithValue:charStringArgument + responseHandler:^(NSError * err, NSDictionary * values) { + NSLog(@"Write attribute CHAR_STRING Error: %@", err); - XCTAssertEqual(err.code, 0); + XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; + [expectation fulfill]; + }]; [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTest_TC_CC_7_1_000001_ReadAttribute +- (void)testSendClusterTestCluster_000100_WriteAttribute { - XCTestExpectation * expectation = [self expectationWithDescription:@"Check on/off attribute value is true after on command"]; + XCTestExpectation * expectation = [self expectationWithDescription:@"Write attribute CHAR_STRING - Value too long"]; CHIPDevice * device = GetConnectedDevice(); dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:queue]; + CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; XCTAssertNotNil(cluster); - [cluster readAttributeOnOffWithResponseHandler:^(NSError * err, NSDictionary * values) { - NSLog(@"Check on/off attribute value is true after on command Error: %@", err); - - XCTAssertEqual(err.code, 0); - - XCTAssertEqual([values[@"value"] boolValue], 1); + NSString * charStringArgument = @"☉TestValueLongerThan10☉"; + [cluster writeAttributeCharStringWithValue:charStringArgument + responseHandler:^(NSError * err, NSDictionary * values) { + NSLog(@"Write attribute CHAR_STRING - Value too long Error: %@", err); - [expectation fulfill]; - }]; + XCTAssertEqual(err.code, true); + [expectation fulfill]; + }]; [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTest_TC_CC_7_1_000002_EnhancedMoveToHue +- (void)testSendClusterTestCluster_000101_WriteAttribute { - XCTestExpectation * expectation = [self expectationWithDescription:@"Enhanced Move To Hue command"]; + XCTestExpectation * expectation = [self expectationWithDescription:@"Write attribute CHAR_STRING - Empty"]; CHIPDevice * device = GetConnectedDevice(); dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; + CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; XCTAssertNotNil(cluster); - uint16_t enhancedHueArgument = 1025U; - uint8_t directionArgument = 0; - uint16_t transitionTimeArgument = 1U; - uint8_t optionsMaskArgument = 0; - uint8_t optionsOverrideArgument = 0; - [cluster enhancedMoveToHue:enhancedHueArgument - direction:directionArgument - transitionTime:transitionTimeArgument - optionsMask:optionsMaskArgument - optionsOverride:optionsOverrideArgument - responseHandler:^(NSError * err, NSDictionary * values) { - NSLog(@"Enhanced Move To Hue command Error: %@", err); + NSString * charStringArgument = @""; + [cluster writeAttributeCharStringWithValue:charStringArgument + responseHandler:^(NSError * err, NSDictionary * values) { + NSLog(@"Write attribute CHAR_STRING - Empty Error: %@", err); - XCTAssertEqual(err.code, 0); + XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; + [expectation fulfill]; + }]; [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTest_TC_CC_7_1_000003_ReadAttribute +- (void)testSendClusterTestCluster_000102_ReadAttribute { - XCTestExpectation * expectation = - [self expectationWithDescription:@"Check Remaining time attribute value matched the value sent by the last command"]; + XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute LONG_CHAR_STRING Default Value"]; CHIPDevice * device = GetConnectedDevice(); dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; + CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; XCTAssertNotNil(cluster); - [cluster readAttributeRemainingTimeWithResponseHandler:^(NSError * err, NSDictionary * values) { - NSLog(@"Check Remaining time attribute value matched the value sent by the last command Error: %@", err); + [cluster readAttributeLongCharStringWithResponseHandler:^(NSError * err, NSDictionary * values) { + NSLog(@"Read attribute LONG_CHAR_STRING Default Value Error: %@", err); XCTAssertEqual(err.code, 0); - XCTAssertEqual([values[@"value"] unsignedShortValue], 1U); + NSString * longCharStringArgument = @""; + XCTAssertTrue([values[@"value"] isEqualToString:longCharStringArgument]); [expectation fulfill]; }]; [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTest_TC_CC_7_1_000004_Off +- (void)testSendClusterTestCluster_000103_WriteAttribute { - XCTestExpectation * expectation = [self expectationWithDescription:@"Turn off light that we turned on"]; + XCTestExpectation * expectation = [self expectationWithDescription:@"Write attribute LONG_CHAR_STRING"]; CHIPDevice * device = GetConnectedDevice(); dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:queue]; + CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; XCTAssertNotNil(cluster); - [cluster off:^(NSError * err, NSDictionary * values) { - NSLog(@"Turn off light that we turned on Error: %@", err); + NSString * longCharStringArgument + = @"☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉" + @"☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉" + @"☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉"; + [cluster writeAttributeLongCharStringWithValue:longCharStringArgument + responseHandler:^(NSError * err, NSDictionary * values) { + NSLog(@"Write attribute LONG_CHAR_STRING Error: %@", err); - XCTAssertEqual(err.code, 0); + XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; + [expectation fulfill]; + }]; [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTest_TC_CC_7_1_000005_ReadAttribute +- (void)testSendClusterTestCluster_000104_ReadAttribute { - XCTestExpectation * expectation = [self expectationWithDescription:@"Check on/off attribute value is false after off command"]; + XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute LONG_CHAR_STRING"]; CHIPDevice * device = GetConnectedDevice(); dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:queue]; + CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; XCTAssertNotNil(cluster); - [cluster readAttributeOnOffWithResponseHandler:^(NSError * err, NSDictionary * values) { - NSLog(@"Check on/off attribute value is false after off command Error: %@", err); + [cluster readAttributeLongCharStringWithResponseHandler:^(NSError * err, NSDictionary * values) { + NSLog(@"Read attribute LONG_CHAR_STRING Error: %@", err); XCTAssertEqual(err.code, 0); - XCTAssertEqual([values[@"value"] boolValue], 0); + NSString * longCharStringArgument + = @"☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉" + @"☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉" + @"☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉"; + XCTAssertTrue([values[@"value"] isEqualToString:longCharStringArgument]); [expectation fulfill]; }]; [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } - -- (void)testSendClusterTest_TC_CC_7_2_000000_On +- (void)testSendClusterTestCluster_000105_WriteAttribute { - XCTestExpectation * expectation = [self expectationWithDescription:@"Turn on light for color control tests"]; + XCTestExpectation * expectation = [self expectationWithDescription:@"Write attribute LONG_CHAR_STRING"]; CHIPDevice * device = GetConnectedDevice(); dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:queue]; + CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; XCTAssertNotNil(cluster); - [cluster on:^(NSError * err, NSDictionary * values) { - NSLog(@"Turn on light for color control tests Error: %@", err); + NSString * longCharStringArgument = @""; + [cluster writeAttributeLongCharStringWithValue:longCharStringArgument + responseHandler:^(NSError * err, NSDictionary * values) { + NSLog(@"Write attribute LONG_CHAR_STRING Error: %@", err); - XCTAssertEqual(err.code, 0); + XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; + [expectation fulfill]; + }]; [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTest_TC_CC_7_2_000001_ReadAttribute +- (void)testSendClusterTestCluster_000106_ReadAttribute { - XCTestExpectation * expectation = [self expectationWithDescription:@"Check on/off attribute value is true after on command"]; + XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute LIST"]; CHIPDevice * device = GetConnectedDevice(); dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:queue]; + CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; XCTAssertNotNil(cluster); - [cluster readAttributeOnOffWithResponseHandler:^(NSError * err, NSDictionary * values) { - NSLog(@"Check on/off attribute value is true after on command Error: %@", err); + [cluster readAttributeListInt8uWithResponseHandler:^(NSError * err, NSDictionary * values) { + NSLog(@"Read attribute LIST Error: %@", err); XCTAssertEqual(err.code, 0); - XCTAssertEqual([values[@"value"] boolValue], 1); + XCTAssertEqual([values[@"value"] count], 4); [expectation fulfill]; }]; [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTest_TC_CC_7_2_000002_EnhancedMoveHue +- (void)testSendClusterTestCluster_000107_ReadAttribute { - XCTestExpectation * expectation = [self expectationWithDescription:@"Enhanced Move Hue Down command "]; + XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute LIST_OCTET_STRING"]; CHIPDevice * device = GetConnectedDevice(); dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; + CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; XCTAssertNotNil(cluster); - uint8_t moveModeArgument = 3; - uint16_t rateArgument = 5U; - uint8_t optionsMaskArgument = 0; - uint8_t optionsOverrideArgument = 0; - [cluster enhancedMoveHue:moveModeArgument - rate:rateArgument - optionsMask:optionsMaskArgument - optionsOverride:optionsOverrideArgument - responseHandler:^(NSError * err, NSDictionary * values) { - NSLog(@"Enhanced Move Hue Down command Error: %@", err); - - XCTAssertEqual(err.code, 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_CC_7_2_000003_EnhancedMoveHue -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Enhanced Move Hue Stop command"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); + [cluster readAttributeListOctetStringWithResponseHandler:^(NSError * err, NSDictionary * values) { + NSLog(@"Read attribute LIST_OCTET_STRING Error: %@", err); - uint8_t moveModeArgument = 0; - uint16_t rateArgument = 0U; - uint8_t optionsMaskArgument = 0; - uint8_t optionsOverrideArgument = 0; - [cluster enhancedMoveHue:moveModeArgument - rate:rateArgument - optionsMask:optionsMaskArgument - optionsOverride:optionsOverrideArgument - responseHandler:^(NSError * err, NSDictionary * values) { - NSLog(@"Enhanced Move Hue Stop command Error: %@", err); + XCTAssertEqual(err.code, 0); - XCTAssertEqual(err.code, 0); + XCTAssertEqual([values[@"value"] count], 4); - [expectation fulfill]; - }]; + [expectation fulfill]; + }]; [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTest_TC_CC_7_2_000004_EnhancedMoveHue +- (void)testSendClusterTestCluster_000108_ReadAttribute { - XCTestExpectation * expectation = [self expectationWithDescription:@"Enhanced Move Hue Up command"]; + XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute LIST_STRUCT_OCTET_STRING"]; CHIPDevice * device = GetConnectedDevice(); dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; + CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; XCTAssertNotNil(cluster); - uint8_t moveModeArgument = 1; - uint16_t rateArgument = 50U; - uint8_t optionsMaskArgument = 0; - uint8_t optionsOverrideArgument = 0; - [cluster enhancedMoveHue:moveModeArgument - rate:rateArgument - optionsMask:optionsMaskArgument - optionsOverride:optionsOverrideArgument - responseHandler:^(NSError * err, NSDictionary * values) { - NSLog(@"Enhanced Move Hue Up command Error: %@", err); + [cluster readAttributeListStructOctetStringWithResponseHandler:^(NSError * err, NSDictionary * values) { + NSLog(@"Read attribute LIST_STRUCT_OCTET_STRING Error: %@", err); - XCTAssertEqual(err.code, 0); + XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; + XCTAssertEqual([values[@"value"] count], 4); + + [expectation fulfill]; + }]; [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTest_TC_CC_7_2_000005_EnhancedMoveHue +- (void)testSendClusterTestCluster_000109_ReadAttribute { - XCTestExpectation * expectation = [self expectationWithDescription:@"Enhanced Move Hue Stop command"]; + XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute EPOCH_US Default Value"]; CHIPDevice * device = GetConnectedDevice(); dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; + CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; XCTAssertNotNil(cluster); - uint8_t moveModeArgument = 0; - uint16_t rateArgument = 0U; - uint8_t optionsMaskArgument = 0; - uint8_t optionsOverrideArgument = 0; - [cluster enhancedMoveHue:moveModeArgument - rate:rateArgument - optionsMask:optionsMaskArgument - optionsOverride:optionsOverrideArgument - responseHandler:^(NSError * err, NSDictionary * values) { - NSLog(@"Enhanced Move Hue Stop command Error: %@", err); + [cluster readAttributeEpochUsWithResponseHandler:^(NSError * err, NSDictionary * values) { + NSLog(@"Read attribute EPOCH_US Default Value Error: %@", err); - XCTAssertEqual(err.code, 0); + XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; + XCTAssertEqual([values[@"value"] unsignedLongLongValue], 0ULL); + + [expectation fulfill]; + }]; [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTest_TC_CC_7_2_000006_Off +- (void)testSendClusterTestCluster_000110_WriteAttribute { - XCTestExpectation * expectation = [self expectationWithDescription:@"Turn off light that we turned on"]; + XCTestExpectation * expectation = [self expectationWithDescription:@"Write attribute EPOCH_US Max Value"]; CHIPDevice * device = GetConnectedDevice(); dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:queue]; + CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; XCTAssertNotNil(cluster); - [cluster off:^(NSError * err, NSDictionary * values) { - NSLog(@"Turn off light that we turned on Error: %@", err); + uint64_t epochUsArgument = 18446744073709551615ULL; + [cluster writeAttributeEpochUsWithValue:epochUsArgument + responseHandler:^(NSError * err, NSDictionary * values) { + NSLog(@"Write attribute EPOCH_US Max Value Error: %@", err); - XCTAssertEqual(err.code, 0); + XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; + [expectation fulfill]; + }]; [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTest_TC_CC_7_2_000007_ReadAttribute +- (void)testSendClusterTestCluster_000111_ReadAttribute { - XCTestExpectation * expectation = [self expectationWithDescription:@"Check on/off attribute value is false after off command"]; + XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute EPOCH_US Max Value"]; CHIPDevice * device = GetConnectedDevice(); dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:queue]; + CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; XCTAssertNotNil(cluster); - [cluster readAttributeOnOffWithResponseHandler:^(NSError * err, NSDictionary * values) { - NSLog(@"Check on/off attribute value is false after off command Error: %@", err); + [cluster readAttributeEpochUsWithResponseHandler:^(NSError * err, NSDictionary * values) { + NSLog(@"Read attribute EPOCH_US Max Value Error: %@", err); XCTAssertEqual(err.code, 0); - XCTAssertEqual([values[@"value"] boolValue], 0); + XCTAssertEqual([values[@"value"] unsignedLongLongValue], 18446744073709551615ULL); [expectation fulfill]; }]; [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } - -- (void)testSendClusterTest_TC_CC_7_3_000000_On +- (void)testSendClusterTestCluster_000112_WriteAttribute { - XCTestExpectation * expectation = [self expectationWithDescription:@"Turn on light for color control tests"]; + XCTestExpectation * expectation = [self expectationWithDescription:@"Write attribute EPOCH_US Min Value"]; CHIPDevice * device = GetConnectedDevice(); dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:queue]; + CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; XCTAssertNotNil(cluster); - [cluster on:^(NSError * err, NSDictionary * values) { - NSLog(@"Turn on light for color control tests Error: %@", err); + uint64_t epochUsArgument = 0ULL; + [cluster writeAttributeEpochUsWithValue:epochUsArgument + responseHandler:^(NSError * err, NSDictionary * values) { + NSLog(@"Write attribute EPOCH_US Min Value Error: %@", err); - XCTAssertEqual(err.code, 0); + XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; + [expectation fulfill]; + }]; [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTest_TC_CC_7_3_000001_ReadAttribute +- (void)testSendClusterTestCluster_000113_ReadAttribute { - XCTestExpectation * expectation = [self expectationWithDescription:@"Check on/off attribute value is true after on command"]; + XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute EPOCH_US Min Value"]; CHIPDevice * device = GetConnectedDevice(); dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:queue]; + CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; XCTAssertNotNil(cluster); - [cluster readAttributeOnOffWithResponseHandler:^(NSError * err, NSDictionary * values) { - NSLog(@"Check on/off attribute value is true after on command Error: %@", err); + [cluster readAttributeEpochUsWithResponseHandler:^(NSError * err, NSDictionary * values) { + NSLog(@"Read attribute EPOCH_US Min Value Error: %@", err); XCTAssertEqual(err.code, 0); - XCTAssertEqual([values[@"value"] boolValue], 1); + XCTAssertEqual([values[@"value"] unsignedLongLongValue], 0ULL); [expectation fulfill]; }]; [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTest_TC_CC_7_3_000002_EnhancedStepHue +- (void)testSendClusterTestCluster_000114_ReadAttribute { - XCTestExpectation * expectation = [self expectationWithDescription:@"Enhanced Step Hue Up command"]; + XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute EPOCH_S Default Value"]; CHIPDevice * device = GetConnectedDevice(); dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; + CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; XCTAssertNotNil(cluster); - uint8_t stepModeArgument = 0; - uint16_t stepSizeArgument = 50U; - uint16_t transitionTimeArgument = 1U; - uint8_t optionsMaskArgument = 0; - uint8_t optionsOverrideArgument = 0; - [cluster enhancedStepHue:stepModeArgument - stepSize:stepSizeArgument - transitionTime:transitionTimeArgument - optionsMask:optionsMaskArgument - optionsOverride:optionsOverrideArgument - responseHandler:^(NSError * err, NSDictionary * values) { - NSLog(@"Enhanced Step Hue Up command Error: %@", err); + [cluster readAttributeEpochSWithResponseHandler:^(NSError * err, NSDictionary * values) { + NSLog(@"Read attribute EPOCH_S Default Value Error: %@", err); - XCTAssertEqual(err.code, 0); + XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; + XCTAssertEqual([values[@"value"] unsignedLongValue], 0UL); + + [expectation fulfill]; + }]; [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTest_TC_CC_7_3_000003_EnhancedStepHue +- (void)testSendClusterTestCluster_000115_WriteAttribute { - XCTestExpectation * expectation = [self expectationWithDescription:@"Enhanced Step Hue Down command"]; + XCTestExpectation * expectation = [self expectationWithDescription:@"Write attribute EPOCH_S Max Value"]; CHIPDevice * device = GetConnectedDevice(); dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; + CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; XCTAssertNotNil(cluster); - uint8_t stepModeArgument = 1; - uint16_t stepSizeArgument = 75U; - uint16_t transitionTimeArgument = 1U; - uint8_t optionsMaskArgument = 0; - uint8_t optionsOverrideArgument = 0; - [cluster enhancedStepHue:stepModeArgument - stepSize:stepSizeArgument - transitionTime:transitionTimeArgument - optionsMask:optionsMaskArgument - optionsOverride:optionsOverrideArgument - responseHandler:^(NSError * err, NSDictionary * values) { - NSLog(@"Enhanced Step Hue Down command Error: %@", err); + uint32_t epochSArgument = 4294967295UL; + [cluster writeAttributeEpochSWithValue:epochSArgument + responseHandler:^(NSError * err, NSDictionary * values) { + NSLog(@"Write attribute EPOCH_S Max Value Error: %@", err); - XCTAssertEqual(err.code, 0); + XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; + [expectation fulfill]; + }]; [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTest_TC_CC_7_3_000004_Off +- (void)testSendClusterTestCluster_000116_ReadAttribute { - XCTestExpectation * expectation = [self expectationWithDescription:@"Turn off light that we turned on"]; + XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute EPOCH_S Max Value"]; CHIPDevice * device = GetConnectedDevice(); dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:queue]; + CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; XCTAssertNotNil(cluster); - [cluster off:^(NSError * err, NSDictionary * values) { - NSLog(@"Turn off light that we turned on Error: %@", err); + [cluster readAttributeEpochSWithResponseHandler:^(NSError * err, NSDictionary * values) { + NSLog(@"Read attribute EPOCH_S Max Value Error: %@", err); XCTAssertEqual(err.code, 0); + XCTAssertEqual([values[@"value"] unsignedLongValue], 4294967295UL); + [expectation fulfill]; }]; [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTest_TC_CC_7_3_000005_ReadAttribute +- (void)testSendClusterTestCluster_000117_WriteAttribute { - XCTestExpectation * expectation = [self expectationWithDescription:@"Check on/off attribute value is false after off command"]; + XCTestExpectation * expectation = [self expectationWithDescription:@"Write attribute EPOCH_S Min Value"]; CHIPDevice * device = GetConnectedDevice(); dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:queue]; + CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; XCTAssertNotNil(cluster); - [cluster readAttributeOnOffWithResponseHandler:^(NSError * err, NSDictionary * values) { - NSLog(@"Check on/off attribute value is false after off command Error: %@", err); - - XCTAssertEqual(err.code, 0); + uint32_t epochSArgument = 0UL; + [cluster writeAttributeEpochSWithValue:epochSArgument + responseHandler:^(NSError * err, NSDictionary * values) { + NSLog(@"Write attribute EPOCH_S Min Value Error: %@", err); - XCTAssertEqual([values[@"value"] boolValue], 0); + XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; + [expectation fulfill]; + }]; [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } - -- (void)testSendClusterTest_TC_CC_7_4_000000_On +- (void)testSendClusterTestCluster_000118_ReadAttribute { - XCTestExpectation * expectation = [self expectationWithDescription:@"Turn on light for color control tests"]; + XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute EPOCH_S Min Value"]; CHIPDevice * device = GetConnectedDevice(); dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:queue]; + CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; XCTAssertNotNil(cluster); - [cluster on:^(NSError * err, NSDictionary * values) { - NSLog(@"Turn on light for color control tests Error: %@", err); + [cluster readAttributeEpochSWithResponseHandler:^(NSError * err, NSDictionary * values) { + NSLog(@"Read attribute EPOCH_S Min Value Error: %@", err); XCTAssertEqual(err.code, 0); + XCTAssertEqual([values[@"value"] unsignedLongValue], 0UL); + [expectation fulfill]; }]; [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTest_TC_CC_7_4_000001_ReadAttribute +- (void)testSendClusterTestCluster_000119_ReadAttribute { - XCTestExpectation * expectation = [self expectationWithDescription:@"Check on/off attribute value is true after on command"]; + XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute UNSUPPORTED"]; CHIPDevice * device = GetConnectedDevice(); dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:queue]; + CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; XCTAssertNotNil(cluster); - [cluster readAttributeOnOffWithResponseHandler:^(NSError * err, NSDictionary * values) { - NSLog(@"Check on/off attribute value is true after on command Error: %@", err); + [cluster readAttributeUnsupportedWithResponseHandler:^(NSError * err, NSDictionary * values) { + NSLog(@"Read attribute UNSUPPORTED Error: %@", err); + + if (err.code == CHIPErrorCodeUnsupportedAttribute) { + [expectation fulfill]; + return; + } XCTAssertEqual(err.code, 0); - XCTAssertEqual([values[@"value"] boolValue], 1); + XCTAssertEqual([values[@"value"] boolValue], 0); [expectation fulfill]; }]; [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTest_TC_CC_7_4_000002_EnhancedMoveToHueAndSaturation +- (void)testSendClusterTestCluster_000120_WriteAttribute { - XCTestExpectation * expectation = [self expectationWithDescription:@"Enhanced move to hue and saturation command"]; + XCTestExpectation * expectation = [self expectationWithDescription:@"Writeattribute UNSUPPORTED"]; CHIPDevice * device = GetConnectedDevice(); dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; + CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; XCTAssertNotNil(cluster); - uint16_t enhancedHueArgument = 1200U; - uint8_t saturationArgument = 90; - uint16_t transitionTimeArgument = 10U; - uint8_t optionsMaskArgument = 0; - uint8_t optionsOverrideArgument = 0; - [cluster enhancedMoveToHueAndSaturation:enhancedHueArgument - saturation:saturationArgument - transitionTime:transitionTimeArgument - optionsMask:optionsMaskArgument - optionsOverride:optionsOverrideArgument - responseHandler:^(NSError * err, NSDictionary * values) { - NSLog(@"Enhanced move to hue and saturation command Error: %@", err); - - XCTAssertEqual(err.code, 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_CC_7_4_000003_Off -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Turn off light that we turned on"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); + bool unsupportedArgument = 0; + [cluster writeAttributeUnsupportedWithValue:unsupportedArgument + responseHandler:^(NSError * err, NSDictionary * values) { + NSLog(@"Writeattribute UNSUPPORTED Error: %@", err); - [cluster off:^(NSError * err, NSDictionary * values) { - NSLog(@"Turn off light that we turned on Error: %@", err); + if (err.code == CHIPErrorCodeUnsupportedAttribute) { + [expectation fulfill]; + return; + } - XCTAssertEqual(err.code, 0); + XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; + [expectation fulfill]; + }]; [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTest_TC_CC_7_4_000004_ReadAttribute +- (void)testSendClusterTestCluster_000121_Test { - XCTestExpectation * expectation = [self expectationWithDescription:@"Check on/off attribute value is false after off command"]; + XCTestExpectation * expectation = [self expectationWithDescription:@"Send Test Command to unsupported endpoint"]; CHIPDevice * device = GetConnectedDevice(); dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:queue]; + CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:200 queue:queue]; XCTAssertNotNil(cluster); - [cluster readAttributeOnOffWithResponseHandler:^(NSError * err, NSDictionary * values) { - NSLog(@"Check on/off attribute value is false after off command Error: %@", err); - - XCTAssertEqual(err.code, 0); - - XCTAssertEqual([values[@"value"] boolValue], 0); + [cluster test:^(NSError * err, NSDictionary * values) { + NSLog(@"Send Test Command to unsupported endpoint Error: %@", err); + XCTAssertEqual(err.code, 1); [expectation fulfill]; }]; [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTest_TC_CC_8_1_000000_On +- (void)testSendClusterTestConstraints_000000_WriteAttribute { - XCTestExpectation * expectation = [self expectationWithDescription:@"Turn on light for color control tests"]; + XCTestExpectation * expectation = [self expectationWithDescription:@"Write attribute INT32U Value"]; CHIPDevice * device = GetConnectedDevice(); dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:queue]; + CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; XCTAssertNotNil(cluster); - [cluster on:^(NSError * err, NSDictionary * values) { - NSLog(@"Turn on light for color control tests Error: %@", err); + uint32_t int32uArgument = 5UL; + [cluster writeAttributeInt32uWithValue:int32uArgument + responseHandler:^(NSError * err, NSDictionary * values) { + NSLog(@"Write attribute INT32U Value Error: %@", err); - XCTAssertEqual(err.code, 0); + XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; + [expectation fulfill]; + }]; [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTest_TC_CC_8_1_000001_ReadAttribute +- (void)testSendClusterTestConstraints_000001_ReadAttribute { - XCTestExpectation * expectation = [self expectationWithDescription:@"Check on/off attribute value is true after on command"]; + XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute INT32U Value MinValue Constraints"]; CHIPDevice * device = GetConnectedDevice(); dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:queue]; + CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; XCTAssertNotNil(cluster); - [cluster readAttributeOnOffWithResponseHandler:^(NSError * err, NSDictionary * values) { - NSLog(@"Check on/off attribute value is true after on command Error: %@", err); + [cluster readAttributeInt32uWithResponseHandler:^(NSError * err, NSDictionary * values) { + NSLog(@"Read attribute INT32U Value MinValue Constraints Error: %@", err); XCTAssertEqual(err.code, 0); - XCTAssertEqual([values[@"value"] boolValue], 1); + XCTAssertGreaterThanOrEqual([values[@"value"] unsignedLongValue], 5); [expectation fulfill]; }]; [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTest_TC_CC_8_1_000002_ColorLoopSet +- (void)testSendClusterTestConstraints_000002_ReadAttribute { - XCTestExpectation * expectation = [self expectationWithDescription:@"Color Loop Set Command - Set all Attributs"]; + XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute INT32U Value MaxValue Constraints"]; CHIPDevice * device = GetConnectedDevice(); dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; + CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; XCTAssertNotNil(cluster); - 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; - [cluster colorLoopSet:updateFlagsArgument - action:actionArgument - direction:directionArgument - time:timeArgument - startHue:startHueArgument - optionsMask:optionsMaskArgument - optionsOverride:optionsOverrideArgument - responseHandler:^(NSError * err, NSDictionary * values) { - NSLog(@"Color Loop Set Command - Set all Attributs Error: %@", err); + [cluster readAttributeInt32uWithResponseHandler:^(NSError * err, NSDictionary * values) { + NSLog(@"Read attribute INT32U Value MaxValue Constraints Error: %@", err); - XCTAssertEqual(err.code, 0); + XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; + XCTAssertLessThanOrEqual([values[@"value"] unsignedLongValue], 5); + + [expectation fulfill]; + }]; [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTest_TC_CC_8_1_000003_ReadAttribute +- (void)testSendClusterTestConstraints_000003_ReadAttribute { - XCTestExpectation * expectation = [self expectationWithDescription:@"Check ColorLoopDirection Value"]; + XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute INT32U Value NotValue Constraints"]; CHIPDevice * device = GetConnectedDevice(); dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; + CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; XCTAssertNotNil(cluster); - [cluster readAttributeColorLoopDirectionWithResponseHandler:^(NSError * err, NSDictionary * values) { - NSLog(@"Check ColorLoopDirection Value Error: %@", err); + [cluster readAttributeInt32uWithResponseHandler:^(NSError * err, NSDictionary * values) { + NSLog(@"Read attribute INT32U Value NotValue Constraints Error: %@", err); XCTAssertEqual(err.code, 0); - XCTAssertEqual([values[@"value"] unsignedCharValue], 1); + XCTAssertNotEqual([values[@"value"] unsignedLongValue], 6); [expectation fulfill]; }]; [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTest_TC_CC_8_1_000004_ReadAttribute + +- (void)testSendClusterTestDelayCommands_000000_WaitForMs { - XCTestExpectation * expectation = [self expectationWithDescription:@"Check ColorLoopTime Value"]; + XCTestExpectation * expectation = [self expectationWithDescription:@"Wait 100ms"]; + + dispatch_queue_t queue = dispatch_get_main_queue(); + WaitForMs(expectation, queue, 100); + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} + +- (void)testSendClusterTestDescriptorCluster_000000_ReadAttribute +{ + XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute Device list"]; CHIPDevice * device = GetConnectedDevice(); dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; + CHIPTestDescriptor * cluster = [[CHIPTestDescriptor alloc] initWithDevice:device endpoint:0 queue:queue]; XCTAssertNotNil(cluster); - [cluster readAttributeColorLoopTimeWithResponseHandler:^(NSError * err, NSDictionary * values) { - NSLog(@"Check ColorLoopTime Value Error: %@", err); + [cluster readAttributeDeviceListWithResponseHandler:^(NSError * err, NSDictionary * values) { + NSLog(@"Read attribute Device list Error: %@", err); XCTAssertEqual(err.code, 0); - XCTAssertEqual([values[@"value"] unsignedShortValue], 100U); + XCTAssertEqual([values[@"value"] count], 1); [expectation fulfill]; }]; [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTest_TC_CC_8_1_000005_ReadAttribute +- (void)testSendClusterTestDescriptorCluster_000001_ReadAttribute { - XCTestExpectation * expectation = [self expectationWithDescription:@"Check ColorLoopStartEnhancedHue Value"]; + XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute Server list"]; CHIPDevice * device = GetConnectedDevice(); dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; + CHIPTestDescriptor * cluster = [[CHIPTestDescriptor alloc] initWithDevice:device endpoint:0 queue:queue]; XCTAssertNotNil(cluster); - [cluster readAttributeColorLoopStartEnhancedHueWithResponseHandler:^(NSError * err, NSDictionary * values) { - NSLog(@"Check ColorLoopStartEnhancedHue Value Error: %@", err); + [cluster readAttributeServerListWithResponseHandler:^(NSError * err, NSDictionary * values) { + NSLog(@"Read attribute Server list Error: %@", err); XCTAssertEqual(err.code, 0); - XCTAssertEqual([values[@"value"] unsignedShortValue], 500U); + XCTAssertEqual([values[@"value"] count], 18); [expectation fulfill]; }]; [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTest_TC_CC_8_1_000006_ReadAttribute +- (void)testSendClusterTestDescriptorCluster_000002_ReadAttribute { - XCTestExpectation * expectation = [self expectationWithDescription:@"Check ColorLoopActive Value"]; + XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute Client list"]; CHIPDevice * device = GetConnectedDevice(); dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; + CHIPTestDescriptor * cluster = [[CHIPTestDescriptor alloc] initWithDevice:device endpoint:0 queue:queue]; XCTAssertNotNil(cluster); - [cluster readAttributeColorLoopActiveWithResponseHandler:^(NSError * err, NSDictionary * values) { - NSLog(@"Check ColorLoopActive Value Error: %@", err); + [cluster readAttributeClientListWithResponseHandler:^(NSError * err, NSDictionary * values) { + NSLog(@"Read attribute Client list Error: %@", err); XCTAssertEqual(err.code, 0); - XCTAssertEqual([values[@"value"] unsignedCharValue], 0); + XCTAssertEqual([values[@"value"] count], 0); [expectation fulfill]; }]; [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTest_TC_CC_8_1_000007_ColorLoopSet +- (void)testSendClusterTestDescriptorCluster_000003_ReadAttribute { - XCTestExpectation * expectation = [self expectationWithDescription:@"Color Loop Set Command - Start Color Loop"]; + XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute Parts list"]; CHIPDevice * device = GetConnectedDevice(); dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; + CHIPTestDescriptor * cluster = [[CHIPTestDescriptor alloc] initWithDevice:device endpoint:0 queue:queue]; XCTAssertNotNil(cluster); - 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; - [cluster colorLoopSet:updateFlagsArgument - action:actionArgument - direction:directionArgument - time:timeArgument - startHue:startHueArgument - optionsMask:optionsMaskArgument - optionsOverride:optionsOverrideArgument - responseHandler:^(NSError * err, NSDictionary * values) { - NSLog(@"Color Loop Set Command - Start Color Loop Error: %@", err); + [cluster readAttributePartsListWithResponseHandler:^(NSError * err, NSDictionary * values) { + NSLog(@"Read attribute Parts list Error: %@", err); - XCTAssertEqual(err.code, 0); + XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; + XCTAssertEqual([values[@"value"] count], 2); + + [expectation fulfill]; + }]; [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTest_TC_CC_8_1_000008_ReadAttribute + +- (void)testSendClusterTestOperationalCredentialsCluster_000000_ReadAttribute { - XCTestExpectation * expectation = [self expectationWithDescription:@"Check ColorLoopActive Value"]; + XCTestExpectation * expectation = [self expectationWithDescription:@"Read number of supported fabrics"]; CHIPDevice * device = GetConnectedDevice(); dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; + CHIPTestOperationalCredentials * cluster = [[CHIPTestOperationalCredentials alloc] initWithDevice:device + endpoint:0 + queue:queue]; XCTAssertNotNil(cluster); - [cluster readAttributeColorLoopActiveWithResponseHandler:^(NSError * err, NSDictionary * values) { - NSLog(@"Check ColorLoopActive Value Error: %@", err); + [cluster readAttributeSupportedFabricsWithResponseHandler:^(NSError * err, NSDictionary * values) { + NSLog(@"Read number of supported fabrics Error: %@", err); XCTAssertEqual(err.code, 0); - XCTAssertEqual([values[@"value"] unsignedCharValue], 1); + XCTAssertGreaterThanOrEqual([values[@"value"] unsignedCharValue], 4); [expectation fulfill]; }]; [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTest_TC_CC_8_1_000009_ColorLoopSet +- (void)testSendClusterTestOperationalCredentialsCluster_000001_ReadAttribute { - XCTestExpectation * expectation = - [self expectationWithDescription:@"Color Loop Set Command - Set direction and time while running"]; + XCTestExpectation * expectation = [self expectationWithDescription:@"Read number of commissioned fabrics"]; CHIPDevice * device = GetConnectedDevice(); dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; + CHIPTestOperationalCredentials * cluster = [[CHIPTestOperationalCredentials alloc] initWithDevice:device + endpoint:0 + queue:queue]; XCTAssertNotNil(cluster); - 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; - [cluster colorLoopSet:updateFlagsArgument - action:actionArgument - direction:directionArgument - time:timeArgument - startHue:startHueArgument - optionsMask:optionsMaskArgument - optionsOverride:optionsOverrideArgument - responseHandler:^(NSError * err, NSDictionary * values) { - NSLog(@"Color Loop Set Command - Set direction and time while running Error: %@", err); + [cluster readAttributeCommissionedFabricsWithResponseHandler:^(NSError * err, NSDictionary * values) { + NSLog(@"Read number of commissioned fabrics Error: %@", err); - XCTAssertEqual(err.code, 0); + XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; + XCTAssertGreaterThanOrEqual([values[@"value"] unsignedCharValue], 1); + + [expectation fulfill]; + }]; [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTest_TC_CC_8_1_000010_ReadAttribute + +- (void)testSendClusterTestSubscribe_OnOff_000000_Off { - XCTestExpectation * expectation = [self expectationWithDescription:@"Check ColorLoopDirection Value"]; + XCTestExpectation * expectation = [self expectationWithDescription:@"Set OnOff Attribute to false"]; CHIPDevice * device = GetConnectedDevice(); dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; + CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:queue]; XCTAssertNotNil(cluster); - [cluster readAttributeColorLoopDirectionWithResponseHandler:^(NSError * err, NSDictionary * values) { - NSLog(@"Check ColorLoopDirection Value Error: %@", err); + [cluster off:^(NSError * err, NSDictionary * values) { + NSLog(@"Set OnOff Attribute to false Error: %@", err); XCTAssertEqual(err.code, 0); - XCTAssertEqual([values[@"value"] unsignedCharValue], 0); - [expectation fulfill]; }]; [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTest_TC_CC_8_1_000011_ReadAttribute +bool testSendClusterTestSubscribe_OnOff_000001_WaitForReport_Fulfilled = false; +- (void)testSendClusterTestSubscribe_OnOff_000001_WaitForReport { - XCTestExpectation * expectation = [self expectationWithDescription:@"Check ColorLoopTime Value"]; CHIPDevice * device = GetConnectedDevice(); dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; + CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:queue]; XCTAssertNotNil(cluster); - [cluster readAttributeColorLoopTimeWithResponseHandler:^(NSError * err, NSDictionary * values) { - NSLog(@"Check ColorLoopTime Value Error: %@", err); + [cluster reportAttributeOnOffWithResponseHandler:^(NSError * err, NSDictionary * values) { + NSLog(@"Report: Subscribe OnOff Attribute Error: %@", err); XCTAssertEqual(err.code, 0); - XCTAssertEqual([values[@"value"] unsignedShortValue], 3500U); + XCTAssertEqual([values[@"value"] boolValue], false); - [expectation fulfill]; + testSendClusterTestSubscribe_OnOff_000001_WaitForReport_Fulfilled = true; }]; +} +- (void)testSendClusterTestSubscribe_OnOff_000002_SubscribeAttribute +{ + XCTestExpectation * expectation = [self expectationWithDescription:@"Subscribe OnOff Attribute"]; + + CHIPDevice * device = GetConnectedDevice(); + dispatch_queue_t queue = dispatch_get_main_queue(); + CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:queue]; + XCTAssertNotNil(cluster); + + uint16_t minIntervalArgument = 2; + uint16_t maxIntervalArgument = 10; + [cluster subscribeAttributeOnOffWithMinInterval:minIntervalArgument + maxInterval:maxIntervalArgument + responseHandler:^(NSError * err, NSDictionary * values) { + NSLog(@"Subscribe OnOff Attribute Error: %@", err); + + XCTAssertEqual(err.code, 0); + XCTAssertEqual(testSendClusterTestSubscribe_OnOff_000001_WaitForReport_Fulfilled, true); + [expectation fulfill]; + }]; [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTest_TC_CC_8_1_000012_ColorLoopSet +- (void)testSendClusterTestSubscribe_OnOff_000003_On { - XCTestExpectation * expectation = [self expectationWithDescription:@"Color Loop Set Command - Set direction while running"]; + XCTestExpectation * expectation = [self expectationWithDescription:@"Turn On the light to see attribute change"]; CHIPDevice * device = GetConnectedDevice(); dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; + CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:queue]; XCTAssertNotNil(cluster); - 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; - [cluster colorLoopSet:updateFlagsArgument - action:actionArgument - direction:directionArgument - time:timeArgument - startHue:startHueArgument - optionsMask:optionsMaskArgument - optionsOverride:optionsOverrideArgument - responseHandler:^(NSError * err, NSDictionary * values) { - NSLog(@"Color Loop Set Command - Set direction while running Error: %@", err); + [cluster on:^(NSError * err, NSDictionary * values) { + NSLog(@"Turn On the light to see attribute change Error: %@", err); - XCTAssertEqual(err.code, 0); + XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; + [expectation fulfill]; + }]; [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTest_TC_CC_8_1_000013_ReadAttribute +- (void)testSendClusterTestSubscribe_OnOff_000004_WaitForReport { - XCTestExpectation * expectation = [self expectationWithDescription:@"Check ColorLoopDirection Value"]; + XCTestExpectation * expectation = [self expectationWithDescription:@"Check for attribute report"]; CHIPDevice * device = GetConnectedDevice(); dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; + CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:queue]; XCTAssertNotNil(cluster); - [cluster readAttributeColorLoopDirectionWithResponseHandler:^(NSError * err, NSDictionary * values) { - NSLog(@"Check ColorLoopDirection Value Error: %@", err); + [cluster reportAttributeOnOffWithResponseHandler:^(NSError * err, NSDictionary * values) { + NSLog(@"Check for attribute report Error: %@", err); XCTAssertEqual(err.code, 0); - XCTAssertEqual([values[@"value"] unsignedCharValue], 1); + XCTAssertEqual([values[@"value"] boolValue], true); [expectation fulfill]; }]; [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTest_TC_CC_8_1_000014_Off +- (void)testSendClusterTestSubscribe_OnOff_000005_Off { - XCTestExpectation * expectation = [self expectationWithDescription:@"Turn off light that we turned on"]; + XCTestExpectation * expectation = [self expectationWithDescription:@"Turn Off the light to see attribute change"]; CHIPDevice * device = GetConnectedDevice(); dispatch_queue_t queue = dispatch_get_main_queue(); @@ -8892,7 +8892,7 @@ - (void)testSendClusterTest_TC_CC_8_1_000014_Off XCTAssertNotNil(cluster); [cluster off:^(NSError * err, NSDictionary * values) { - NSLog(@"Turn off light that we turned on Error: %@", err); + NSLog(@"Turn Off the light to see attribute change Error: %@", err); XCTAssertEqual(err.code, 0); @@ -8901,21 +8901,21 @@ - (void)testSendClusterTest_TC_CC_8_1_000014_Off [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTest_TC_CC_8_1_000015_ReadAttribute +- (void)testSendClusterTestSubscribe_OnOff_000006_WaitForReport { - XCTestExpectation * expectation = [self expectationWithDescription:@"Check on/off attribute value is false after off command"]; + XCTestExpectation * expectation = [self expectationWithDescription:@"Check for attribute report"]; CHIPDevice * device = GetConnectedDevice(); dispatch_queue_t queue = dispatch_get_main_queue(); CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:queue]; XCTAssertNotNil(cluster); - [cluster readAttributeOnOffWithResponseHandler:^(NSError * err, NSDictionary * values) { - NSLog(@"Check on/off attribute value is false after off command Error: %@", err); + [cluster reportAttributeOnOffWithResponseHandler:^(NSError * err, NSDictionary * values) { + NSLog(@"Check for attribute report Error: %@", err); XCTAssertEqual(err.code, 0); - XCTAssertEqual([values[@"value"] boolValue], 0); + XCTAssertEqual([values[@"value"] boolValue], false); [expectation fulfill]; }];