From 20732852c043fd8bee5afdc2844dfa47cb5011c4 Mon Sep 17 00:00:00 2001 From: Vivien Nicolas Date: Tue, 8 Feb 2022 08:00:33 +0100 Subject: [PATCH] [Darwin] Remove automatically generated tests for Darwin since there are many YAMLs tests now (#14828) * [Darwin] Remove automatically generated tests for Darwin since there are many YAMLs tests now * Update generated darwin tests --- .../CHIP/templates/clusters-tests.zapt | 67 - src/darwin/Framework/CHIP/templates/helper.js | 65 +- .../Framework/CHIPTests/CHIPClustersTests.m | 16487 ---------------- 3 files changed, 8 insertions(+), 16611 deletions(-) diff --git a/src/darwin/Framework/CHIP/templates/clusters-tests.zapt b/src/darwin/Framework/CHIP/templates/clusters-tests.zapt index 29dc83916f2408..1b3f3c95daff7f 100644 --- a/src/darwin/Framework/CHIP/templates/clusters-tests.zapt +++ b/src/darwin/Framework/CHIP/templates/clusters-tests.zapt @@ -212,71 +212,4 @@ CHIPDevice * GetConnectedDevice(void) {{>test_cluster tests=(getTests)}} -{{#chip_client_clusters}} -{{#unless (isStrEqual "Test Cluster" name)}} -{{#unless (isStrEqual "Access Control" name)}} -{{#unless (isStrEqual "Basic" name)}} -{{#unless (isStrEqual "Thermostat" name)}} -{{#unless (isStrEqual "OTA Software Update Provider" name)}} -{{#unless (isStrEqual "Network Commissioning" name)}} {{! "Networks" is broken }} -{{#unless (isStrEqual "Application Basic" name)}} {{! "Application App" is broken }} -{{#chip_server_cluster_attributes}} -- (void)testSendCluster{{asUpperCamelCase parent.name}}ReadAttribute{{asUpperCamelCase name}}WithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIP{{asUpperCamelCase parent.name}} * cluster = [[CHIP{{asUpperCamelCase parent.name}} alloc] initWithDevice:device endpoint:{{asExpectedEndpointForCluster (asUpperCamelCase parent.name)}} queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = [self expectationWithDescription:@"{{asUpperCamelCase parent.name}}ReadAttribute{{asUpperCamelCase name}}WithCompletionHandler"]; - - [cluster readAttribute{{asUpperCamelCase name}}WithCompletionHandler:^({{asObjectiveCClass type parent.name}} * _Nullable value, NSError * _Nullable err) { - NSLog(@"{{asUpperCamelCase parent.name}} {{asUpperCamelCase name}} Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -{{#if isWritableAttribute}} -- (void)testSendCluster{{asUpperCamelCase parent.name}}WriteAttribute{{asUpperCamelCase name}}WithValue -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIP{{asUpperCamelCase parent.name}} * cluster = [[CHIP{{asUpperCamelCase parent.name}} alloc] initWithDevice:device endpoint:{{asExpectedEndpointForCluster (asUpperCamelCase parent.name)}} queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = [self expectationWithDescription:@"{{asUpperCamelCase parent.name}}WriteAttribute{{asUpperCamelCase name}}WithValue"]; - - {{asObjectiveCType type parent.name}} value = {{asTestValue parent.name}}; - [cluster writeAttribute{{asUpperCamelCase name}}WithValue:value completionHandler:^(NSError * _Nullable err) { - NSLog(@"{{asUpperCamelCase parent.name}} {{asUpperCamelCase name}} Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -{{/if}} -{{/chip_server_cluster_attributes}} -{{/unless}} -{{/unless}} -{{/unless}} -{{/unless}} -{{/unless}} -{{/unless}} -{{/unless}} -{{/chip_client_clusters}} - @end diff --git a/src/darwin/Framework/CHIP/templates/helper.js b/src/darwin/Framework/CHIP/templates/helper.js index 866a81e2b6ff1d..d018a659a92f3b 100644 --- a/src/darwin/Framework/CHIP/templates/helper.js +++ b/src/darwin/Framework/CHIP/templates/helper.js @@ -25,53 +25,6 @@ const ChipTypesHelper = require('../../../../../src/app/zap-templates/common/Chi const StringHelper = require('../../../../../src/app/zap-templates/common/StringHelper.js'); const appHelper = require('../../../../../src/app/zap-templates/templates/app/helper.js'); -// Ideally those clusters clusters endpoints should be retrieved from the -// descriptor cluster. -function asExpectedEndpointForCluster(clusterName) -{ - switch (clusterName) { - case 'AccessControl': - case 'AdministratorCommissioning': - case 'Basic': - case 'Descriptor': - case 'DiagnosticLogs': - case 'GeneralCommissioning': - case 'GeneralDiagnostics': - case 'LocalizationConfiguration': - case 'SoftwareDiagnostics': - case 'ThreadNetworkDiagnostics': - case 'EthernetNetworkDiagnostics': - case 'WiFiNetworkDiagnostics': - case 'GroupKeyManagement': - case 'NetworkCommissioning': - case 'OperationalCredentials': - case 'TimeFormatLocalization': - case 'TrustedRootCertificates': - case 'OtaSoftwareUpdateProvider': - case 'OtaSoftwareUpdateRequestor': - case 'PowerSourceConfiguration': - case 'UnitLocalization': - return 0; - } - return 1; -} - -async function asTestValue(cluster, options) -{ - if (StringHelper.isOctetString(this.type)) { - return `[@"${"Test".substring(0, this.maxLength)}" dataUsingEncoding:NSUTF8StringEncoding]`; - } else if (StringHelper.isCharString(this.type)) { - return `@"${"Test".substring(0, this.maxLength)}"`; - } else if (this.isArray) { - return '[NSArray array]'; - } else if (this.isStruct) { - let ourClass = await asObjectiveCClass.call(this, this.type, cluster, options); - return `[[${ourClass} alloc] init]`; - } else { - return `@(${this.min || this.max || 0})`; - } -} - function asObjectiveCBasicType(type, options) { if (StringHelper.isOctetString(type)) { @@ -200,13 +153,11 @@ function commandHasRequiredField(command) // // Module exports // -exports.asObjectiveCBasicType = asObjectiveCBasicType; -exports.asObjectiveCNumberType = asObjectiveCNumberType; -exports.asExpectedEndpointForCluster = asExpectedEndpointForCluster; -exports.asTestIndex = asTestIndex; -exports.asTestValue = asTestValue; -exports.asObjectiveCClass = asObjectiveCClass; -exports.asObjectiveCType = asObjectiveCType; -exports.asStructPropertyName = asStructPropertyName; -exports.asGetterName = asGetterName; -exports.commandHasRequiredField = commandHasRequiredField; +exports.asObjectiveCBasicType = asObjectiveCBasicType; +exports.asObjectiveCNumberType = asObjectiveCNumberType; +exports.asTestIndex = asTestIndex; +exports.asObjectiveCClass = asObjectiveCClass; +exports.asObjectiveCType = asObjectiveCType; +exports.asStructPropertyName = asStructPropertyName; +exports.asGetterName = asGetterName; +exports.commandHasRequiredField = commandHasRequiredField; diff --git a/src/darwin/Framework/CHIPTests/CHIPClustersTests.m b/src/darwin/Framework/CHIPTests/CHIPClustersTests.m index 71116af4a37eb9..148c5106d153d2 100644 --- a/src/darwin/Framework/CHIPTests/CHIPClustersTests.m +++ b/src/darwin/Framework/CHIPTests/CHIPClustersTests.m @@ -43856,16491 +43856,4 @@ - (void)testSendClusterTestSubscribe_OnOff_000007_WaitForReport [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterAccountLoginReadAttributeServerGeneratedCommandListWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPAccountLogin * cluster = [[CHIPAccountLogin alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"AccountLoginReadAttributeServerGeneratedCommandListWithCompletionHandler"]; - - [cluster readAttributeServerGeneratedCommandListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"AccountLogin ServerGeneratedCommandList Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterAccountLoginReadAttributeClientGeneratedCommandListWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPAccountLogin * cluster = [[CHIPAccountLogin alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"AccountLoginReadAttributeClientGeneratedCommandListWithCompletionHandler"]; - - [cluster readAttributeClientGeneratedCommandListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"AccountLogin ClientGeneratedCommandList Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterAccountLoginReadAttributeAttributeListWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPAccountLogin * cluster = [[CHIPAccountLogin alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"AccountLoginReadAttributeAttributeListWithCompletionHandler"]; - - [cluster readAttributeAttributeListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"AccountLogin AttributeList Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterAccountLoginReadAttributeClusterRevisionWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPAccountLogin * cluster = [[CHIPAccountLogin alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"AccountLoginReadAttributeClusterRevisionWithCompletionHandler"]; - - [cluster readAttributeClusterRevisionWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"AccountLogin ClusterRevision Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterAdministratorCommissioningReadAttributeWindowStatusWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPAdministratorCommissioning * cluster = [[CHIPAdministratorCommissioning alloc] initWithDevice:device - endpoint:0 - queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"AdministratorCommissioningReadAttributeWindowStatusWithCompletionHandler"]; - - [cluster readAttributeWindowStatusWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"AdministratorCommissioning WindowStatus Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterAdministratorCommissioningReadAttributeAdminFabricIndexWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPAdministratorCommissioning * cluster = [[CHIPAdministratorCommissioning alloc] initWithDevice:device - endpoint:0 - queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"AdministratorCommissioningReadAttributeAdminFabricIndexWithCompletionHandler"]; - - [cluster readAttributeAdminFabricIndexWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"AdministratorCommissioning AdminFabricIndex Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterAdministratorCommissioningReadAttributeAdminVendorIdWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPAdministratorCommissioning * cluster = [[CHIPAdministratorCommissioning alloc] initWithDevice:device - endpoint:0 - queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"AdministratorCommissioningReadAttributeAdminVendorIdWithCompletionHandler"]; - - [cluster readAttributeAdminVendorIdWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"AdministratorCommissioning AdminVendorId Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterAdministratorCommissioningReadAttributeServerGeneratedCommandListWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPAdministratorCommissioning * cluster = [[CHIPAdministratorCommissioning alloc] initWithDevice:device - endpoint:0 - queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"AdministratorCommissioningReadAttributeServerGeneratedCommandListWithCompletionHandler"]; - - [cluster readAttributeServerGeneratedCommandListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"AdministratorCommissioning ServerGeneratedCommandList Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterAdministratorCommissioningReadAttributeClientGeneratedCommandListWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPAdministratorCommissioning * cluster = [[CHIPAdministratorCommissioning alloc] initWithDevice:device - endpoint:0 - queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"AdministratorCommissioningReadAttributeClientGeneratedCommandListWithCompletionHandler"]; - - [cluster readAttributeClientGeneratedCommandListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"AdministratorCommissioning ClientGeneratedCommandList Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterAdministratorCommissioningReadAttributeAttributeListWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPAdministratorCommissioning * cluster = [[CHIPAdministratorCommissioning alloc] initWithDevice:device - endpoint:0 - queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"AdministratorCommissioningReadAttributeAttributeListWithCompletionHandler"]; - - [cluster readAttributeAttributeListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"AdministratorCommissioning AttributeList Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterAdministratorCommissioningReadAttributeClusterRevisionWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPAdministratorCommissioning * cluster = [[CHIPAdministratorCommissioning alloc] initWithDevice:device - endpoint:0 - queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"AdministratorCommissioningReadAttributeClusterRevisionWithCompletionHandler"]; - - [cluster readAttributeClusterRevisionWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"AdministratorCommissioning ClusterRevision Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterApplicationLauncherReadAttributeApplicationLauncherListWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPApplicationLauncher * cluster = [[CHIPApplicationLauncher alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"ApplicationLauncherReadAttributeApplicationLauncherListWithCompletionHandler"]; - - [cluster readAttributeApplicationLauncherListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"ApplicationLauncher ApplicationLauncherList Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterApplicationLauncherReadAttributeApplicationLauncherAppWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPApplicationLauncher * cluster = [[CHIPApplicationLauncher alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"ApplicationLauncherReadAttributeApplicationLauncherAppWithCompletionHandler"]; - - [cluster readAttributeApplicationLauncherAppWithCompletionHandler:^( - CHIPApplicationLauncherClusterApplicationEP * _Nullable value, NSError * _Nullable err) { - NSLog(@"ApplicationLauncher ApplicationLauncherApp Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterApplicationLauncherWriteAttributeApplicationLauncherAppWithValue -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPApplicationLauncher * cluster = [[CHIPApplicationLauncher alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"ApplicationLauncherWriteAttributeApplicationLauncherAppWithValue"]; - - CHIPApplicationLauncherClusterApplicationEP * _Nonnull value = [[CHIPApplicationLauncherClusterApplicationEP alloc] init]; - [cluster writeAttributeApplicationLauncherAppWithValue:value - completionHandler:^(NSError * _Nullable err) { - NSLog(@"ApplicationLauncher ApplicationLauncherApp Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterApplicationLauncherReadAttributeServerGeneratedCommandListWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPApplicationLauncher * cluster = [[CHIPApplicationLauncher alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"ApplicationLauncherReadAttributeServerGeneratedCommandListWithCompletionHandler"]; - - [cluster readAttributeServerGeneratedCommandListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"ApplicationLauncher ServerGeneratedCommandList Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterApplicationLauncherReadAttributeClientGeneratedCommandListWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPApplicationLauncher * cluster = [[CHIPApplicationLauncher alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"ApplicationLauncherReadAttributeClientGeneratedCommandListWithCompletionHandler"]; - - [cluster readAttributeClientGeneratedCommandListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"ApplicationLauncher ClientGeneratedCommandList Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterApplicationLauncherReadAttributeAttributeListWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPApplicationLauncher * cluster = [[CHIPApplicationLauncher alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"ApplicationLauncherReadAttributeAttributeListWithCompletionHandler"]; - - [cluster readAttributeAttributeListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"ApplicationLauncher AttributeList Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterApplicationLauncherReadAttributeClusterRevisionWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPApplicationLauncher * cluster = [[CHIPApplicationLauncher alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"ApplicationLauncherReadAttributeClusterRevisionWithCompletionHandler"]; - - [cluster readAttributeClusterRevisionWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"ApplicationLauncher ClusterRevision Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterAudioOutputReadAttributeAudioOutputListWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPAudioOutput * cluster = [[CHIPAudioOutput alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"AudioOutputReadAttributeAudioOutputListWithCompletionHandler"]; - - [cluster readAttributeAudioOutputListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"AudioOutput AudioOutputList Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterAudioOutputReadAttributeCurrentAudioOutputWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPAudioOutput * cluster = [[CHIPAudioOutput alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"AudioOutputReadAttributeCurrentAudioOutputWithCompletionHandler"]; - - [cluster readAttributeCurrentAudioOutputWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"AudioOutput CurrentAudioOutput Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterAudioOutputReadAttributeServerGeneratedCommandListWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPAudioOutput * cluster = [[CHIPAudioOutput alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"AudioOutputReadAttributeServerGeneratedCommandListWithCompletionHandler"]; - - [cluster readAttributeServerGeneratedCommandListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"AudioOutput ServerGeneratedCommandList Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterAudioOutputReadAttributeClientGeneratedCommandListWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPAudioOutput * cluster = [[CHIPAudioOutput alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"AudioOutputReadAttributeClientGeneratedCommandListWithCompletionHandler"]; - - [cluster readAttributeClientGeneratedCommandListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"AudioOutput ClientGeneratedCommandList Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterAudioOutputReadAttributeAttributeListWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPAudioOutput * cluster = [[CHIPAudioOutput alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"AudioOutputReadAttributeAttributeListWithCompletionHandler"]; - - [cluster readAttributeAttributeListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"AudioOutput AttributeList Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterAudioOutputReadAttributeClusterRevisionWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPAudioOutput * cluster = [[CHIPAudioOutput alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"AudioOutputReadAttributeClusterRevisionWithCompletionHandler"]; - - [cluster readAttributeClusterRevisionWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"AudioOutput ClusterRevision Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterBarrierControlReadAttributeBarrierMovingStateWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPBarrierControl * cluster = [[CHIPBarrierControl alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"BarrierControlReadAttributeBarrierMovingStateWithCompletionHandler"]; - - [cluster readAttributeBarrierMovingStateWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"BarrierControl BarrierMovingState Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterBarrierControlReadAttributeBarrierSafetyStatusWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPBarrierControl * cluster = [[CHIPBarrierControl alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"BarrierControlReadAttributeBarrierSafetyStatusWithCompletionHandler"]; - - [cluster readAttributeBarrierSafetyStatusWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"BarrierControl BarrierSafetyStatus Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterBarrierControlReadAttributeBarrierCapabilitiesWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPBarrierControl * cluster = [[CHIPBarrierControl alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"BarrierControlReadAttributeBarrierCapabilitiesWithCompletionHandler"]; - - [cluster readAttributeBarrierCapabilitiesWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"BarrierControl BarrierCapabilities Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterBarrierControlReadAttributeBarrierPositionWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPBarrierControl * cluster = [[CHIPBarrierControl alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"BarrierControlReadAttributeBarrierPositionWithCompletionHandler"]; - - [cluster readAttributeBarrierPositionWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"BarrierControl BarrierPosition Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterBarrierControlReadAttributeServerGeneratedCommandListWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPBarrierControl * cluster = [[CHIPBarrierControl alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"BarrierControlReadAttributeServerGeneratedCommandListWithCompletionHandler"]; - - [cluster readAttributeServerGeneratedCommandListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"BarrierControl ServerGeneratedCommandList Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterBarrierControlReadAttributeClientGeneratedCommandListWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPBarrierControl * cluster = [[CHIPBarrierControl alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"BarrierControlReadAttributeClientGeneratedCommandListWithCompletionHandler"]; - - [cluster readAttributeClientGeneratedCommandListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"BarrierControl ClientGeneratedCommandList Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterBarrierControlReadAttributeAttributeListWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPBarrierControl * cluster = [[CHIPBarrierControl alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"BarrierControlReadAttributeAttributeListWithCompletionHandler"]; - - [cluster readAttributeAttributeListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"BarrierControl AttributeList Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterBarrierControlReadAttributeClusterRevisionWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPBarrierControl * cluster = [[CHIPBarrierControl alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"BarrierControlReadAttributeClusterRevisionWithCompletionHandler"]; - - [cluster readAttributeClusterRevisionWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"BarrierControl ClusterRevision Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterBinaryInputBasicReadAttributeOutOfServiceWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPBinaryInputBasic * cluster = [[CHIPBinaryInputBasic alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"BinaryInputBasicReadAttributeOutOfServiceWithCompletionHandler"]; - - [cluster readAttributeOutOfServiceWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"BinaryInputBasic OutOfService Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterBinaryInputBasicWriteAttributeOutOfServiceWithValue -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPBinaryInputBasic * cluster = [[CHIPBinaryInputBasic alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = [self expectationWithDescription:@"BinaryInputBasicWriteAttributeOutOfServiceWithValue"]; - - NSNumber * _Nonnull value = @(0x00); - [cluster writeAttributeOutOfServiceWithValue:value - completionHandler:^(NSError * _Nullable err) { - NSLog(@"BinaryInputBasic OutOfService Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterBinaryInputBasicReadAttributePresentValueWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPBinaryInputBasic * cluster = [[CHIPBinaryInputBasic alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"BinaryInputBasicReadAttributePresentValueWithCompletionHandler"]; - - [cluster readAttributePresentValueWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"BinaryInputBasic PresentValue Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterBinaryInputBasicWriteAttributePresentValueWithValue -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPBinaryInputBasic * cluster = [[CHIPBinaryInputBasic alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = [self expectationWithDescription:@"BinaryInputBasicWriteAttributePresentValueWithValue"]; - - NSNumber * _Nonnull value = @(0); - [cluster writeAttributePresentValueWithValue:value - completionHandler:^(NSError * _Nullable err) { - NSLog(@"BinaryInputBasic PresentValue Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterBinaryInputBasicReadAttributeStatusFlagsWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPBinaryInputBasic * cluster = [[CHIPBinaryInputBasic alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"BinaryInputBasicReadAttributeStatusFlagsWithCompletionHandler"]; - - [cluster readAttributeStatusFlagsWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"BinaryInputBasic StatusFlags Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterBinaryInputBasicReadAttributeServerGeneratedCommandListWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPBinaryInputBasic * cluster = [[CHIPBinaryInputBasic alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"BinaryInputBasicReadAttributeServerGeneratedCommandListWithCompletionHandler"]; - - [cluster readAttributeServerGeneratedCommandListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"BinaryInputBasic ServerGeneratedCommandList Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterBinaryInputBasicReadAttributeClientGeneratedCommandListWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPBinaryInputBasic * cluster = [[CHIPBinaryInputBasic alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"BinaryInputBasicReadAttributeClientGeneratedCommandListWithCompletionHandler"]; - - [cluster readAttributeClientGeneratedCommandListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"BinaryInputBasic ClientGeneratedCommandList Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterBinaryInputBasicReadAttributeAttributeListWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPBinaryInputBasic * cluster = [[CHIPBinaryInputBasic alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"BinaryInputBasicReadAttributeAttributeListWithCompletionHandler"]; - - [cluster readAttributeAttributeListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"BinaryInputBasic AttributeList Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterBinaryInputBasicReadAttributeClusterRevisionWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPBinaryInputBasic * cluster = [[CHIPBinaryInputBasic alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"BinaryInputBasicReadAttributeClusterRevisionWithCompletionHandler"]; - - [cluster readAttributeClusterRevisionWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"BinaryInputBasic ClusterRevision Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterBindingReadAttributeServerGeneratedCommandListWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPBinding * cluster = [[CHIPBinding alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"BindingReadAttributeServerGeneratedCommandListWithCompletionHandler"]; - - [cluster readAttributeServerGeneratedCommandListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"Binding ServerGeneratedCommandList Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterBindingReadAttributeClientGeneratedCommandListWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPBinding * cluster = [[CHIPBinding alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"BindingReadAttributeClientGeneratedCommandListWithCompletionHandler"]; - - [cluster readAttributeClientGeneratedCommandListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"Binding ClientGeneratedCommandList Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterBindingReadAttributeAttributeListWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPBinding * cluster = [[CHIPBinding alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = [self expectationWithDescription:@"BindingReadAttributeAttributeListWithCompletionHandler"]; - - [cluster readAttributeAttributeListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"Binding AttributeList Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterBindingReadAttributeClusterRevisionWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPBinding * cluster = [[CHIPBinding alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = [self expectationWithDescription:@"BindingReadAttributeClusterRevisionWithCompletionHandler"]; - - [cluster readAttributeClusterRevisionWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Binding ClusterRevision Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterBooleanStateReadAttributeStateValueWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPBooleanState * cluster = [[CHIPBooleanState alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = [self expectationWithDescription:@"BooleanStateReadAttributeStateValueWithCompletionHandler"]; - - [cluster readAttributeStateValueWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"BooleanState StateValue Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterBooleanStateReadAttributeServerGeneratedCommandListWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPBooleanState * cluster = [[CHIPBooleanState alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"BooleanStateReadAttributeServerGeneratedCommandListWithCompletionHandler"]; - - [cluster readAttributeServerGeneratedCommandListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"BooleanState ServerGeneratedCommandList Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterBooleanStateReadAttributeClientGeneratedCommandListWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPBooleanState * cluster = [[CHIPBooleanState alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"BooleanStateReadAttributeClientGeneratedCommandListWithCompletionHandler"]; - - [cluster readAttributeClientGeneratedCommandListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"BooleanState ClientGeneratedCommandList Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterBooleanStateReadAttributeAttributeListWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPBooleanState * cluster = [[CHIPBooleanState alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"BooleanStateReadAttributeAttributeListWithCompletionHandler"]; - - [cluster readAttributeAttributeListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"BooleanState AttributeList Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterBooleanStateReadAttributeClusterRevisionWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPBooleanState * cluster = [[CHIPBooleanState alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"BooleanStateReadAttributeClusterRevisionWithCompletionHandler"]; - - [cluster readAttributeClusterRevisionWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"BooleanState ClusterRevision Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterBridgedActionsReadAttributeActionListWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPBridgedActions * cluster = [[CHIPBridgedActions alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"BridgedActionsReadAttributeActionListWithCompletionHandler"]; - - [cluster readAttributeActionListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"BridgedActions ActionList Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterBridgedActionsReadAttributeEndpointListWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPBridgedActions * cluster = [[CHIPBridgedActions alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"BridgedActionsReadAttributeEndpointListWithCompletionHandler"]; - - [cluster readAttributeEndpointListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"BridgedActions EndpointList Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterBridgedActionsReadAttributeSetupUrlWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPBridgedActions * cluster = [[CHIPBridgedActions alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = [self expectationWithDescription:@"BridgedActionsReadAttributeSetupUrlWithCompletionHandler"]; - - [cluster readAttributeSetupUrlWithCompletionHandler:^(NSString * _Nullable value, NSError * _Nullable err) { - NSLog(@"BridgedActions SetupUrl Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterBridgedActionsReadAttributeServerGeneratedCommandListWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPBridgedActions * cluster = [[CHIPBridgedActions alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"BridgedActionsReadAttributeServerGeneratedCommandListWithCompletionHandler"]; - - [cluster readAttributeServerGeneratedCommandListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"BridgedActions ServerGeneratedCommandList Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterBridgedActionsReadAttributeClientGeneratedCommandListWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPBridgedActions * cluster = [[CHIPBridgedActions alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"BridgedActionsReadAttributeClientGeneratedCommandListWithCompletionHandler"]; - - [cluster readAttributeClientGeneratedCommandListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"BridgedActions ClientGeneratedCommandList Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterBridgedActionsReadAttributeAttributeListWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPBridgedActions * cluster = [[CHIPBridgedActions alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"BridgedActionsReadAttributeAttributeListWithCompletionHandler"]; - - [cluster readAttributeAttributeListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"BridgedActions AttributeList Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterBridgedActionsReadAttributeClusterRevisionWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPBridgedActions * cluster = [[CHIPBridgedActions alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"BridgedActionsReadAttributeClusterRevisionWithCompletionHandler"]; - - [cluster readAttributeClusterRevisionWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"BridgedActions ClusterRevision Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterBridgedDeviceBasicReadAttributeVendorNameWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPBridgedDeviceBasic * cluster = [[CHIPBridgedDeviceBasic alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"BridgedDeviceBasicReadAttributeVendorNameWithCompletionHandler"]; - - [cluster readAttributeVendorNameWithCompletionHandler:^(NSString * _Nullable value, NSError * _Nullable err) { - NSLog(@"BridgedDeviceBasic VendorName Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterBridgedDeviceBasicReadAttributeVendorIDWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPBridgedDeviceBasic * cluster = [[CHIPBridgedDeviceBasic alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"BridgedDeviceBasicReadAttributeVendorIDWithCompletionHandler"]; - - [cluster readAttributeVendorIDWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"BridgedDeviceBasic VendorID Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterBridgedDeviceBasicReadAttributeProductNameWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPBridgedDeviceBasic * cluster = [[CHIPBridgedDeviceBasic alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"BridgedDeviceBasicReadAttributeProductNameWithCompletionHandler"]; - - [cluster readAttributeProductNameWithCompletionHandler:^(NSString * _Nullable value, NSError * _Nullable err) { - NSLog(@"BridgedDeviceBasic ProductName Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterBridgedDeviceBasicReadAttributeNodeLabelWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPBridgedDeviceBasic * cluster = [[CHIPBridgedDeviceBasic alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"BridgedDeviceBasicReadAttributeNodeLabelWithCompletionHandler"]; - - [cluster readAttributeNodeLabelWithCompletionHandler:^(NSString * _Nullable value, NSError * _Nullable err) { - NSLog(@"BridgedDeviceBasic NodeLabel Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterBridgedDeviceBasicWriteAttributeNodeLabelWithValue -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPBridgedDeviceBasic * cluster = [[CHIPBridgedDeviceBasic alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = [self expectationWithDescription:@"BridgedDeviceBasicWriteAttributeNodeLabelWithValue"]; - - NSString * _Nonnull value = @"Test"; - [cluster writeAttributeNodeLabelWithValue:value - completionHandler:^(NSError * _Nullable err) { - NSLog(@"BridgedDeviceBasic NodeLabel Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterBridgedDeviceBasicReadAttributeHardwareVersionWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPBridgedDeviceBasic * cluster = [[CHIPBridgedDeviceBasic alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"BridgedDeviceBasicReadAttributeHardwareVersionWithCompletionHandler"]; - - [cluster readAttributeHardwareVersionWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"BridgedDeviceBasic HardwareVersion Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterBridgedDeviceBasicReadAttributeHardwareVersionStringWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPBridgedDeviceBasic * cluster = [[CHIPBridgedDeviceBasic alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"BridgedDeviceBasicReadAttributeHardwareVersionStringWithCompletionHandler"]; - - [cluster readAttributeHardwareVersionStringWithCompletionHandler:^(NSString * _Nullable value, NSError * _Nullable err) { - NSLog(@"BridgedDeviceBasic HardwareVersionString Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterBridgedDeviceBasicReadAttributeSoftwareVersionWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPBridgedDeviceBasic * cluster = [[CHIPBridgedDeviceBasic alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"BridgedDeviceBasicReadAttributeSoftwareVersionWithCompletionHandler"]; - - [cluster readAttributeSoftwareVersionWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"BridgedDeviceBasic SoftwareVersion Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterBridgedDeviceBasicReadAttributeSoftwareVersionStringWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPBridgedDeviceBasic * cluster = [[CHIPBridgedDeviceBasic alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"BridgedDeviceBasicReadAttributeSoftwareVersionStringWithCompletionHandler"]; - - [cluster readAttributeSoftwareVersionStringWithCompletionHandler:^(NSString * _Nullable value, NSError * _Nullable err) { - NSLog(@"BridgedDeviceBasic SoftwareVersionString Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterBridgedDeviceBasicReadAttributeManufacturingDateWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPBridgedDeviceBasic * cluster = [[CHIPBridgedDeviceBasic alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"BridgedDeviceBasicReadAttributeManufacturingDateWithCompletionHandler"]; - - [cluster readAttributeManufacturingDateWithCompletionHandler:^(NSString * _Nullable value, NSError * _Nullable err) { - NSLog(@"BridgedDeviceBasic ManufacturingDate Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterBridgedDeviceBasicReadAttributePartNumberWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPBridgedDeviceBasic * cluster = [[CHIPBridgedDeviceBasic alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"BridgedDeviceBasicReadAttributePartNumberWithCompletionHandler"]; - - [cluster readAttributePartNumberWithCompletionHandler:^(NSString * _Nullable value, NSError * _Nullable err) { - NSLog(@"BridgedDeviceBasic PartNumber Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterBridgedDeviceBasicReadAttributeProductURLWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPBridgedDeviceBasic * cluster = [[CHIPBridgedDeviceBasic alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"BridgedDeviceBasicReadAttributeProductURLWithCompletionHandler"]; - - [cluster readAttributeProductURLWithCompletionHandler:^(NSString * _Nullable value, NSError * _Nullable err) { - NSLog(@"BridgedDeviceBasic ProductURL Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterBridgedDeviceBasicReadAttributeProductLabelWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPBridgedDeviceBasic * cluster = [[CHIPBridgedDeviceBasic alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"BridgedDeviceBasicReadAttributeProductLabelWithCompletionHandler"]; - - [cluster readAttributeProductLabelWithCompletionHandler:^(NSString * _Nullable value, NSError * _Nullable err) { - NSLog(@"BridgedDeviceBasic ProductLabel Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterBridgedDeviceBasicReadAttributeSerialNumberWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPBridgedDeviceBasic * cluster = [[CHIPBridgedDeviceBasic alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"BridgedDeviceBasicReadAttributeSerialNumberWithCompletionHandler"]; - - [cluster readAttributeSerialNumberWithCompletionHandler:^(NSString * _Nullable value, NSError * _Nullable err) { - NSLog(@"BridgedDeviceBasic SerialNumber Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterBridgedDeviceBasicReadAttributeReachableWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPBridgedDeviceBasic * cluster = [[CHIPBridgedDeviceBasic alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"BridgedDeviceBasicReadAttributeReachableWithCompletionHandler"]; - - [cluster readAttributeReachableWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"BridgedDeviceBasic Reachable Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterBridgedDeviceBasicReadAttributeServerGeneratedCommandListWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPBridgedDeviceBasic * cluster = [[CHIPBridgedDeviceBasic alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"BridgedDeviceBasicReadAttributeServerGeneratedCommandListWithCompletionHandler"]; - - [cluster readAttributeServerGeneratedCommandListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"BridgedDeviceBasic ServerGeneratedCommandList Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterBridgedDeviceBasicReadAttributeClientGeneratedCommandListWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPBridgedDeviceBasic * cluster = [[CHIPBridgedDeviceBasic alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"BridgedDeviceBasicReadAttributeClientGeneratedCommandListWithCompletionHandler"]; - - [cluster readAttributeClientGeneratedCommandListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"BridgedDeviceBasic ClientGeneratedCommandList Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterBridgedDeviceBasicReadAttributeAttributeListWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPBridgedDeviceBasic * cluster = [[CHIPBridgedDeviceBasic alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"BridgedDeviceBasicReadAttributeAttributeListWithCompletionHandler"]; - - [cluster readAttributeAttributeListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"BridgedDeviceBasic AttributeList Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterBridgedDeviceBasicReadAttributeClusterRevisionWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPBridgedDeviceBasic * cluster = [[CHIPBridgedDeviceBasic alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"BridgedDeviceBasicReadAttributeClusterRevisionWithCompletionHandler"]; - - [cluster readAttributeClusterRevisionWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"BridgedDeviceBasic ClusterRevision Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterChannelReadAttributeChannelListWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPChannel * cluster = [[CHIPChannel alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = [self expectationWithDescription:@"ChannelReadAttributeChannelListWithCompletionHandler"]; - - [cluster readAttributeChannelListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"Channel ChannelList Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterChannelReadAttributeChannelLineupWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPChannel * cluster = [[CHIPChannel alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = [self expectationWithDescription:@"ChannelReadAttributeChannelLineupWithCompletionHandler"]; - - [cluster - readAttributeChannelLineupWithCompletionHandler:^(CHIPChannelClusterLineupInfo * _Nullable value, NSError * _Nullable err) { - NSLog(@"Channel ChannelLineup Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterChannelWriteAttributeChannelLineupWithValue -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPChannel * cluster = [[CHIPChannel alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = [self expectationWithDescription:@"ChannelWriteAttributeChannelLineupWithValue"]; - - CHIPChannelClusterLineupInfo * _Nonnull value = [[CHIPChannelClusterLineupInfo alloc] init]; - [cluster writeAttributeChannelLineupWithValue:value - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Channel ChannelLineup Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterChannelReadAttributeCurrentChannelWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPChannel * cluster = [[CHIPChannel alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = [self expectationWithDescription:@"ChannelReadAttributeCurrentChannelWithCompletionHandler"]; - - [cluster readAttributeCurrentChannelWithCompletionHandler:^( - CHIPChannelClusterChannelInfo * _Nullable value, NSError * _Nullable err) { - NSLog(@"Channel CurrentChannel Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterChannelWriteAttributeCurrentChannelWithValue -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPChannel * cluster = [[CHIPChannel alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = [self expectationWithDescription:@"ChannelWriteAttributeCurrentChannelWithValue"]; - - CHIPChannelClusterChannelInfo * _Nonnull value = [[CHIPChannelClusterChannelInfo alloc] init]; - [cluster writeAttributeCurrentChannelWithValue:value - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Channel CurrentChannel Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterChannelReadAttributeServerGeneratedCommandListWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPChannel * cluster = [[CHIPChannel alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"ChannelReadAttributeServerGeneratedCommandListWithCompletionHandler"]; - - [cluster readAttributeServerGeneratedCommandListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"Channel ServerGeneratedCommandList Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterChannelReadAttributeClientGeneratedCommandListWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPChannel * cluster = [[CHIPChannel alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"ChannelReadAttributeClientGeneratedCommandListWithCompletionHandler"]; - - [cluster readAttributeClientGeneratedCommandListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"Channel ClientGeneratedCommandList Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterChannelReadAttributeAttributeListWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPChannel * cluster = [[CHIPChannel alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = [self expectationWithDescription:@"ChannelReadAttributeAttributeListWithCompletionHandler"]; - - [cluster readAttributeAttributeListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"Channel AttributeList Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterChannelReadAttributeClusterRevisionWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPChannel * cluster = [[CHIPChannel alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = [self expectationWithDescription:@"ChannelReadAttributeClusterRevisionWithCompletionHandler"]; - - [cluster readAttributeClusterRevisionWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Channel ClusterRevision Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterColorControlReadAttributeCurrentHueWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPColorControl * cluster = [[CHIPColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = [self expectationWithDescription:@"ColorControlReadAttributeCurrentHueWithCompletionHandler"]; - - [cluster readAttributeCurrentHueWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"ColorControl CurrentHue Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterColorControlReadAttributeCurrentSaturationWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPColorControl * cluster = [[CHIPColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"ColorControlReadAttributeCurrentSaturationWithCompletionHandler"]; - - [cluster readAttributeCurrentSaturationWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"ColorControl CurrentSaturation Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterColorControlReadAttributeRemainingTimeWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPColorControl * cluster = [[CHIPColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"ColorControlReadAttributeRemainingTimeWithCompletionHandler"]; - - [cluster readAttributeRemainingTimeWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"ColorControl RemainingTime Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterColorControlReadAttributeCurrentXWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPColorControl * cluster = [[CHIPColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = [self expectationWithDescription:@"ColorControlReadAttributeCurrentXWithCompletionHandler"]; - - [cluster readAttributeCurrentXWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"ColorControl CurrentX Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterColorControlReadAttributeCurrentYWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPColorControl * cluster = [[CHIPColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = [self expectationWithDescription:@"ColorControlReadAttributeCurrentYWithCompletionHandler"]; - - [cluster readAttributeCurrentYWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"ColorControl CurrentY Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterColorControlReadAttributeDriftCompensationWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPColorControl * cluster = [[CHIPColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"ColorControlReadAttributeDriftCompensationWithCompletionHandler"]; - - [cluster readAttributeDriftCompensationWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"ColorControl DriftCompensation Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterColorControlReadAttributeCompensationTextWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPColorControl * cluster = [[CHIPColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"ColorControlReadAttributeCompensationTextWithCompletionHandler"]; - - [cluster readAttributeCompensationTextWithCompletionHandler:^(NSString * _Nullable value, NSError * _Nullable err) { - NSLog(@"ColorControl CompensationText Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterColorControlReadAttributeColorTemperatureWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPColorControl * cluster = [[CHIPColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"ColorControlReadAttributeColorTemperatureWithCompletionHandler"]; - - [cluster readAttributeColorTemperatureWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"ColorControl ColorTemperature Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterColorControlReadAttributeColorModeWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPColorControl * cluster = [[CHIPColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = [self expectationWithDescription:@"ColorControlReadAttributeColorModeWithCompletionHandler"]; - - [cluster readAttributeColorModeWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"ColorControl ColorMode Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterColorControlReadAttributeColorControlOptionsWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPColorControl * cluster = [[CHIPColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"ColorControlReadAttributeColorControlOptionsWithCompletionHandler"]; - - [cluster readAttributeColorControlOptionsWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"ColorControl ColorControlOptions Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterColorControlWriteAttributeColorControlOptionsWithValue -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPColorControl * cluster = [[CHIPColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = [self expectationWithDescription:@"ColorControlWriteAttributeColorControlOptionsWithValue"]; - - NSNumber * _Nonnull value = @(0); - [cluster writeAttributeColorControlOptionsWithValue:value - completionHandler:^(NSError * _Nullable err) { - NSLog(@"ColorControl ColorControlOptions Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterColorControlReadAttributeNumberOfPrimariesWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPColorControl * cluster = [[CHIPColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"ColorControlReadAttributeNumberOfPrimariesWithCompletionHandler"]; - - [cluster readAttributeNumberOfPrimariesWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"ColorControl NumberOfPrimaries Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterColorControlReadAttributePrimary1XWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPColorControl * cluster = [[CHIPColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = [self expectationWithDescription:@"ColorControlReadAttributePrimary1XWithCompletionHandler"]; - - [cluster readAttributePrimary1XWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"ColorControl Primary1X Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterColorControlReadAttributePrimary1YWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPColorControl * cluster = [[CHIPColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = [self expectationWithDescription:@"ColorControlReadAttributePrimary1YWithCompletionHandler"]; - - [cluster readAttributePrimary1YWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"ColorControl Primary1Y Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterColorControlReadAttributePrimary1IntensityWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPColorControl * cluster = [[CHIPColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"ColorControlReadAttributePrimary1IntensityWithCompletionHandler"]; - - [cluster readAttributePrimary1IntensityWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"ColorControl Primary1Intensity Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterColorControlReadAttributePrimary2XWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPColorControl * cluster = [[CHIPColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = [self expectationWithDescription:@"ColorControlReadAttributePrimary2XWithCompletionHandler"]; - - [cluster readAttributePrimary2XWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"ColorControl Primary2X Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterColorControlReadAttributePrimary2YWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPColorControl * cluster = [[CHIPColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = [self expectationWithDescription:@"ColorControlReadAttributePrimary2YWithCompletionHandler"]; - - [cluster readAttributePrimary2YWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"ColorControl Primary2Y Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterColorControlReadAttributePrimary2IntensityWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPColorControl * cluster = [[CHIPColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"ColorControlReadAttributePrimary2IntensityWithCompletionHandler"]; - - [cluster readAttributePrimary2IntensityWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"ColorControl Primary2Intensity Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterColorControlReadAttributePrimary3XWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPColorControl * cluster = [[CHIPColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = [self expectationWithDescription:@"ColorControlReadAttributePrimary3XWithCompletionHandler"]; - - [cluster readAttributePrimary3XWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"ColorControl Primary3X Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterColorControlReadAttributePrimary3YWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPColorControl * cluster = [[CHIPColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = [self expectationWithDescription:@"ColorControlReadAttributePrimary3YWithCompletionHandler"]; - - [cluster readAttributePrimary3YWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"ColorControl Primary3Y Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterColorControlReadAttributePrimary3IntensityWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPColorControl * cluster = [[CHIPColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"ColorControlReadAttributePrimary3IntensityWithCompletionHandler"]; - - [cluster readAttributePrimary3IntensityWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"ColorControl Primary3Intensity Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterColorControlReadAttributePrimary4XWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPColorControl * cluster = [[CHIPColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = [self expectationWithDescription:@"ColorControlReadAttributePrimary4XWithCompletionHandler"]; - - [cluster readAttributePrimary4XWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"ColorControl Primary4X Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterColorControlReadAttributePrimary4YWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPColorControl * cluster = [[CHIPColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = [self expectationWithDescription:@"ColorControlReadAttributePrimary4YWithCompletionHandler"]; - - [cluster readAttributePrimary4YWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"ColorControl Primary4Y Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterColorControlReadAttributePrimary4IntensityWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPColorControl * cluster = [[CHIPColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"ColorControlReadAttributePrimary4IntensityWithCompletionHandler"]; - - [cluster readAttributePrimary4IntensityWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"ColorControl Primary4Intensity Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterColorControlReadAttributePrimary5XWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPColorControl * cluster = [[CHIPColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = [self expectationWithDescription:@"ColorControlReadAttributePrimary5XWithCompletionHandler"]; - - [cluster readAttributePrimary5XWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"ColorControl Primary5X Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterColorControlReadAttributePrimary5YWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPColorControl * cluster = [[CHIPColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = [self expectationWithDescription:@"ColorControlReadAttributePrimary5YWithCompletionHandler"]; - - [cluster readAttributePrimary5YWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"ColorControl Primary5Y Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterColorControlReadAttributePrimary5IntensityWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPColorControl * cluster = [[CHIPColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"ColorControlReadAttributePrimary5IntensityWithCompletionHandler"]; - - [cluster readAttributePrimary5IntensityWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"ColorControl Primary5Intensity Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterColorControlReadAttributePrimary6XWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPColorControl * cluster = [[CHIPColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = [self expectationWithDescription:@"ColorControlReadAttributePrimary6XWithCompletionHandler"]; - - [cluster readAttributePrimary6XWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"ColorControl Primary6X Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterColorControlReadAttributePrimary6YWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPColorControl * cluster = [[CHIPColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = [self expectationWithDescription:@"ColorControlReadAttributePrimary6YWithCompletionHandler"]; - - [cluster readAttributePrimary6YWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"ColorControl Primary6Y Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterColorControlReadAttributePrimary6IntensityWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPColorControl * cluster = [[CHIPColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"ColorControlReadAttributePrimary6IntensityWithCompletionHandler"]; - - [cluster readAttributePrimary6IntensityWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"ColorControl Primary6Intensity Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterColorControlReadAttributeWhitePointXWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPColorControl * cluster = [[CHIPColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"ColorControlReadAttributeWhitePointXWithCompletionHandler"]; - - [cluster readAttributeWhitePointXWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"ColorControl WhitePointX Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterColorControlWriteAttributeWhitePointXWithValue -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPColorControl * cluster = [[CHIPColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = [self expectationWithDescription:@"ColorControlWriteAttributeWhitePointXWithValue"]; - - NSNumber * _Nonnull value = @(0x0000); - [cluster writeAttributeWhitePointXWithValue:value - completionHandler:^(NSError * _Nullable err) { - NSLog(@"ColorControl WhitePointX Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterColorControlReadAttributeWhitePointYWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPColorControl * cluster = [[CHIPColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"ColorControlReadAttributeWhitePointYWithCompletionHandler"]; - - [cluster readAttributeWhitePointYWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"ColorControl WhitePointY Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterColorControlWriteAttributeWhitePointYWithValue -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPColorControl * cluster = [[CHIPColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = [self expectationWithDescription:@"ColorControlWriteAttributeWhitePointYWithValue"]; - - NSNumber * _Nonnull value = @(0x0000); - [cluster writeAttributeWhitePointYWithValue:value - completionHandler:^(NSError * _Nullable err) { - NSLog(@"ColorControl WhitePointY Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterColorControlReadAttributeColorPointRXWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPColorControl * cluster = [[CHIPColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"ColorControlReadAttributeColorPointRXWithCompletionHandler"]; - - [cluster readAttributeColorPointRXWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"ColorControl ColorPointRX Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterColorControlWriteAttributeColorPointRXWithValue -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPColorControl * cluster = [[CHIPColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = [self expectationWithDescription:@"ColorControlWriteAttributeColorPointRXWithValue"]; - - NSNumber * _Nonnull value = @(0x0000); - [cluster writeAttributeColorPointRXWithValue:value - completionHandler:^(NSError * _Nullable err) { - NSLog(@"ColorControl ColorPointRX Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterColorControlReadAttributeColorPointRYWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPColorControl * cluster = [[CHIPColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"ColorControlReadAttributeColorPointRYWithCompletionHandler"]; - - [cluster readAttributeColorPointRYWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"ColorControl ColorPointRY Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterColorControlWriteAttributeColorPointRYWithValue -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPColorControl * cluster = [[CHIPColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = [self expectationWithDescription:@"ColorControlWriteAttributeColorPointRYWithValue"]; - - NSNumber * _Nonnull value = @(0x0000); - [cluster writeAttributeColorPointRYWithValue:value - completionHandler:^(NSError * _Nullable err) { - NSLog(@"ColorControl ColorPointRY Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterColorControlReadAttributeColorPointRIntensityWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPColorControl * cluster = [[CHIPColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"ColorControlReadAttributeColorPointRIntensityWithCompletionHandler"]; - - [cluster readAttributeColorPointRIntensityWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"ColorControl ColorPointRIntensity Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterColorControlWriteAttributeColorPointRIntensityWithValue -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPColorControl * cluster = [[CHIPColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = [self expectationWithDescription:@"ColorControlWriteAttributeColorPointRIntensityWithValue"]; - - NSNumber * _Nonnull value = @(0); - [cluster writeAttributeColorPointRIntensityWithValue:value - completionHandler:^(NSError * _Nullable err) { - NSLog(@"ColorControl ColorPointRIntensity Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterColorControlReadAttributeColorPointGXWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPColorControl * cluster = [[CHIPColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"ColorControlReadAttributeColorPointGXWithCompletionHandler"]; - - [cluster readAttributeColorPointGXWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"ColorControl ColorPointGX Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterColorControlWriteAttributeColorPointGXWithValue -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPColorControl * cluster = [[CHIPColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = [self expectationWithDescription:@"ColorControlWriteAttributeColorPointGXWithValue"]; - - NSNumber * _Nonnull value = @(0x0000); - [cluster writeAttributeColorPointGXWithValue:value - completionHandler:^(NSError * _Nullable err) { - NSLog(@"ColorControl ColorPointGX Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterColorControlReadAttributeColorPointGYWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPColorControl * cluster = [[CHIPColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"ColorControlReadAttributeColorPointGYWithCompletionHandler"]; - - [cluster readAttributeColorPointGYWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"ColorControl ColorPointGY Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterColorControlWriteAttributeColorPointGYWithValue -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPColorControl * cluster = [[CHIPColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = [self expectationWithDescription:@"ColorControlWriteAttributeColorPointGYWithValue"]; - - NSNumber * _Nonnull value = @(0x0000); - [cluster writeAttributeColorPointGYWithValue:value - completionHandler:^(NSError * _Nullable err) { - NSLog(@"ColorControl ColorPointGY Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterColorControlReadAttributeColorPointGIntensityWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPColorControl * cluster = [[CHIPColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"ColorControlReadAttributeColorPointGIntensityWithCompletionHandler"]; - - [cluster readAttributeColorPointGIntensityWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"ColorControl ColorPointGIntensity Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterColorControlWriteAttributeColorPointGIntensityWithValue -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPColorControl * cluster = [[CHIPColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = [self expectationWithDescription:@"ColorControlWriteAttributeColorPointGIntensityWithValue"]; - - NSNumber * _Nonnull value = @(0); - [cluster writeAttributeColorPointGIntensityWithValue:value - completionHandler:^(NSError * _Nullable err) { - NSLog(@"ColorControl ColorPointGIntensity Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterColorControlReadAttributeColorPointBXWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPColorControl * cluster = [[CHIPColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"ColorControlReadAttributeColorPointBXWithCompletionHandler"]; - - [cluster readAttributeColorPointBXWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"ColorControl ColorPointBX Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterColorControlWriteAttributeColorPointBXWithValue -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPColorControl * cluster = [[CHIPColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = [self expectationWithDescription:@"ColorControlWriteAttributeColorPointBXWithValue"]; - - NSNumber * _Nonnull value = @(0x0000); - [cluster writeAttributeColorPointBXWithValue:value - completionHandler:^(NSError * _Nullable err) { - NSLog(@"ColorControl ColorPointBX Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterColorControlReadAttributeColorPointBYWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPColorControl * cluster = [[CHIPColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"ColorControlReadAttributeColorPointBYWithCompletionHandler"]; - - [cluster readAttributeColorPointBYWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"ColorControl ColorPointBY Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterColorControlWriteAttributeColorPointBYWithValue -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPColorControl * cluster = [[CHIPColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = [self expectationWithDescription:@"ColorControlWriteAttributeColorPointBYWithValue"]; - - NSNumber * _Nonnull value = @(0x0000); - [cluster writeAttributeColorPointBYWithValue:value - completionHandler:^(NSError * _Nullable err) { - NSLog(@"ColorControl ColorPointBY Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterColorControlReadAttributeColorPointBIntensityWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPColorControl * cluster = [[CHIPColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"ColorControlReadAttributeColorPointBIntensityWithCompletionHandler"]; - - [cluster readAttributeColorPointBIntensityWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"ColorControl ColorPointBIntensity Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterColorControlWriteAttributeColorPointBIntensityWithValue -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPColorControl * cluster = [[CHIPColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = [self expectationWithDescription:@"ColorControlWriteAttributeColorPointBIntensityWithValue"]; - - NSNumber * _Nonnull value = @(0); - [cluster writeAttributeColorPointBIntensityWithValue:value - completionHandler:^(NSError * _Nullable err) { - NSLog(@"ColorControl ColorPointBIntensity Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterColorControlReadAttributeEnhancedCurrentHueWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPColorControl * cluster = [[CHIPColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"ColorControlReadAttributeEnhancedCurrentHueWithCompletionHandler"]; - - [cluster readAttributeEnhancedCurrentHueWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"ColorControl EnhancedCurrentHue Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterColorControlReadAttributeEnhancedColorModeWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPColorControl * cluster = [[CHIPColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"ColorControlReadAttributeEnhancedColorModeWithCompletionHandler"]; - - [cluster readAttributeEnhancedColorModeWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"ColorControl EnhancedColorMode Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterColorControlReadAttributeColorLoopActiveWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPColorControl * cluster = [[CHIPColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"ColorControlReadAttributeColorLoopActiveWithCompletionHandler"]; - - [cluster readAttributeColorLoopActiveWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"ColorControl ColorLoopActive Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterColorControlReadAttributeColorLoopDirectionWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPColorControl * cluster = [[CHIPColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"ColorControlReadAttributeColorLoopDirectionWithCompletionHandler"]; - - [cluster readAttributeColorLoopDirectionWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"ColorControl ColorLoopDirection Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterColorControlReadAttributeColorLoopTimeWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPColorControl * cluster = [[CHIPColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"ColorControlReadAttributeColorLoopTimeWithCompletionHandler"]; - - [cluster readAttributeColorLoopTimeWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"ColorControl ColorLoopTime Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterColorControlReadAttributeColorLoopStartEnhancedHueWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPColorControl * cluster = [[CHIPColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"ColorControlReadAttributeColorLoopStartEnhancedHueWithCompletionHandler"]; - - [cluster readAttributeColorLoopStartEnhancedHueWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"ColorControl ColorLoopStartEnhancedHue Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterColorControlReadAttributeColorLoopStoredEnhancedHueWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPColorControl * cluster = [[CHIPColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"ColorControlReadAttributeColorLoopStoredEnhancedHueWithCompletionHandler"]; - - [cluster readAttributeColorLoopStoredEnhancedHueWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"ColorControl ColorLoopStoredEnhancedHue Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterColorControlReadAttributeColorCapabilitiesWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPColorControl * cluster = [[CHIPColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"ColorControlReadAttributeColorCapabilitiesWithCompletionHandler"]; - - [cluster readAttributeColorCapabilitiesWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"ColorControl ColorCapabilities Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterColorControlReadAttributeColorTempPhysicalMinWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPColorControl * cluster = [[CHIPColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"ColorControlReadAttributeColorTempPhysicalMinWithCompletionHandler"]; - - [cluster readAttributeColorTempPhysicalMinWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"ColorControl ColorTempPhysicalMin Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterColorControlReadAttributeColorTempPhysicalMaxWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPColorControl * cluster = [[CHIPColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"ColorControlReadAttributeColorTempPhysicalMaxWithCompletionHandler"]; - - [cluster readAttributeColorTempPhysicalMaxWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"ColorControl ColorTempPhysicalMax Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterColorControlReadAttributeCoupleColorTempToLevelMinMiredsWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPColorControl * cluster = [[CHIPColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"ColorControlReadAttributeCoupleColorTempToLevelMinMiredsWithCompletionHandler"]; - - [cluster - readAttributeCoupleColorTempToLevelMinMiredsWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"ColorControl CoupleColorTempToLevelMinMireds Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterColorControlReadAttributeStartUpColorTemperatureMiredsWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPColorControl * cluster = [[CHIPColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"ColorControlReadAttributeStartUpColorTemperatureMiredsWithCompletionHandler"]; - - [cluster - readAttributeStartUpColorTemperatureMiredsWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"ColorControl StartUpColorTemperatureMireds Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterColorControlWriteAttributeStartUpColorTemperatureMiredsWithValue -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPColorControl * cluster = [[CHIPColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"ColorControlWriteAttributeStartUpColorTemperatureMiredsWithValue"]; - - NSNumber * _Nonnull value = @(0x0000); - [cluster writeAttributeStartUpColorTemperatureMiredsWithValue:value - completionHandler:^(NSError * _Nullable err) { - NSLog(@"ColorControl StartUpColorTemperatureMireds Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterColorControlReadAttributeServerGeneratedCommandListWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPColorControl * cluster = [[CHIPColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"ColorControlReadAttributeServerGeneratedCommandListWithCompletionHandler"]; - - [cluster readAttributeServerGeneratedCommandListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"ColorControl ServerGeneratedCommandList Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterColorControlReadAttributeClientGeneratedCommandListWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPColorControl * cluster = [[CHIPColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"ColorControlReadAttributeClientGeneratedCommandListWithCompletionHandler"]; - - [cluster readAttributeClientGeneratedCommandListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"ColorControl ClientGeneratedCommandList Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterColorControlReadAttributeAttributeListWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPColorControl * cluster = [[CHIPColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"ColorControlReadAttributeAttributeListWithCompletionHandler"]; - - [cluster readAttributeAttributeListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"ColorControl AttributeList Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterColorControlReadAttributeClusterRevisionWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPColorControl * cluster = [[CHIPColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"ColorControlReadAttributeClusterRevisionWithCompletionHandler"]; - - [cluster readAttributeClusterRevisionWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"ColorControl ClusterRevision Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterContentLauncherReadAttributeAcceptHeaderListWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPContentLauncher * cluster = [[CHIPContentLauncher alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"ContentLauncherReadAttributeAcceptHeaderListWithCompletionHandler"]; - - [cluster readAttributeAcceptHeaderListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"ContentLauncher AcceptHeaderList Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterContentLauncherReadAttributeSupportedStreamingProtocolsWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPContentLauncher * cluster = [[CHIPContentLauncher alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"ContentLauncherReadAttributeSupportedStreamingProtocolsWithCompletionHandler"]; - - [cluster readAttributeSupportedStreamingProtocolsWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"ContentLauncher SupportedStreamingProtocols Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterContentLauncherWriteAttributeSupportedStreamingProtocolsWithValue -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPContentLauncher * cluster = [[CHIPContentLauncher alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"ContentLauncherWriteAttributeSupportedStreamingProtocolsWithValue"]; - - NSNumber * _Nonnull value = @(0); - [cluster writeAttributeSupportedStreamingProtocolsWithValue:value - completionHandler:^(NSError * _Nullable err) { - NSLog(@"ContentLauncher SupportedStreamingProtocols Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterContentLauncherReadAttributeServerGeneratedCommandListWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPContentLauncher * cluster = [[CHIPContentLauncher alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"ContentLauncherReadAttributeServerGeneratedCommandListWithCompletionHandler"]; - - [cluster readAttributeServerGeneratedCommandListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"ContentLauncher ServerGeneratedCommandList Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterContentLauncherReadAttributeClientGeneratedCommandListWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPContentLauncher * cluster = [[CHIPContentLauncher alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"ContentLauncherReadAttributeClientGeneratedCommandListWithCompletionHandler"]; - - [cluster readAttributeClientGeneratedCommandListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"ContentLauncher ClientGeneratedCommandList Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterContentLauncherReadAttributeAttributeListWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPContentLauncher * cluster = [[CHIPContentLauncher alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"ContentLauncherReadAttributeAttributeListWithCompletionHandler"]; - - [cluster readAttributeAttributeListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"ContentLauncher AttributeList Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterContentLauncherReadAttributeClusterRevisionWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPContentLauncher * cluster = [[CHIPContentLauncher alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"ContentLauncherReadAttributeClusterRevisionWithCompletionHandler"]; - - [cluster readAttributeClusterRevisionWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"ContentLauncher ClusterRevision Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterDescriptorReadAttributeDeviceListWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPDescriptor * cluster = [[CHIPDescriptor alloc] initWithDevice:device endpoint:0 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = [self expectationWithDescription:@"DescriptorReadAttributeDeviceListWithCompletionHandler"]; - - [cluster readAttributeDeviceListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"Descriptor DeviceList Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterDescriptorReadAttributeServerListWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPDescriptor * cluster = [[CHIPDescriptor alloc] initWithDevice:device endpoint:0 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = [self expectationWithDescription:@"DescriptorReadAttributeServerListWithCompletionHandler"]; - - [cluster readAttributeServerListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"Descriptor ServerList Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterDescriptorReadAttributeClientListWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPDescriptor * cluster = [[CHIPDescriptor alloc] initWithDevice:device endpoint:0 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = [self expectationWithDescription:@"DescriptorReadAttributeClientListWithCompletionHandler"]; - - [cluster readAttributeClientListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"Descriptor ClientList Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterDescriptorReadAttributePartsListWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPDescriptor * cluster = [[CHIPDescriptor alloc] initWithDevice:device endpoint:0 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = [self expectationWithDescription:@"DescriptorReadAttributePartsListWithCompletionHandler"]; - - [cluster readAttributePartsListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"Descriptor PartsList Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterDescriptorReadAttributeServerGeneratedCommandListWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPDescriptor * cluster = [[CHIPDescriptor alloc] initWithDevice:device endpoint:0 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"DescriptorReadAttributeServerGeneratedCommandListWithCompletionHandler"]; - - [cluster readAttributeServerGeneratedCommandListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"Descriptor ServerGeneratedCommandList Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterDescriptorReadAttributeClientGeneratedCommandListWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPDescriptor * cluster = [[CHIPDescriptor alloc] initWithDevice:device endpoint:0 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"DescriptorReadAttributeClientGeneratedCommandListWithCompletionHandler"]; - - [cluster readAttributeClientGeneratedCommandListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"Descriptor ClientGeneratedCommandList Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterDescriptorReadAttributeAttributeListWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPDescriptor * cluster = [[CHIPDescriptor alloc] initWithDevice:device endpoint:0 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"DescriptorReadAttributeAttributeListWithCompletionHandler"]; - - [cluster readAttributeAttributeListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"Descriptor AttributeList Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterDescriptorReadAttributeClusterRevisionWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPDescriptor * cluster = [[CHIPDescriptor alloc] initWithDevice:device endpoint:0 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"DescriptorReadAttributeClusterRevisionWithCompletionHandler"]; - - [cluster readAttributeClusterRevisionWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Descriptor ClusterRevision Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterDiagnosticLogsReadAttributeServerGeneratedCommandListWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPDiagnosticLogs * cluster = [[CHIPDiagnosticLogs alloc] initWithDevice:device endpoint:0 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"DiagnosticLogsReadAttributeServerGeneratedCommandListWithCompletionHandler"]; - - [cluster readAttributeServerGeneratedCommandListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"DiagnosticLogs ServerGeneratedCommandList Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterDiagnosticLogsReadAttributeClientGeneratedCommandListWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPDiagnosticLogs * cluster = [[CHIPDiagnosticLogs alloc] initWithDevice:device endpoint:0 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"DiagnosticLogsReadAttributeClientGeneratedCommandListWithCompletionHandler"]; - - [cluster readAttributeClientGeneratedCommandListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"DiagnosticLogs ClientGeneratedCommandList Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterDiagnosticLogsReadAttributeAttributeListWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPDiagnosticLogs * cluster = [[CHIPDiagnosticLogs alloc] initWithDevice:device endpoint:0 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"DiagnosticLogsReadAttributeAttributeListWithCompletionHandler"]; - - [cluster readAttributeAttributeListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"DiagnosticLogs AttributeList Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterDoorLockReadAttributeLockStateWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPDoorLock * cluster = [[CHIPDoorLock alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = [self expectationWithDescription:@"DoorLockReadAttributeLockStateWithCompletionHandler"]; - - [cluster readAttributeLockStateWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"DoorLock LockState Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterDoorLockReadAttributeLockTypeWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPDoorLock * cluster = [[CHIPDoorLock alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = [self expectationWithDescription:@"DoorLockReadAttributeLockTypeWithCompletionHandler"]; - - [cluster readAttributeLockTypeWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"DoorLock LockType Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterDoorLockReadAttributeActuatorEnabledWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPDoorLock * cluster = [[CHIPDoorLock alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"DoorLockReadAttributeActuatorEnabledWithCompletionHandler"]; - - [cluster readAttributeActuatorEnabledWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"DoorLock ActuatorEnabled Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterDoorLockReadAttributeDoorStateWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPDoorLock * cluster = [[CHIPDoorLock alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = [self expectationWithDescription:@"DoorLockReadAttributeDoorStateWithCompletionHandler"]; - - [cluster readAttributeDoorStateWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"DoorLock DoorState Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterDoorLockReadAttributeNumberOfTotalUsersSupportedWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPDoorLock * cluster = [[CHIPDoorLock alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"DoorLockReadAttributeNumberOfTotalUsersSupportedWithCompletionHandler"]; - - [cluster readAttributeNumberOfTotalUsersSupportedWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"DoorLock NumberOfTotalUsersSupported Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterDoorLockReadAttributeNumberOfPINUsersSupportedWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPDoorLock * cluster = [[CHIPDoorLock alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"DoorLockReadAttributeNumberOfPINUsersSupportedWithCompletionHandler"]; - - [cluster readAttributeNumberOfPINUsersSupportedWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"DoorLock NumberOfPINUsersSupported Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterDoorLockReadAttributeNumberOfRFIDUsersSupportedWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPDoorLock * cluster = [[CHIPDoorLock alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"DoorLockReadAttributeNumberOfRFIDUsersSupportedWithCompletionHandler"]; - - [cluster readAttributeNumberOfRFIDUsersSupportedWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"DoorLock NumberOfRFIDUsersSupported Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterDoorLockReadAttributeNumberOfWeekDaySchedulesSupportedPerUserWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPDoorLock * cluster = [[CHIPDoorLock alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"DoorLockReadAttributeNumberOfWeekDaySchedulesSupportedPerUserWithCompletionHandler"]; - - [cluster readAttributeNumberOfWeekDaySchedulesSupportedPerUserWithCompletionHandler:^( - NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"DoorLock NumberOfWeekDaySchedulesSupportedPerUser Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterDoorLockReadAttributeNumberOfYearDaySchedulesSupportedPerUserWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPDoorLock * cluster = [[CHIPDoorLock alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"DoorLockReadAttributeNumberOfYearDaySchedulesSupportedPerUserWithCompletionHandler"]; - - [cluster readAttributeNumberOfYearDaySchedulesSupportedPerUserWithCompletionHandler:^( - NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"DoorLock NumberOfYearDaySchedulesSupportedPerUser Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterDoorLockReadAttributeMaxPINCodeLengthWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPDoorLock * cluster = [[CHIPDoorLock alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"DoorLockReadAttributeMaxPINCodeLengthWithCompletionHandler"]; - - [cluster readAttributeMaxPINCodeLengthWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"DoorLock MaxPINCodeLength Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterDoorLockReadAttributeMinPINCodeLengthWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPDoorLock * cluster = [[CHIPDoorLock alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"DoorLockReadAttributeMinPINCodeLengthWithCompletionHandler"]; - - [cluster readAttributeMinPINCodeLengthWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"DoorLock MinPINCodeLength Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterDoorLockReadAttributeMaxRFIDCodeLengthWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPDoorLock * cluster = [[CHIPDoorLock alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"DoorLockReadAttributeMaxRFIDCodeLengthWithCompletionHandler"]; - - [cluster readAttributeMaxRFIDCodeLengthWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"DoorLock MaxRFIDCodeLength Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterDoorLockReadAttributeMinRFIDCodeLengthWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPDoorLock * cluster = [[CHIPDoorLock alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"DoorLockReadAttributeMinRFIDCodeLengthWithCompletionHandler"]; - - [cluster readAttributeMinRFIDCodeLengthWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"DoorLock MinRFIDCodeLength Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterDoorLockReadAttributeLanguageWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPDoorLock * cluster = [[CHIPDoorLock alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = [self expectationWithDescription:@"DoorLockReadAttributeLanguageWithCompletionHandler"]; - - [cluster readAttributeLanguageWithCompletionHandler:^(NSString * _Nullable value, NSError * _Nullable err) { - NSLog(@"DoorLock Language Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterDoorLockWriteAttributeLanguageWithValue -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPDoorLock * cluster = [[CHIPDoorLock alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = [self expectationWithDescription:@"DoorLockWriteAttributeLanguageWithValue"]; - - NSString * _Nonnull value = @"Tes"; - [cluster writeAttributeLanguageWithValue:value - completionHandler:^(NSError * _Nullable err) { - NSLog(@"DoorLock Language Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterDoorLockReadAttributeAutoRelockTimeWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPDoorLock * cluster = [[CHIPDoorLock alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = [self expectationWithDescription:@"DoorLockReadAttributeAutoRelockTimeWithCompletionHandler"]; - - [cluster readAttributeAutoRelockTimeWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"DoorLock AutoRelockTime Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterDoorLockWriteAttributeAutoRelockTimeWithValue -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPDoorLock * cluster = [[CHIPDoorLock alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = [self expectationWithDescription:@"DoorLockWriteAttributeAutoRelockTimeWithValue"]; - - NSNumber * _Nonnull value = @(0); - [cluster writeAttributeAutoRelockTimeWithValue:value - completionHandler:^(NSError * _Nullable err) { - NSLog(@"DoorLock AutoRelockTime Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterDoorLockReadAttributeSoundVolumeWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPDoorLock * cluster = [[CHIPDoorLock alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = [self expectationWithDescription:@"DoorLockReadAttributeSoundVolumeWithCompletionHandler"]; - - [cluster readAttributeSoundVolumeWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"DoorLock SoundVolume Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterDoorLockWriteAttributeSoundVolumeWithValue -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPDoorLock * cluster = [[CHIPDoorLock alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = [self expectationWithDescription:@"DoorLockWriteAttributeSoundVolumeWithValue"]; - - NSNumber * _Nonnull value = @(0); - [cluster writeAttributeSoundVolumeWithValue:value - completionHandler:^(NSError * _Nullable err) { - NSLog(@"DoorLock SoundVolume Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterDoorLockReadAttributeOperatingModeWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPDoorLock * cluster = [[CHIPDoorLock alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = [self expectationWithDescription:@"DoorLockReadAttributeOperatingModeWithCompletionHandler"]; - - [cluster readAttributeOperatingModeWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"DoorLock OperatingMode Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterDoorLockWriteAttributeOperatingModeWithValue -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPDoorLock * cluster = [[CHIPDoorLock alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = [self expectationWithDescription:@"DoorLockWriteAttributeOperatingModeWithValue"]; - - NSNumber * _Nonnull value = @(0); - [cluster writeAttributeOperatingModeWithValue:value - completionHandler:^(NSError * _Nullable err) { - NSLog(@"DoorLock OperatingMode Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterDoorLockReadAttributeSupportedOperatingModesWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPDoorLock * cluster = [[CHIPDoorLock alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"DoorLockReadAttributeSupportedOperatingModesWithCompletionHandler"]; - - [cluster readAttributeSupportedOperatingModesWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"DoorLock SupportedOperatingModes Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterDoorLockReadAttributeEnableOneTouchLockingWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPDoorLock * cluster = [[CHIPDoorLock alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"DoorLockReadAttributeEnableOneTouchLockingWithCompletionHandler"]; - - [cluster readAttributeEnableOneTouchLockingWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"DoorLock EnableOneTouchLocking Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterDoorLockWriteAttributeEnableOneTouchLockingWithValue -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPDoorLock * cluster = [[CHIPDoorLock alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = [self expectationWithDescription:@"DoorLockWriteAttributeEnableOneTouchLockingWithValue"]; - - NSNumber * _Nonnull value = @(0); - [cluster writeAttributeEnableOneTouchLockingWithValue:value - completionHandler:^(NSError * _Nullable err) { - NSLog(@"DoorLock EnableOneTouchLocking Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterDoorLockReadAttributeEnablePrivacyModeButtonWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPDoorLock * cluster = [[CHIPDoorLock alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"DoorLockReadAttributeEnablePrivacyModeButtonWithCompletionHandler"]; - - [cluster readAttributeEnablePrivacyModeButtonWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"DoorLock EnablePrivacyModeButton Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterDoorLockWriteAttributeEnablePrivacyModeButtonWithValue -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPDoorLock * cluster = [[CHIPDoorLock alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = [self expectationWithDescription:@"DoorLockWriteAttributeEnablePrivacyModeButtonWithValue"]; - - NSNumber * _Nonnull value = @(0); - [cluster writeAttributeEnablePrivacyModeButtonWithValue:value - completionHandler:^(NSError * _Nullable err) { - NSLog(@"DoorLock EnablePrivacyModeButton Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterDoorLockReadAttributeWrongCodeEntryLimitWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPDoorLock * cluster = [[CHIPDoorLock alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"DoorLockReadAttributeWrongCodeEntryLimitWithCompletionHandler"]; - - [cluster readAttributeWrongCodeEntryLimitWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"DoorLock WrongCodeEntryLimit Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterDoorLockWriteAttributeWrongCodeEntryLimitWithValue -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPDoorLock * cluster = [[CHIPDoorLock alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = [self expectationWithDescription:@"DoorLockWriteAttributeWrongCodeEntryLimitWithValue"]; - - NSNumber * _Nonnull value = @(1); - [cluster writeAttributeWrongCodeEntryLimitWithValue:value - completionHandler:^(NSError * _Nullable err) { - NSLog(@"DoorLock WrongCodeEntryLimit Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterDoorLockReadAttributeServerGeneratedCommandListWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPDoorLock * cluster = [[CHIPDoorLock alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"DoorLockReadAttributeServerGeneratedCommandListWithCompletionHandler"]; - - [cluster readAttributeServerGeneratedCommandListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"DoorLock ServerGeneratedCommandList Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterDoorLockReadAttributeClientGeneratedCommandListWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPDoorLock * cluster = [[CHIPDoorLock alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"DoorLockReadAttributeClientGeneratedCommandListWithCompletionHandler"]; - - [cluster readAttributeClientGeneratedCommandListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"DoorLock ClientGeneratedCommandList Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterDoorLockReadAttributeAttributeListWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPDoorLock * cluster = [[CHIPDoorLock alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = [self expectationWithDescription:@"DoorLockReadAttributeAttributeListWithCompletionHandler"]; - - [cluster readAttributeAttributeListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"DoorLock AttributeList Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterDoorLockReadAttributeClusterRevisionWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPDoorLock * cluster = [[CHIPDoorLock alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"DoorLockReadAttributeClusterRevisionWithCompletionHandler"]; - - [cluster readAttributeClusterRevisionWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"DoorLock ClusterRevision Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterElectricalMeasurementReadAttributeMeasurementTypeWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPElectricalMeasurement * cluster = [[CHIPElectricalMeasurement alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"ElectricalMeasurementReadAttributeMeasurementTypeWithCompletionHandler"]; - - [cluster readAttributeMeasurementTypeWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"ElectricalMeasurement MeasurementType Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterElectricalMeasurementReadAttributeTotalActivePowerWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPElectricalMeasurement * cluster = [[CHIPElectricalMeasurement alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"ElectricalMeasurementReadAttributeTotalActivePowerWithCompletionHandler"]; - - [cluster readAttributeTotalActivePowerWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"ElectricalMeasurement TotalActivePower Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterElectricalMeasurementReadAttributeRmsVoltageWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPElectricalMeasurement * cluster = [[CHIPElectricalMeasurement alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"ElectricalMeasurementReadAttributeRmsVoltageWithCompletionHandler"]; - - [cluster readAttributeRmsVoltageWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"ElectricalMeasurement RmsVoltage Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterElectricalMeasurementReadAttributeRmsVoltageMinWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPElectricalMeasurement * cluster = [[CHIPElectricalMeasurement alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"ElectricalMeasurementReadAttributeRmsVoltageMinWithCompletionHandler"]; - - [cluster readAttributeRmsVoltageMinWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"ElectricalMeasurement RmsVoltageMin Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterElectricalMeasurementReadAttributeRmsVoltageMaxWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPElectricalMeasurement * cluster = [[CHIPElectricalMeasurement alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"ElectricalMeasurementReadAttributeRmsVoltageMaxWithCompletionHandler"]; - - [cluster readAttributeRmsVoltageMaxWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"ElectricalMeasurement RmsVoltageMax Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterElectricalMeasurementReadAttributeRmsCurrentWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPElectricalMeasurement * cluster = [[CHIPElectricalMeasurement alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"ElectricalMeasurementReadAttributeRmsCurrentWithCompletionHandler"]; - - [cluster readAttributeRmsCurrentWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"ElectricalMeasurement RmsCurrent Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterElectricalMeasurementReadAttributeRmsCurrentMinWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPElectricalMeasurement * cluster = [[CHIPElectricalMeasurement alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"ElectricalMeasurementReadAttributeRmsCurrentMinWithCompletionHandler"]; - - [cluster readAttributeRmsCurrentMinWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"ElectricalMeasurement RmsCurrentMin Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterElectricalMeasurementReadAttributeRmsCurrentMaxWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPElectricalMeasurement * cluster = [[CHIPElectricalMeasurement alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"ElectricalMeasurementReadAttributeRmsCurrentMaxWithCompletionHandler"]; - - [cluster readAttributeRmsCurrentMaxWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"ElectricalMeasurement RmsCurrentMax Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterElectricalMeasurementReadAttributeActivePowerWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPElectricalMeasurement * cluster = [[CHIPElectricalMeasurement alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"ElectricalMeasurementReadAttributeActivePowerWithCompletionHandler"]; - - [cluster readAttributeActivePowerWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"ElectricalMeasurement ActivePower Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterElectricalMeasurementReadAttributeActivePowerMinWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPElectricalMeasurement * cluster = [[CHIPElectricalMeasurement alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"ElectricalMeasurementReadAttributeActivePowerMinWithCompletionHandler"]; - - [cluster readAttributeActivePowerMinWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"ElectricalMeasurement ActivePowerMin Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterElectricalMeasurementReadAttributeActivePowerMaxWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPElectricalMeasurement * cluster = [[CHIPElectricalMeasurement alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"ElectricalMeasurementReadAttributeActivePowerMaxWithCompletionHandler"]; - - [cluster readAttributeActivePowerMaxWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"ElectricalMeasurement ActivePowerMax Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterElectricalMeasurementReadAttributeServerGeneratedCommandListWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPElectricalMeasurement * cluster = [[CHIPElectricalMeasurement alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"ElectricalMeasurementReadAttributeServerGeneratedCommandListWithCompletionHandler"]; - - [cluster readAttributeServerGeneratedCommandListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"ElectricalMeasurement ServerGeneratedCommandList Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterElectricalMeasurementReadAttributeClientGeneratedCommandListWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPElectricalMeasurement * cluster = [[CHIPElectricalMeasurement alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"ElectricalMeasurementReadAttributeClientGeneratedCommandListWithCompletionHandler"]; - - [cluster readAttributeClientGeneratedCommandListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"ElectricalMeasurement ClientGeneratedCommandList Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterElectricalMeasurementReadAttributeAttributeListWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPElectricalMeasurement * cluster = [[CHIPElectricalMeasurement alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"ElectricalMeasurementReadAttributeAttributeListWithCompletionHandler"]; - - [cluster readAttributeAttributeListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"ElectricalMeasurement AttributeList Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterElectricalMeasurementReadAttributeClusterRevisionWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPElectricalMeasurement * cluster = [[CHIPElectricalMeasurement alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"ElectricalMeasurementReadAttributeClusterRevisionWithCompletionHandler"]; - - [cluster readAttributeClusterRevisionWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"ElectricalMeasurement ClusterRevision Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterEthernetNetworkDiagnosticsReadAttributePHYRateWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPEthernetNetworkDiagnostics * cluster = [[CHIPEthernetNetworkDiagnostics alloc] initWithDevice:device - endpoint:0 - queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"EthernetNetworkDiagnosticsReadAttributePHYRateWithCompletionHandler"]; - - [cluster readAttributePHYRateWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"EthernetNetworkDiagnostics PHYRate Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterEthernetNetworkDiagnosticsReadAttributeFullDuplexWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPEthernetNetworkDiagnostics * cluster = [[CHIPEthernetNetworkDiagnostics alloc] initWithDevice:device - endpoint:0 - queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"EthernetNetworkDiagnosticsReadAttributeFullDuplexWithCompletionHandler"]; - - [cluster readAttributeFullDuplexWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"EthernetNetworkDiagnostics FullDuplex Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterEthernetNetworkDiagnosticsReadAttributePacketRxCountWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPEthernetNetworkDiagnostics * cluster = [[CHIPEthernetNetworkDiagnostics alloc] initWithDevice:device - endpoint:0 - queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"EthernetNetworkDiagnosticsReadAttributePacketRxCountWithCompletionHandler"]; - - [cluster readAttributePacketRxCountWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"EthernetNetworkDiagnostics PacketRxCount Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterEthernetNetworkDiagnosticsReadAttributePacketTxCountWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPEthernetNetworkDiagnostics * cluster = [[CHIPEthernetNetworkDiagnostics alloc] initWithDevice:device - endpoint:0 - queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"EthernetNetworkDiagnosticsReadAttributePacketTxCountWithCompletionHandler"]; - - [cluster readAttributePacketTxCountWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"EthernetNetworkDiagnostics PacketTxCount Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterEthernetNetworkDiagnosticsReadAttributeTxErrCountWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPEthernetNetworkDiagnostics * cluster = [[CHIPEthernetNetworkDiagnostics alloc] initWithDevice:device - endpoint:0 - queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"EthernetNetworkDiagnosticsReadAttributeTxErrCountWithCompletionHandler"]; - - [cluster readAttributeTxErrCountWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"EthernetNetworkDiagnostics TxErrCount Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterEthernetNetworkDiagnosticsReadAttributeCollisionCountWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPEthernetNetworkDiagnostics * cluster = [[CHIPEthernetNetworkDiagnostics alloc] initWithDevice:device - endpoint:0 - queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"EthernetNetworkDiagnosticsReadAttributeCollisionCountWithCompletionHandler"]; - - [cluster readAttributeCollisionCountWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"EthernetNetworkDiagnostics CollisionCount Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterEthernetNetworkDiagnosticsReadAttributeOverrunCountWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPEthernetNetworkDiagnostics * cluster = [[CHIPEthernetNetworkDiagnostics alloc] initWithDevice:device - endpoint:0 - queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"EthernetNetworkDiagnosticsReadAttributeOverrunCountWithCompletionHandler"]; - - [cluster readAttributeOverrunCountWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"EthernetNetworkDiagnostics OverrunCount Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterEthernetNetworkDiagnosticsReadAttributeCarrierDetectWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPEthernetNetworkDiagnostics * cluster = [[CHIPEthernetNetworkDiagnostics alloc] initWithDevice:device - endpoint:0 - queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"EthernetNetworkDiagnosticsReadAttributeCarrierDetectWithCompletionHandler"]; - - [cluster readAttributeCarrierDetectWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"EthernetNetworkDiagnostics CarrierDetect Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterEthernetNetworkDiagnosticsReadAttributeTimeSinceResetWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPEthernetNetworkDiagnostics * cluster = [[CHIPEthernetNetworkDiagnostics alloc] initWithDevice:device - endpoint:0 - queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"EthernetNetworkDiagnosticsReadAttributeTimeSinceResetWithCompletionHandler"]; - - [cluster readAttributeTimeSinceResetWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"EthernetNetworkDiagnostics TimeSinceReset Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterEthernetNetworkDiagnosticsReadAttributeServerGeneratedCommandListWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPEthernetNetworkDiagnostics * cluster = [[CHIPEthernetNetworkDiagnostics alloc] initWithDevice:device - endpoint:0 - queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"EthernetNetworkDiagnosticsReadAttributeServerGeneratedCommandListWithCompletionHandler"]; - - [cluster readAttributeServerGeneratedCommandListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"EthernetNetworkDiagnostics ServerGeneratedCommandList Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterEthernetNetworkDiagnosticsReadAttributeClientGeneratedCommandListWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPEthernetNetworkDiagnostics * cluster = [[CHIPEthernetNetworkDiagnostics alloc] initWithDevice:device - endpoint:0 - queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"EthernetNetworkDiagnosticsReadAttributeClientGeneratedCommandListWithCompletionHandler"]; - - [cluster readAttributeClientGeneratedCommandListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"EthernetNetworkDiagnostics ClientGeneratedCommandList Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterEthernetNetworkDiagnosticsReadAttributeAttributeListWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPEthernetNetworkDiagnostics * cluster = [[CHIPEthernetNetworkDiagnostics alloc] initWithDevice:device - endpoint:0 - queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"EthernetNetworkDiagnosticsReadAttributeAttributeListWithCompletionHandler"]; - - [cluster readAttributeAttributeListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"EthernetNetworkDiagnostics AttributeList Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterEthernetNetworkDiagnosticsReadAttributeFeatureMapWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPEthernetNetworkDiagnostics * cluster = [[CHIPEthernetNetworkDiagnostics alloc] initWithDevice:device - endpoint:0 - queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"EthernetNetworkDiagnosticsReadAttributeFeatureMapWithCompletionHandler"]; - - [cluster readAttributeFeatureMapWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"EthernetNetworkDiagnostics FeatureMap Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterEthernetNetworkDiagnosticsReadAttributeClusterRevisionWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPEthernetNetworkDiagnostics * cluster = [[CHIPEthernetNetworkDiagnostics alloc] initWithDevice:device - endpoint:0 - queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"EthernetNetworkDiagnosticsReadAttributeClusterRevisionWithCompletionHandler"]; - - [cluster readAttributeClusterRevisionWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"EthernetNetworkDiagnostics ClusterRevision Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterFixedLabelReadAttributeLabelListWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPFixedLabel * cluster = [[CHIPFixedLabel alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = [self expectationWithDescription:@"FixedLabelReadAttributeLabelListWithCompletionHandler"]; - - [cluster readAttributeLabelListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"FixedLabel LabelList Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterFixedLabelReadAttributeServerGeneratedCommandListWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPFixedLabel * cluster = [[CHIPFixedLabel alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"FixedLabelReadAttributeServerGeneratedCommandListWithCompletionHandler"]; - - [cluster readAttributeServerGeneratedCommandListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"FixedLabel ServerGeneratedCommandList Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterFixedLabelReadAttributeClientGeneratedCommandListWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPFixedLabel * cluster = [[CHIPFixedLabel alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"FixedLabelReadAttributeClientGeneratedCommandListWithCompletionHandler"]; - - [cluster readAttributeClientGeneratedCommandListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"FixedLabel ClientGeneratedCommandList Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterFixedLabelReadAttributeAttributeListWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPFixedLabel * cluster = [[CHIPFixedLabel alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"FixedLabelReadAttributeAttributeListWithCompletionHandler"]; - - [cluster readAttributeAttributeListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"FixedLabel AttributeList Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterFixedLabelReadAttributeClusterRevisionWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPFixedLabel * cluster = [[CHIPFixedLabel alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"FixedLabelReadAttributeClusterRevisionWithCompletionHandler"]; - - [cluster readAttributeClusterRevisionWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"FixedLabel ClusterRevision Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterFlowMeasurementReadAttributeMeasuredValueWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPFlowMeasurement * cluster = [[CHIPFlowMeasurement alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"FlowMeasurementReadAttributeMeasuredValueWithCompletionHandler"]; - - [cluster readAttributeMeasuredValueWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"FlowMeasurement MeasuredValue Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterFlowMeasurementReadAttributeMinMeasuredValueWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPFlowMeasurement * cluster = [[CHIPFlowMeasurement alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"FlowMeasurementReadAttributeMinMeasuredValueWithCompletionHandler"]; - - [cluster readAttributeMinMeasuredValueWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"FlowMeasurement MinMeasuredValue Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterFlowMeasurementReadAttributeMaxMeasuredValueWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPFlowMeasurement * cluster = [[CHIPFlowMeasurement alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"FlowMeasurementReadAttributeMaxMeasuredValueWithCompletionHandler"]; - - [cluster readAttributeMaxMeasuredValueWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"FlowMeasurement MaxMeasuredValue Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterFlowMeasurementReadAttributeToleranceWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPFlowMeasurement * cluster = [[CHIPFlowMeasurement alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"FlowMeasurementReadAttributeToleranceWithCompletionHandler"]; - - [cluster readAttributeToleranceWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"FlowMeasurement Tolerance Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterFlowMeasurementReadAttributeServerGeneratedCommandListWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPFlowMeasurement * cluster = [[CHIPFlowMeasurement alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"FlowMeasurementReadAttributeServerGeneratedCommandListWithCompletionHandler"]; - - [cluster readAttributeServerGeneratedCommandListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"FlowMeasurement ServerGeneratedCommandList Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterFlowMeasurementReadAttributeClientGeneratedCommandListWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPFlowMeasurement * cluster = [[CHIPFlowMeasurement alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"FlowMeasurementReadAttributeClientGeneratedCommandListWithCompletionHandler"]; - - [cluster readAttributeClientGeneratedCommandListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"FlowMeasurement ClientGeneratedCommandList Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterFlowMeasurementReadAttributeAttributeListWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPFlowMeasurement * cluster = [[CHIPFlowMeasurement alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"FlowMeasurementReadAttributeAttributeListWithCompletionHandler"]; - - [cluster readAttributeAttributeListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"FlowMeasurement AttributeList Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterFlowMeasurementReadAttributeClusterRevisionWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPFlowMeasurement * cluster = [[CHIPFlowMeasurement alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"FlowMeasurementReadAttributeClusterRevisionWithCompletionHandler"]; - - [cluster readAttributeClusterRevisionWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"FlowMeasurement ClusterRevision Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterGeneralCommissioningReadAttributeBreadcrumbWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPGeneralCommissioning * cluster = [[CHIPGeneralCommissioning alloc] initWithDevice:device endpoint:0 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"GeneralCommissioningReadAttributeBreadcrumbWithCompletionHandler"]; - - [cluster readAttributeBreadcrumbWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"GeneralCommissioning Breadcrumb Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterGeneralCommissioningWriteAttributeBreadcrumbWithValue -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPGeneralCommissioning * cluster = [[CHIPGeneralCommissioning alloc] initWithDevice:device endpoint:0 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = [self expectationWithDescription:@"GeneralCommissioningWriteAttributeBreadcrumbWithValue"]; - - NSNumber * _Nonnull value = @(0); - [cluster writeAttributeBreadcrumbWithValue:value - completionHandler:^(NSError * _Nullable err) { - NSLog(@"GeneralCommissioning Breadcrumb Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterGeneralCommissioningReadAttributeBasicCommissioningInfoWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPGeneralCommissioning * cluster = [[CHIPGeneralCommissioning alloc] initWithDevice:device endpoint:0 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"GeneralCommissioningReadAttributeBasicCommissioningInfoWithCompletionHandler"]; - - [cluster readAttributeBasicCommissioningInfoWithCompletionHandler:^( - CHIPGeneralCommissioningClusterBasicCommissioningInfo * _Nullable value, NSError * _Nullable err) { - NSLog(@"GeneralCommissioning BasicCommissioningInfo Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterGeneralCommissioningReadAttributeRegulatoryConfigWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPGeneralCommissioning * cluster = [[CHIPGeneralCommissioning alloc] initWithDevice:device endpoint:0 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"GeneralCommissioningReadAttributeRegulatoryConfigWithCompletionHandler"]; - - [cluster readAttributeRegulatoryConfigWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"GeneralCommissioning RegulatoryConfig Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterGeneralCommissioningReadAttributeLocationCapabilityWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPGeneralCommissioning * cluster = [[CHIPGeneralCommissioning alloc] initWithDevice:device endpoint:0 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"GeneralCommissioningReadAttributeLocationCapabilityWithCompletionHandler"]; - - [cluster readAttributeLocationCapabilityWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"GeneralCommissioning LocationCapability Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterGeneralCommissioningReadAttributeServerGeneratedCommandListWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPGeneralCommissioning * cluster = [[CHIPGeneralCommissioning alloc] initWithDevice:device endpoint:0 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"GeneralCommissioningReadAttributeServerGeneratedCommandListWithCompletionHandler"]; - - [cluster readAttributeServerGeneratedCommandListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"GeneralCommissioning ServerGeneratedCommandList Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterGeneralCommissioningReadAttributeClientGeneratedCommandListWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPGeneralCommissioning * cluster = [[CHIPGeneralCommissioning alloc] initWithDevice:device endpoint:0 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"GeneralCommissioningReadAttributeClientGeneratedCommandListWithCompletionHandler"]; - - [cluster readAttributeClientGeneratedCommandListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"GeneralCommissioning ClientGeneratedCommandList Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterGeneralCommissioningReadAttributeAttributeListWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPGeneralCommissioning * cluster = [[CHIPGeneralCommissioning alloc] initWithDevice:device endpoint:0 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"GeneralCommissioningReadAttributeAttributeListWithCompletionHandler"]; - - [cluster readAttributeAttributeListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"GeneralCommissioning AttributeList Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterGeneralCommissioningReadAttributeClusterRevisionWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPGeneralCommissioning * cluster = [[CHIPGeneralCommissioning alloc] initWithDevice:device endpoint:0 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"GeneralCommissioningReadAttributeClusterRevisionWithCompletionHandler"]; - - [cluster readAttributeClusterRevisionWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"GeneralCommissioning ClusterRevision Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterGeneralDiagnosticsReadAttributeNetworkInterfacesWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPGeneralDiagnostics * cluster = [[CHIPGeneralDiagnostics alloc] initWithDevice:device endpoint:0 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"GeneralDiagnosticsReadAttributeNetworkInterfacesWithCompletionHandler"]; - - [cluster readAttributeNetworkInterfacesWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"GeneralDiagnostics NetworkInterfaces Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterGeneralDiagnosticsReadAttributeRebootCountWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPGeneralDiagnostics * cluster = [[CHIPGeneralDiagnostics alloc] initWithDevice:device endpoint:0 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"GeneralDiagnosticsReadAttributeRebootCountWithCompletionHandler"]; - - [cluster readAttributeRebootCountWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"GeneralDiagnostics RebootCount Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterGeneralDiagnosticsReadAttributeUpTimeWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPGeneralDiagnostics * cluster = [[CHIPGeneralDiagnostics alloc] initWithDevice:device endpoint:0 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"GeneralDiagnosticsReadAttributeUpTimeWithCompletionHandler"]; - - [cluster readAttributeUpTimeWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"GeneralDiagnostics UpTime Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterGeneralDiagnosticsReadAttributeTotalOperationalHoursWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPGeneralDiagnostics * cluster = [[CHIPGeneralDiagnostics alloc] initWithDevice:device endpoint:0 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"GeneralDiagnosticsReadAttributeTotalOperationalHoursWithCompletionHandler"]; - - [cluster readAttributeTotalOperationalHoursWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"GeneralDiagnostics TotalOperationalHours Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterGeneralDiagnosticsReadAttributeBootReasonsWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPGeneralDiagnostics * cluster = [[CHIPGeneralDiagnostics alloc] initWithDevice:device endpoint:0 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"GeneralDiagnosticsReadAttributeBootReasonsWithCompletionHandler"]; - - [cluster readAttributeBootReasonsWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"GeneralDiagnostics BootReasons Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterGeneralDiagnosticsReadAttributeActiveHardwareFaultsWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPGeneralDiagnostics * cluster = [[CHIPGeneralDiagnostics alloc] initWithDevice:device endpoint:0 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"GeneralDiagnosticsReadAttributeActiveHardwareFaultsWithCompletionHandler"]; - - [cluster readAttributeActiveHardwareFaultsWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"GeneralDiagnostics ActiveHardwareFaults Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterGeneralDiagnosticsReadAttributeActiveRadioFaultsWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPGeneralDiagnostics * cluster = [[CHIPGeneralDiagnostics alloc] initWithDevice:device endpoint:0 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"GeneralDiagnosticsReadAttributeActiveRadioFaultsWithCompletionHandler"]; - - [cluster readAttributeActiveRadioFaultsWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"GeneralDiagnostics ActiveRadioFaults Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterGeneralDiagnosticsReadAttributeActiveNetworkFaultsWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPGeneralDiagnostics * cluster = [[CHIPGeneralDiagnostics alloc] initWithDevice:device endpoint:0 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"GeneralDiagnosticsReadAttributeActiveNetworkFaultsWithCompletionHandler"]; - - [cluster readAttributeActiveNetworkFaultsWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"GeneralDiagnostics ActiveNetworkFaults Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterGeneralDiagnosticsReadAttributeServerGeneratedCommandListWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPGeneralDiagnostics * cluster = [[CHIPGeneralDiagnostics alloc] initWithDevice:device endpoint:0 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"GeneralDiagnosticsReadAttributeServerGeneratedCommandListWithCompletionHandler"]; - - [cluster readAttributeServerGeneratedCommandListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"GeneralDiagnostics ServerGeneratedCommandList Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterGeneralDiagnosticsReadAttributeClientGeneratedCommandListWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPGeneralDiagnostics * cluster = [[CHIPGeneralDiagnostics alloc] initWithDevice:device endpoint:0 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"GeneralDiagnosticsReadAttributeClientGeneratedCommandListWithCompletionHandler"]; - - [cluster readAttributeClientGeneratedCommandListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"GeneralDiagnostics ClientGeneratedCommandList Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterGeneralDiagnosticsReadAttributeAttributeListWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPGeneralDiagnostics * cluster = [[CHIPGeneralDiagnostics alloc] initWithDevice:device endpoint:0 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"GeneralDiagnosticsReadAttributeAttributeListWithCompletionHandler"]; - - [cluster readAttributeAttributeListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"GeneralDiagnostics AttributeList Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterGeneralDiagnosticsReadAttributeClusterRevisionWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPGeneralDiagnostics * cluster = [[CHIPGeneralDiagnostics alloc] initWithDevice:device endpoint:0 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"GeneralDiagnosticsReadAttributeClusterRevisionWithCompletionHandler"]; - - [cluster readAttributeClusterRevisionWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"GeneralDiagnostics ClusterRevision Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterGroupKeyManagementReadAttributeGroupKeyMapWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPGroupKeyManagement * cluster = [[CHIPGroupKeyManagement alloc] initWithDevice:device endpoint:0 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"GroupKeyManagementReadAttributeGroupKeyMapWithCompletionHandler"]; - - [cluster readAttributeGroupKeyMapWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"GroupKeyManagement GroupKeyMap Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterGroupKeyManagementWriteAttributeGroupKeyMapWithValue -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPGroupKeyManagement * cluster = [[CHIPGroupKeyManagement alloc] initWithDevice:device endpoint:0 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = [self expectationWithDescription:@"GroupKeyManagementWriteAttributeGroupKeyMapWithValue"]; - - NSArray * _Nonnull value = [NSArray array]; - [cluster writeAttributeGroupKeyMapWithValue:value - completionHandler:^(NSError * _Nullable err) { - NSLog(@"GroupKeyManagement GroupKeyMap Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterGroupKeyManagementReadAttributeGroupTableWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPGroupKeyManagement * cluster = [[CHIPGroupKeyManagement alloc] initWithDevice:device endpoint:0 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"GroupKeyManagementReadAttributeGroupTableWithCompletionHandler"]; - - [cluster readAttributeGroupTableWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"GroupKeyManagement GroupTable Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterGroupKeyManagementReadAttributeMaxGroupsPerFabricWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPGroupKeyManagement * cluster = [[CHIPGroupKeyManagement alloc] initWithDevice:device endpoint:0 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"GroupKeyManagementReadAttributeMaxGroupsPerFabricWithCompletionHandler"]; - - [cluster readAttributeMaxGroupsPerFabricWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"GroupKeyManagement MaxGroupsPerFabric Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterGroupKeyManagementReadAttributeMaxGroupKeysPerFabricWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPGroupKeyManagement * cluster = [[CHIPGroupKeyManagement alloc] initWithDevice:device endpoint:0 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"GroupKeyManagementReadAttributeMaxGroupKeysPerFabricWithCompletionHandler"]; - - [cluster readAttributeMaxGroupKeysPerFabricWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"GroupKeyManagement MaxGroupKeysPerFabric Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterGroupKeyManagementReadAttributeServerGeneratedCommandListWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPGroupKeyManagement * cluster = [[CHIPGroupKeyManagement alloc] initWithDevice:device endpoint:0 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"GroupKeyManagementReadAttributeServerGeneratedCommandListWithCompletionHandler"]; - - [cluster readAttributeServerGeneratedCommandListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"GroupKeyManagement ServerGeneratedCommandList Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterGroupKeyManagementReadAttributeClientGeneratedCommandListWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPGroupKeyManagement * cluster = [[CHIPGroupKeyManagement alloc] initWithDevice:device endpoint:0 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"GroupKeyManagementReadAttributeClientGeneratedCommandListWithCompletionHandler"]; - - [cluster readAttributeClientGeneratedCommandListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"GroupKeyManagement ClientGeneratedCommandList Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterGroupKeyManagementReadAttributeAttributeListWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPGroupKeyManagement * cluster = [[CHIPGroupKeyManagement alloc] initWithDevice:device endpoint:0 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"GroupKeyManagementReadAttributeAttributeListWithCompletionHandler"]; - - [cluster readAttributeAttributeListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"GroupKeyManagement AttributeList Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterGroupKeyManagementReadAttributeClusterRevisionWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPGroupKeyManagement * cluster = [[CHIPGroupKeyManagement alloc] initWithDevice:device endpoint:0 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"GroupKeyManagementReadAttributeClusterRevisionWithCompletionHandler"]; - - [cluster readAttributeClusterRevisionWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"GroupKeyManagement ClusterRevision Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterGroupsReadAttributeNameSupportWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPGroups * cluster = [[CHIPGroups alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = [self expectationWithDescription:@"GroupsReadAttributeNameSupportWithCompletionHandler"]; - - [cluster readAttributeNameSupportWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Groups NameSupport Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterGroupsReadAttributeServerGeneratedCommandListWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPGroups * cluster = [[CHIPGroups alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"GroupsReadAttributeServerGeneratedCommandListWithCompletionHandler"]; - - [cluster readAttributeServerGeneratedCommandListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"Groups ServerGeneratedCommandList Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterGroupsReadAttributeClientGeneratedCommandListWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPGroups * cluster = [[CHIPGroups alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"GroupsReadAttributeClientGeneratedCommandListWithCompletionHandler"]; - - [cluster readAttributeClientGeneratedCommandListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"Groups ClientGeneratedCommandList Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterGroupsReadAttributeAttributeListWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPGroups * cluster = [[CHIPGroups alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = [self expectationWithDescription:@"GroupsReadAttributeAttributeListWithCompletionHandler"]; - - [cluster readAttributeAttributeListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"Groups AttributeList Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterGroupsReadAttributeClusterRevisionWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPGroups * cluster = [[CHIPGroups alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = [self expectationWithDescription:@"GroupsReadAttributeClusterRevisionWithCompletionHandler"]; - - [cluster readAttributeClusterRevisionWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Groups ClusterRevision Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterIdentifyReadAttributeIdentifyTimeWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPIdentify * cluster = [[CHIPIdentify alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = [self expectationWithDescription:@"IdentifyReadAttributeIdentifyTimeWithCompletionHandler"]; - - [cluster readAttributeIdentifyTimeWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Identify IdentifyTime Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterIdentifyWriteAttributeIdentifyTimeWithValue -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPIdentify * cluster = [[CHIPIdentify alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = [self expectationWithDescription:@"IdentifyWriteAttributeIdentifyTimeWithValue"]; - - NSNumber * _Nonnull value = @(0x00); - [cluster writeAttributeIdentifyTimeWithValue:value - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Identify IdentifyTime Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterIdentifyReadAttributeIdentifyTypeWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPIdentify * cluster = [[CHIPIdentify alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = [self expectationWithDescription:@"IdentifyReadAttributeIdentifyTypeWithCompletionHandler"]; - - [cluster readAttributeIdentifyTypeWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Identify IdentifyType Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterIdentifyReadAttributeServerGeneratedCommandListWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPIdentify * cluster = [[CHIPIdentify alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"IdentifyReadAttributeServerGeneratedCommandListWithCompletionHandler"]; - - [cluster readAttributeServerGeneratedCommandListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"Identify ServerGeneratedCommandList Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterIdentifyReadAttributeClientGeneratedCommandListWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPIdentify * cluster = [[CHIPIdentify alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"IdentifyReadAttributeClientGeneratedCommandListWithCompletionHandler"]; - - [cluster readAttributeClientGeneratedCommandListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"Identify ClientGeneratedCommandList Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterIdentifyReadAttributeAttributeListWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPIdentify * cluster = [[CHIPIdentify alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = [self expectationWithDescription:@"IdentifyReadAttributeAttributeListWithCompletionHandler"]; - - [cluster readAttributeAttributeListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"Identify AttributeList Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterIdentifyReadAttributeClusterRevisionWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPIdentify * cluster = [[CHIPIdentify alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"IdentifyReadAttributeClusterRevisionWithCompletionHandler"]; - - [cluster readAttributeClusterRevisionWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Identify ClusterRevision Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterIlluminanceMeasurementReadAttributeMeasuredValueWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPIlluminanceMeasurement * cluster = [[CHIPIlluminanceMeasurement alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"IlluminanceMeasurementReadAttributeMeasuredValueWithCompletionHandler"]; - - [cluster readAttributeMeasuredValueWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"IlluminanceMeasurement MeasuredValue Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterIlluminanceMeasurementReadAttributeMinMeasuredValueWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPIlluminanceMeasurement * cluster = [[CHIPIlluminanceMeasurement alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"IlluminanceMeasurementReadAttributeMinMeasuredValueWithCompletionHandler"]; - - [cluster readAttributeMinMeasuredValueWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"IlluminanceMeasurement MinMeasuredValue Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterIlluminanceMeasurementReadAttributeMaxMeasuredValueWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPIlluminanceMeasurement * cluster = [[CHIPIlluminanceMeasurement alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"IlluminanceMeasurementReadAttributeMaxMeasuredValueWithCompletionHandler"]; - - [cluster readAttributeMaxMeasuredValueWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"IlluminanceMeasurement MaxMeasuredValue Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterIlluminanceMeasurementReadAttributeToleranceWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPIlluminanceMeasurement * cluster = [[CHIPIlluminanceMeasurement alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"IlluminanceMeasurementReadAttributeToleranceWithCompletionHandler"]; - - [cluster readAttributeToleranceWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"IlluminanceMeasurement Tolerance Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterIlluminanceMeasurementReadAttributeLightSensorTypeWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPIlluminanceMeasurement * cluster = [[CHIPIlluminanceMeasurement alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"IlluminanceMeasurementReadAttributeLightSensorTypeWithCompletionHandler"]; - - [cluster readAttributeLightSensorTypeWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"IlluminanceMeasurement LightSensorType Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterIlluminanceMeasurementReadAttributeServerGeneratedCommandListWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPIlluminanceMeasurement * cluster = [[CHIPIlluminanceMeasurement alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"IlluminanceMeasurementReadAttributeServerGeneratedCommandListWithCompletionHandler"]; - - [cluster readAttributeServerGeneratedCommandListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"IlluminanceMeasurement ServerGeneratedCommandList Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterIlluminanceMeasurementReadAttributeClientGeneratedCommandListWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPIlluminanceMeasurement * cluster = [[CHIPIlluminanceMeasurement alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"IlluminanceMeasurementReadAttributeClientGeneratedCommandListWithCompletionHandler"]; - - [cluster readAttributeClientGeneratedCommandListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"IlluminanceMeasurement ClientGeneratedCommandList Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterIlluminanceMeasurementReadAttributeAttributeListWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPIlluminanceMeasurement * cluster = [[CHIPIlluminanceMeasurement alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"IlluminanceMeasurementReadAttributeAttributeListWithCompletionHandler"]; - - [cluster readAttributeAttributeListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"IlluminanceMeasurement AttributeList Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterIlluminanceMeasurementReadAttributeClusterRevisionWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPIlluminanceMeasurement * cluster = [[CHIPIlluminanceMeasurement alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"IlluminanceMeasurementReadAttributeClusterRevisionWithCompletionHandler"]; - - [cluster readAttributeClusterRevisionWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"IlluminanceMeasurement ClusterRevision Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterKeypadInputReadAttributeServerGeneratedCommandListWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPKeypadInput * cluster = [[CHIPKeypadInput alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"KeypadInputReadAttributeServerGeneratedCommandListWithCompletionHandler"]; - - [cluster readAttributeServerGeneratedCommandListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"KeypadInput ServerGeneratedCommandList Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterKeypadInputReadAttributeClientGeneratedCommandListWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPKeypadInput * cluster = [[CHIPKeypadInput alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"KeypadInputReadAttributeClientGeneratedCommandListWithCompletionHandler"]; - - [cluster readAttributeClientGeneratedCommandListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"KeypadInput ClientGeneratedCommandList Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterKeypadInputReadAttributeAttributeListWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPKeypadInput * cluster = [[CHIPKeypadInput alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"KeypadInputReadAttributeAttributeListWithCompletionHandler"]; - - [cluster readAttributeAttributeListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"KeypadInput AttributeList Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterKeypadInputReadAttributeClusterRevisionWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPKeypadInput * cluster = [[CHIPKeypadInput alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"KeypadInputReadAttributeClusterRevisionWithCompletionHandler"]; - - [cluster readAttributeClusterRevisionWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"KeypadInput ClusterRevision Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterLevelControlReadAttributeCurrentLevelWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPLevelControl * cluster = [[CHIPLevelControl alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"LevelControlReadAttributeCurrentLevelWithCompletionHandler"]; - - [cluster readAttributeCurrentLevelWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"LevelControl CurrentLevel Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterLevelControlReadAttributeRemainingTimeWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPLevelControl * cluster = [[CHIPLevelControl alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"LevelControlReadAttributeRemainingTimeWithCompletionHandler"]; - - [cluster readAttributeRemainingTimeWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"LevelControl RemainingTime Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterLevelControlReadAttributeMinLevelWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPLevelControl * cluster = [[CHIPLevelControl alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = [self expectationWithDescription:@"LevelControlReadAttributeMinLevelWithCompletionHandler"]; - - [cluster readAttributeMinLevelWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"LevelControl MinLevel Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterLevelControlReadAttributeMaxLevelWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPLevelControl * cluster = [[CHIPLevelControl alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = [self expectationWithDescription:@"LevelControlReadAttributeMaxLevelWithCompletionHandler"]; - - [cluster readAttributeMaxLevelWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"LevelControl MaxLevel Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterLevelControlReadAttributeCurrentFrequencyWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPLevelControl * cluster = [[CHIPLevelControl alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"LevelControlReadAttributeCurrentFrequencyWithCompletionHandler"]; - - [cluster readAttributeCurrentFrequencyWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"LevelControl CurrentFrequency Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterLevelControlReadAttributeMinFrequencyWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPLevelControl * cluster = [[CHIPLevelControl alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"LevelControlReadAttributeMinFrequencyWithCompletionHandler"]; - - [cluster readAttributeMinFrequencyWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"LevelControl MinFrequency Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterLevelControlReadAttributeMaxFrequencyWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPLevelControl * cluster = [[CHIPLevelControl alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"LevelControlReadAttributeMaxFrequencyWithCompletionHandler"]; - - [cluster readAttributeMaxFrequencyWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"LevelControl MaxFrequency Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterLevelControlReadAttributeOptionsWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPLevelControl * cluster = [[CHIPLevelControl alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = [self expectationWithDescription:@"LevelControlReadAttributeOptionsWithCompletionHandler"]; - - [cluster readAttributeOptionsWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"LevelControl Options Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterLevelControlWriteAttributeOptionsWithValue -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPLevelControl * cluster = [[CHIPLevelControl alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = [self expectationWithDescription:@"LevelControlWriteAttributeOptionsWithValue"]; - - NSNumber * _Nonnull value = @(0x00); - [cluster writeAttributeOptionsWithValue:value - completionHandler:^(NSError * _Nullable err) { - NSLog(@"LevelControl Options Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterLevelControlReadAttributeOnOffTransitionTimeWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPLevelControl * cluster = [[CHIPLevelControl alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"LevelControlReadAttributeOnOffTransitionTimeWithCompletionHandler"]; - - [cluster readAttributeOnOffTransitionTimeWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"LevelControl OnOffTransitionTime Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterLevelControlWriteAttributeOnOffTransitionTimeWithValue -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPLevelControl * cluster = [[CHIPLevelControl alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = [self expectationWithDescription:@"LevelControlWriteAttributeOnOffTransitionTimeWithValue"]; - - NSNumber * _Nonnull value = @(0); - [cluster writeAttributeOnOffTransitionTimeWithValue:value - completionHandler:^(NSError * _Nullable err) { - NSLog(@"LevelControl OnOffTransitionTime Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterLevelControlReadAttributeOnLevelWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPLevelControl * cluster = [[CHIPLevelControl alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = [self expectationWithDescription:@"LevelControlReadAttributeOnLevelWithCompletionHandler"]; - - [cluster readAttributeOnLevelWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"LevelControl OnLevel Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterLevelControlWriteAttributeOnLevelWithValue -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPLevelControl * cluster = [[CHIPLevelControl alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = [self expectationWithDescription:@"LevelControlWriteAttributeOnLevelWithValue"]; - - NSNumber * _Nullable value = @(0); - [cluster writeAttributeOnLevelWithValue:value - completionHandler:^(NSError * _Nullable err) { - NSLog(@"LevelControl OnLevel Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterLevelControlReadAttributeOnTransitionTimeWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPLevelControl * cluster = [[CHIPLevelControl alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"LevelControlReadAttributeOnTransitionTimeWithCompletionHandler"]; - - [cluster readAttributeOnTransitionTimeWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"LevelControl OnTransitionTime Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterLevelControlWriteAttributeOnTransitionTimeWithValue -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPLevelControl * cluster = [[CHIPLevelControl alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = [self expectationWithDescription:@"LevelControlWriteAttributeOnTransitionTimeWithValue"]; - - NSNumber * _Nullable value = @(0); - [cluster writeAttributeOnTransitionTimeWithValue:value - completionHandler:^(NSError * _Nullable err) { - NSLog(@"LevelControl OnTransitionTime Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterLevelControlReadAttributeOffTransitionTimeWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPLevelControl * cluster = [[CHIPLevelControl alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"LevelControlReadAttributeOffTransitionTimeWithCompletionHandler"]; - - [cluster readAttributeOffTransitionTimeWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"LevelControl OffTransitionTime Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterLevelControlWriteAttributeOffTransitionTimeWithValue -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPLevelControl * cluster = [[CHIPLevelControl alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = [self expectationWithDescription:@"LevelControlWriteAttributeOffTransitionTimeWithValue"]; - - NSNumber * _Nullable value = @(0); - [cluster writeAttributeOffTransitionTimeWithValue:value - completionHandler:^(NSError * _Nullable err) { - NSLog(@"LevelControl OffTransitionTime Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterLevelControlReadAttributeDefaultMoveRateWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPLevelControl * cluster = [[CHIPLevelControl alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"LevelControlReadAttributeDefaultMoveRateWithCompletionHandler"]; - - [cluster readAttributeDefaultMoveRateWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"LevelControl DefaultMoveRate Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterLevelControlWriteAttributeDefaultMoveRateWithValue -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPLevelControl * cluster = [[CHIPLevelControl alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = [self expectationWithDescription:@"LevelControlWriteAttributeDefaultMoveRateWithValue"]; - - NSNumber * _Nullable value = @(0); - [cluster writeAttributeDefaultMoveRateWithValue:value - completionHandler:^(NSError * _Nullable err) { - NSLog(@"LevelControl DefaultMoveRate Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterLevelControlReadAttributeStartUpCurrentLevelWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPLevelControl * cluster = [[CHIPLevelControl alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"LevelControlReadAttributeStartUpCurrentLevelWithCompletionHandler"]; - - [cluster readAttributeStartUpCurrentLevelWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"LevelControl StartUpCurrentLevel Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterLevelControlWriteAttributeStartUpCurrentLevelWithValue -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPLevelControl * cluster = [[CHIPLevelControl alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = [self expectationWithDescription:@"LevelControlWriteAttributeStartUpCurrentLevelWithValue"]; - - NSNumber * _Nullable value = @(0); - [cluster writeAttributeStartUpCurrentLevelWithValue:value - completionHandler:^(NSError * _Nullable err) { - NSLog(@"LevelControl StartUpCurrentLevel Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterLevelControlReadAttributeServerGeneratedCommandListWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPLevelControl * cluster = [[CHIPLevelControl alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"LevelControlReadAttributeServerGeneratedCommandListWithCompletionHandler"]; - - [cluster readAttributeServerGeneratedCommandListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"LevelControl ServerGeneratedCommandList Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterLevelControlReadAttributeClientGeneratedCommandListWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPLevelControl * cluster = [[CHIPLevelControl alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"LevelControlReadAttributeClientGeneratedCommandListWithCompletionHandler"]; - - [cluster readAttributeClientGeneratedCommandListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"LevelControl ClientGeneratedCommandList Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterLevelControlReadAttributeAttributeListWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPLevelControl * cluster = [[CHIPLevelControl alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"LevelControlReadAttributeAttributeListWithCompletionHandler"]; - - [cluster readAttributeAttributeListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"LevelControl AttributeList Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterLevelControlReadAttributeFeatureMapWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPLevelControl * cluster = [[CHIPLevelControl alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = [self expectationWithDescription:@"LevelControlReadAttributeFeatureMapWithCompletionHandler"]; - - [cluster readAttributeFeatureMapWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"LevelControl FeatureMap Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterLevelControlReadAttributeClusterRevisionWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPLevelControl * cluster = [[CHIPLevelControl alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"LevelControlReadAttributeClusterRevisionWithCompletionHandler"]; - - [cluster readAttributeClusterRevisionWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"LevelControl ClusterRevision Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterLocalizationConfigurationReadAttributeActiveLocaleWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPLocalizationConfiguration * cluster = [[CHIPLocalizationConfiguration alloc] initWithDevice:device endpoint:0 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"LocalizationConfigurationReadAttributeActiveLocaleWithCompletionHandler"]; - - [cluster readAttributeActiveLocaleWithCompletionHandler:^(NSString * _Nullable value, NSError * _Nullable err) { - NSLog(@"LocalizationConfiguration ActiveLocale Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterLocalizationConfigurationWriteAttributeActiveLocaleWithValue -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPLocalizationConfiguration * cluster = [[CHIPLocalizationConfiguration alloc] initWithDevice:device endpoint:0 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"LocalizationConfigurationWriteAttributeActiveLocaleWithValue"]; - - NSString * _Nonnull value = @"Test"; - [cluster writeAttributeActiveLocaleWithValue:value - completionHandler:^(NSError * _Nullable err) { - NSLog(@"LocalizationConfiguration ActiveLocale Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterLocalizationConfigurationReadAttributeSupportedLocalesWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPLocalizationConfiguration * cluster = [[CHIPLocalizationConfiguration alloc] initWithDevice:device endpoint:0 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"LocalizationConfigurationReadAttributeSupportedLocalesWithCompletionHandler"]; - - [cluster readAttributeSupportedLocalesWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"LocalizationConfiguration SupportedLocales Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterLocalizationConfigurationReadAttributeServerGeneratedCommandListWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPLocalizationConfiguration * cluster = [[CHIPLocalizationConfiguration alloc] initWithDevice:device endpoint:0 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"LocalizationConfigurationReadAttributeServerGeneratedCommandListWithCompletionHandler"]; - - [cluster readAttributeServerGeneratedCommandListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"LocalizationConfiguration ServerGeneratedCommandList Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterLocalizationConfigurationReadAttributeClientGeneratedCommandListWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPLocalizationConfiguration * cluster = [[CHIPLocalizationConfiguration alloc] initWithDevice:device endpoint:0 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"LocalizationConfigurationReadAttributeClientGeneratedCommandListWithCompletionHandler"]; - - [cluster readAttributeClientGeneratedCommandListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"LocalizationConfiguration ClientGeneratedCommandList Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterLocalizationConfigurationReadAttributeClusterRevisionWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPLocalizationConfiguration * cluster = [[CHIPLocalizationConfiguration alloc] initWithDevice:device endpoint:0 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"LocalizationConfigurationReadAttributeClusterRevisionWithCompletionHandler"]; - - [cluster readAttributeClusterRevisionWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"LocalizationConfiguration ClusterRevision Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterLowPowerReadAttributeServerGeneratedCommandListWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPLowPower * cluster = [[CHIPLowPower alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"LowPowerReadAttributeServerGeneratedCommandListWithCompletionHandler"]; - - [cluster readAttributeServerGeneratedCommandListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"LowPower ServerGeneratedCommandList Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterLowPowerReadAttributeClientGeneratedCommandListWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPLowPower * cluster = [[CHIPLowPower alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"LowPowerReadAttributeClientGeneratedCommandListWithCompletionHandler"]; - - [cluster readAttributeClientGeneratedCommandListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"LowPower ClientGeneratedCommandList Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterLowPowerReadAttributeAttributeListWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPLowPower * cluster = [[CHIPLowPower alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = [self expectationWithDescription:@"LowPowerReadAttributeAttributeListWithCompletionHandler"]; - - [cluster readAttributeAttributeListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"LowPower AttributeList Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterLowPowerReadAttributeClusterRevisionWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPLowPower * cluster = [[CHIPLowPower alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"LowPowerReadAttributeClusterRevisionWithCompletionHandler"]; - - [cluster readAttributeClusterRevisionWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"LowPower ClusterRevision Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterMediaInputReadAttributeMediaInputListWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPMediaInput * cluster = [[CHIPMediaInput alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"MediaInputReadAttributeMediaInputListWithCompletionHandler"]; - - [cluster readAttributeMediaInputListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"MediaInput MediaInputList Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterMediaInputReadAttributeCurrentMediaInputWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPMediaInput * cluster = [[CHIPMediaInput alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"MediaInputReadAttributeCurrentMediaInputWithCompletionHandler"]; - - [cluster readAttributeCurrentMediaInputWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"MediaInput CurrentMediaInput Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterMediaInputReadAttributeServerGeneratedCommandListWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPMediaInput * cluster = [[CHIPMediaInput alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"MediaInputReadAttributeServerGeneratedCommandListWithCompletionHandler"]; - - [cluster readAttributeServerGeneratedCommandListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"MediaInput ServerGeneratedCommandList Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterMediaInputReadAttributeClientGeneratedCommandListWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPMediaInput * cluster = [[CHIPMediaInput alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"MediaInputReadAttributeClientGeneratedCommandListWithCompletionHandler"]; - - [cluster readAttributeClientGeneratedCommandListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"MediaInput ClientGeneratedCommandList Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterMediaInputReadAttributeAttributeListWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPMediaInput * cluster = [[CHIPMediaInput alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"MediaInputReadAttributeAttributeListWithCompletionHandler"]; - - [cluster readAttributeAttributeListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"MediaInput AttributeList Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterMediaInputReadAttributeClusterRevisionWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPMediaInput * cluster = [[CHIPMediaInput alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"MediaInputReadAttributeClusterRevisionWithCompletionHandler"]; - - [cluster readAttributeClusterRevisionWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"MediaInput ClusterRevision Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterMediaPlaybackReadAttributePlaybackStateWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPMediaPlayback * cluster = [[CHIPMediaPlayback alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"MediaPlaybackReadAttributePlaybackStateWithCompletionHandler"]; - - [cluster readAttributePlaybackStateWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"MediaPlayback PlaybackState Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterMediaPlaybackReadAttributeStartTimeWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPMediaPlayback * cluster = [[CHIPMediaPlayback alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = [self expectationWithDescription:@"MediaPlaybackReadAttributeStartTimeWithCompletionHandler"]; - - [cluster readAttributeStartTimeWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"MediaPlayback StartTime Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterMediaPlaybackReadAttributeDurationWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPMediaPlayback * cluster = [[CHIPMediaPlayback alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = [self expectationWithDescription:@"MediaPlaybackReadAttributeDurationWithCompletionHandler"]; - - [cluster readAttributeDurationWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"MediaPlayback Duration Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterMediaPlaybackReadAttributePositionWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPMediaPlayback * cluster = [[CHIPMediaPlayback alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = [self expectationWithDescription:@"MediaPlaybackReadAttributePositionWithCompletionHandler"]; - - [cluster readAttributePositionWithCompletionHandler:^( - CHIPMediaPlaybackClusterPlaybackPosition * _Nullable value, NSError * _Nullable err) { - NSLog(@"MediaPlayback Position Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterMediaPlaybackWriteAttributePositionWithValue -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPMediaPlayback * cluster = [[CHIPMediaPlayback alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = [self expectationWithDescription:@"MediaPlaybackWriteAttributePositionWithValue"]; - - CHIPMediaPlaybackClusterPlaybackPosition * _Nonnull value = [[CHIPMediaPlaybackClusterPlaybackPosition alloc] init]; - [cluster writeAttributePositionWithValue:value - completionHandler:^(NSError * _Nullable err) { - NSLog(@"MediaPlayback Position Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterMediaPlaybackReadAttributePlaybackSpeedWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPMediaPlayback * cluster = [[CHIPMediaPlayback alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"MediaPlaybackReadAttributePlaybackSpeedWithCompletionHandler"]; - - [cluster readAttributePlaybackSpeedWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"MediaPlayback PlaybackSpeed Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterMediaPlaybackReadAttributeSeekRangeEndWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPMediaPlayback * cluster = [[CHIPMediaPlayback alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"MediaPlaybackReadAttributeSeekRangeEndWithCompletionHandler"]; - - [cluster readAttributeSeekRangeEndWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"MediaPlayback SeekRangeEnd Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterMediaPlaybackReadAttributeSeekRangeStartWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPMediaPlayback * cluster = [[CHIPMediaPlayback alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"MediaPlaybackReadAttributeSeekRangeStartWithCompletionHandler"]; - - [cluster readAttributeSeekRangeStartWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"MediaPlayback SeekRangeStart Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterMediaPlaybackReadAttributeServerGeneratedCommandListWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPMediaPlayback * cluster = [[CHIPMediaPlayback alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"MediaPlaybackReadAttributeServerGeneratedCommandListWithCompletionHandler"]; - - [cluster readAttributeServerGeneratedCommandListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"MediaPlayback ServerGeneratedCommandList Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterMediaPlaybackReadAttributeClientGeneratedCommandListWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPMediaPlayback * cluster = [[CHIPMediaPlayback alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"MediaPlaybackReadAttributeClientGeneratedCommandListWithCompletionHandler"]; - - [cluster readAttributeClientGeneratedCommandListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"MediaPlayback ClientGeneratedCommandList Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterMediaPlaybackReadAttributeAttributeListWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPMediaPlayback * cluster = [[CHIPMediaPlayback alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"MediaPlaybackReadAttributeAttributeListWithCompletionHandler"]; - - [cluster readAttributeAttributeListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"MediaPlayback AttributeList Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterMediaPlaybackReadAttributeClusterRevisionWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPMediaPlayback * cluster = [[CHIPMediaPlayback alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"MediaPlaybackReadAttributeClusterRevisionWithCompletionHandler"]; - - [cluster readAttributeClusterRevisionWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"MediaPlayback ClusterRevision Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterModeSelectReadAttributeCurrentModeWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPModeSelect * cluster = [[CHIPModeSelect alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = [self expectationWithDescription:@"ModeSelectReadAttributeCurrentModeWithCompletionHandler"]; - - [cluster readAttributeCurrentModeWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"ModeSelect CurrentMode Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterModeSelectReadAttributeSupportedModesWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPModeSelect * cluster = [[CHIPModeSelect alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"ModeSelectReadAttributeSupportedModesWithCompletionHandler"]; - - [cluster readAttributeSupportedModesWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"ModeSelect SupportedModes Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterModeSelectReadAttributeOnModeWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPModeSelect * cluster = [[CHIPModeSelect alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = [self expectationWithDescription:@"ModeSelectReadAttributeOnModeWithCompletionHandler"]; - - [cluster readAttributeOnModeWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"ModeSelect OnMode Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterModeSelectWriteAttributeOnModeWithValue -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPModeSelect * cluster = [[CHIPModeSelect alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = [self expectationWithDescription:@"ModeSelectWriteAttributeOnModeWithValue"]; - - NSNumber * _Nonnull value = @(0); - [cluster writeAttributeOnModeWithValue:value - completionHandler:^(NSError * _Nullable err) { - NSLog(@"ModeSelect OnMode Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterModeSelectReadAttributeStartUpModeWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPModeSelect * cluster = [[CHIPModeSelect alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = [self expectationWithDescription:@"ModeSelectReadAttributeStartUpModeWithCompletionHandler"]; - - [cluster readAttributeStartUpModeWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"ModeSelect StartUpMode Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterModeSelectReadAttributeDescriptionWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPModeSelect * cluster = [[CHIPModeSelect alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = [self expectationWithDescription:@"ModeSelectReadAttributeDescriptionWithCompletionHandler"]; - - [cluster readAttributeDescriptionWithCompletionHandler:^(NSString * _Nullable value, NSError * _Nullable err) { - NSLog(@"ModeSelect Description Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterModeSelectReadAttributeServerGeneratedCommandListWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPModeSelect * cluster = [[CHIPModeSelect alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"ModeSelectReadAttributeServerGeneratedCommandListWithCompletionHandler"]; - - [cluster readAttributeServerGeneratedCommandListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"ModeSelect ServerGeneratedCommandList Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterModeSelectReadAttributeClientGeneratedCommandListWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPModeSelect * cluster = [[CHIPModeSelect alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"ModeSelectReadAttributeClientGeneratedCommandListWithCompletionHandler"]; - - [cluster readAttributeClientGeneratedCommandListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"ModeSelect ClientGeneratedCommandList Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterModeSelectReadAttributeAttributeListWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPModeSelect * cluster = [[CHIPModeSelect alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"ModeSelectReadAttributeAttributeListWithCompletionHandler"]; - - [cluster readAttributeAttributeListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"ModeSelect AttributeList Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterModeSelectReadAttributeClusterRevisionWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPModeSelect * cluster = [[CHIPModeSelect alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"ModeSelectReadAttributeClusterRevisionWithCompletionHandler"]; - - [cluster readAttributeClusterRevisionWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"ModeSelect ClusterRevision Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterOtaSoftwareUpdateRequestorReadAttributeDefaultOtaProvidersWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPOtaSoftwareUpdateRequestor * cluster = [[CHIPOtaSoftwareUpdateRequestor alloc] initWithDevice:device - endpoint:0 - queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"OtaSoftwareUpdateRequestorReadAttributeDefaultOtaProvidersWithCompletionHandler"]; - - [cluster readAttributeDefaultOtaProvidersWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"OtaSoftwareUpdateRequestor DefaultOtaProviders Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterOtaSoftwareUpdateRequestorWriteAttributeDefaultOtaProvidersWithValue -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPOtaSoftwareUpdateRequestor * cluster = [[CHIPOtaSoftwareUpdateRequestor alloc] initWithDevice:device - endpoint:0 - queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"OtaSoftwareUpdateRequestorWriteAttributeDefaultOtaProvidersWithValue"]; - - NSArray * _Nonnull value = [NSArray array]; - [cluster writeAttributeDefaultOtaProvidersWithValue:value - completionHandler:^(NSError * _Nullable err) { - NSLog(@"OtaSoftwareUpdateRequestor DefaultOtaProviders Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterOtaSoftwareUpdateRequestorReadAttributeUpdatePossibleWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPOtaSoftwareUpdateRequestor * cluster = [[CHIPOtaSoftwareUpdateRequestor alloc] initWithDevice:device - endpoint:0 - queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"OtaSoftwareUpdateRequestorReadAttributeUpdatePossibleWithCompletionHandler"]; - - [cluster readAttributeUpdatePossibleWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"OtaSoftwareUpdateRequestor UpdatePossible Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterOtaSoftwareUpdateRequestorReadAttributeUpdateStateWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPOtaSoftwareUpdateRequestor * cluster = [[CHIPOtaSoftwareUpdateRequestor alloc] initWithDevice:device - endpoint:0 - queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"OtaSoftwareUpdateRequestorReadAttributeUpdateStateWithCompletionHandler"]; - - [cluster readAttributeUpdateStateWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"OtaSoftwareUpdateRequestor UpdateState Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterOtaSoftwareUpdateRequestorReadAttributeUpdateStateProgressWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPOtaSoftwareUpdateRequestor * cluster = [[CHIPOtaSoftwareUpdateRequestor alloc] initWithDevice:device - endpoint:0 - queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"OtaSoftwareUpdateRequestorReadAttributeUpdateStateProgressWithCompletionHandler"]; - - [cluster readAttributeUpdateStateProgressWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"OtaSoftwareUpdateRequestor UpdateStateProgress Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterOtaSoftwareUpdateRequestorReadAttributeAttributeListWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPOtaSoftwareUpdateRequestor * cluster = [[CHIPOtaSoftwareUpdateRequestor alloc] initWithDevice:device - endpoint:0 - queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"OtaSoftwareUpdateRequestorReadAttributeAttributeListWithCompletionHandler"]; - - [cluster readAttributeAttributeListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"OtaSoftwareUpdateRequestor AttributeList Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterOtaSoftwareUpdateRequestorReadAttributeClusterRevisionWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPOtaSoftwareUpdateRequestor * cluster = [[CHIPOtaSoftwareUpdateRequestor alloc] initWithDevice:device - endpoint:0 - queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"OtaSoftwareUpdateRequestorReadAttributeClusterRevisionWithCompletionHandler"]; - - [cluster readAttributeClusterRevisionWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"OtaSoftwareUpdateRequestor ClusterRevision Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterOccupancySensingReadAttributeOccupancyWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPOccupancySensing * cluster = [[CHIPOccupancySensing alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"OccupancySensingReadAttributeOccupancyWithCompletionHandler"]; - - [cluster readAttributeOccupancyWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"OccupancySensing Occupancy Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterOccupancySensingReadAttributeOccupancySensorTypeWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPOccupancySensing * cluster = [[CHIPOccupancySensing alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"OccupancySensingReadAttributeOccupancySensorTypeWithCompletionHandler"]; - - [cluster readAttributeOccupancySensorTypeWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"OccupancySensing OccupancySensorType Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterOccupancySensingReadAttributeOccupancySensorTypeBitmapWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPOccupancySensing * cluster = [[CHIPOccupancySensing alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"OccupancySensingReadAttributeOccupancySensorTypeBitmapWithCompletionHandler"]; - - [cluster readAttributeOccupancySensorTypeBitmapWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"OccupancySensing OccupancySensorTypeBitmap Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterOccupancySensingReadAttributeServerGeneratedCommandListWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPOccupancySensing * cluster = [[CHIPOccupancySensing alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"OccupancySensingReadAttributeServerGeneratedCommandListWithCompletionHandler"]; - - [cluster readAttributeServerGeneratedCommandListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"OccupancySensing ServerGeneratedCommandList Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterOccupancySensingReadAttributeClientGeneratedCommandListWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPOccupancySensing * cluster = [[CHIPOccupancySensing alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"OccupancySensingReadAttributeClientGeneratedCommandListWithCompletionHandler"]; - - [cluster readAttributeClientGeneratedCommandListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"OccupancySensing ClientGeneratedCommandList Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterOccupancySensingReadAttributeAttributeListWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPOccupancySensing * cluster = [[CHIPOccupancySensing alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"OccupancySensingReadAttributeAttributeListWithCompletionHandler"]; - - [cluster readAttributeAttributeListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"OccupancySensing AttributeList Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterOccupancySensingReadAttributeClusterRevisionWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPOccupancySensing * cluster = [[CHIPOccupancySensing alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"OccupancySensingReadAttributeClusterRevisionWithCompletionHandler"]; - - [cluster readAttributeClusterRevisionWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"OccupancySensing ClusterRevision Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterOnOffReadAttributeOnOffWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPOnOff * cluster = [[CHIPOnOff alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = [self expectationWithDescription:@"OnOffReadAttributeOnOffWithCompletionHandler"]; - - [cluster readAttributeOnOffWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"OnOff OnOff Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterOnOffReadAttributeGlobalSceneControlWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPOnOff * cluster = [[CHIPOnOff alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"OnOffReadAttributeGlobalSceneControlWithCompletionHandler"]; - - [cluster readAttributeGlobalSceneControlWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"OnOff GlobalSceneControl Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterOnOffReadAttributeOnTimeWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPOnOff * cluster = [[CHIPOnOff alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = [self expectationWithDescription:@"OnOffReadAttributeOnTimeWithCompletionHandler"]; - - [cluster readAttributeOnTimeWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"OnOff OnTime Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterOnOffWriteAttributeOnTimeWithValue -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPOnOff * cluster = [[CHIPOnOff alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = [self expectationWithDescription:@"OnOffWriteAttributeOnTimeWithValue"]; - - NSNumber * _Nonnull value = @(0); - [cluster writeAttributeOnTimeWithValue:value - completionHandler:^(NSError * _Nullable err) { - NSLog(@"OnOff OnTime Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterOnOffReadAttributeOffWaitTimeWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPOnOff * cluster = [[CHIPOnOff alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = [self expectationWithDescription:@"OnOffReadAttributeOffWaitTimeWithCompletionHandler"]; - - [cluster readAttributeOffWaitTimeWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"OnOff OffWaitTime Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterOnOffWriteAttributeOffWaitTimeWithValue -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPOnOff * cluster = [[CHIPOnOff alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = [self expectationWithDescription:@"OnOffWriteAttributeOffWaitTimeWithValue"]; - - NSNumber * _Nonnull value = @(0); - [cluster writeAttributeOffWaitTimeWithValue:value - completionHandler:^(NSError * _Nullable err) { - NSLog(@"OnOff OffWaitTime Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterOnOffReadAttributeStartUpOnOffWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPOnOff * cluster = [[CHIPOnOff alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = [self expectationWithDescription:@"OnOffReadAttributeStartUpOnOffWithCompletionHandler"]; - - [cluster readAttributeStartUpOnOffWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"OnOff StartUpOnOff Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterOnOffWriteAttributeStartUpOnOffWithValue -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPOnOff * cluster = [[CHIPOnOff alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = [self expectationWithDescription:@"OnOffWriteAttributeStartUpOnOffWithValue"]; - - NSNumber * _Nonnull value = @(0); - [cluster writeAttributeStartUpOnOffWithValue:value - completionHandler:^(NSError * _Nullable err) { - NSLog(@"OnOff StartUpOnOff Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterOnOffReadAttributeServerGeneratedCommandListWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPOnOff * cluster = [[CHIPOnOff alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"OnOffReadAttributeServerGeneratedCommandListWithCompletionHandler"]; - - [cluster readAttributeServerGeneratedCommandListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"OnOff ServerGeneratedCommandList Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterOnOffReadAttributeClientGeneratedCommandListWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPOnOff * cluster = [[CHIPOnOff alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"OnOffReadAttributeClientGeneratedCommandListWithCompletionHandler"]; - - [cluster readAttributeClientGeneratedCommandListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"OnOff ClientGeneratedCommandList Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterOnOffReadAttributeAttributeListWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPOnOff * cluster = [[CHIPOnOff alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = [self expectationWithDescription:@"OnOffReadAttributeAttributeListWithCompletionHandler"]; - - [cluster readAttributeAttributeListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"OnOff AttributeList Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterOnOffReadAttributeFeatureMapWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPOnOff * cluster = [[CHIPOnOff alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = [self expectationWithDescription:@"OnOffReadAttributeFeatureMapWithCompletionHandler"]; - - [cluster readAttributeFeatureMapWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"OnOff FeatureMap Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterOnOffReadAttributeClusterRevisionWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPOnOff * cluster = [[CHIPOnOff alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = [self expectationWithDescription:@"OnOffReadAttributeClusterRevisionWithCompletionHandler"]; - - [cluster readAttributeClusterRevisionWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"OnOff ClusterRevision Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterOnOffSwitchConfigurationReadAttributeSwitchTypeWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPOnOffSwitchConfiguration * cluster = [[CHIPOnOffSwitchConfiguration alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"OnOffSwitchConfigurationReadAttributeSwitchTypeWithCompletionHandler"]; - - [cluster readAttributeSwitchTypeWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"OnOffSwitchConfiguration SwitchType Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterOnOffSwitchConfigurationReadAttributeSwitchActionsWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPOnOffSwitchConfiguration * cluster = [[CHIPOnOffSwitchConfiguration alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"OnOffSwitchConfigurationReadAttributeSwitchActionsWithCompletionHandler"]; - - [cluster readAttributeSwitchActionsWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"OnOffSwitchConfiguration SwitchActions Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterOnOffSwitchConfigurationWriteAttributeSwitchActionsWithValue -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPOnOffSwitchConfiguration * cluster = [[CHIPOnOffSwitchConfiguration alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"OnOffSwitchConfigurationWriteAttributeSwitchActionsWithValue"]; - - NSNumber * _Nonnull value = @(0x00); - [cluster writeAttributeSwitchActionsWithValue:value - completionHandler:^(NSError * _Nullable err) { - NSLog(@"OnOffSwitchConfiguration SwitchActions Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterOnOffSwitchConfigurationReadAttributeServerGeneratedCommandListWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPOnOffSwitchConfiguration * cluster = [[CHIPOnOffSwitchConfiguration alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"OnOffSwitchConfigurationReadAttributeServerGeneratedCommandListWithCompletionHandler"]; - - [cluster readAttributeServerGeneratedCommandListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"OnOffSwitchConfiguration ServerGeneratedCommandList Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterOnOffSwitchConfigurationReadAttributeClientGeneratedCommandListWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPOnOffSwitchConfiguration * cluster = [[CHIPOnOffSwitchConfiguration alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"OnOffSwitchConfigurationReadAttributeClientGeneratedCommandListWithCompletionHandler"]; - - [cluster readAttributeClientGeneratedCommandListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"OnOffSwitchConfiguration ClientGeneratedCommandList Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterOnOffSwitchConfigurationReadAttributeAttributeListWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPOnOffSwitchConfiguration * cluster = [[CHIPOnOffSwitchConfiguration alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"OnOffSwitchConfigurationReadAttributeAttributeListWithCompletionHandler"]; - - [cluster readAttributeAttributeListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"OnOffSwitchConfiguration AttributeList Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterOnOffSwitchConfigurationReadAttributeClusterRevisionWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPOnOffSwitchConfiguration * cluster = [[CHIPOnOffSwitchConfiguration alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"OnOffSwitchConfigurationReadAttributeClusterRevisionWithCompletionHandler"]; - - [cluster readAttributeClusterRevisionWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"OnOffSwitchConfiguration ClusterRevision Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterOperationalCredentialsReadAttributeNOCsWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPOperationalCredentials * cluster = [[CHIPOperationalCredentials alloc] initWithDevice:device endpoint:0 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"OperationalCredentialsReadAttributeNOCsWithCompletionHandler"]; - - [cluster readAttributeNOCsWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"OperationalCredentials NOCs Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterOperationalCredentialsReadAttributeFabricsListWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPOperationalCredentials * cluster = [[CHIPOperationalCredentials alloc] initWithDevice:device endpoint:0 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"OperationalCredentialsReadAttributeFabricsListWithCompletionHandler"]; - - [cluster readAttributeFabricsListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"OperationalCredentials FabricsList Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterOperationalCredentialsReadAttributeSupportedFabricsWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPOperationalCredentials * cluster = [[CHIPOperationalCredentials alloc] initWithDevice:device endpoint:0 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"OperationalCredentialsReadAttributeSupportedFabricsWithCompletionHandler"]; - - [cluster readAttributeSupportedFabricsWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"OperationalCredentials SupportedFabrics Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterOperationalCredentialsReadAttributeCommissionedFabricsWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPOperationalCredentials * cluster = [[CHIPOperationalCredentials alloc] initWithDevice:device endpoint:0 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"OperationalCredentialsReadAttributeCommissionedFabricsWithCompletionHandler"]; - - [cluster readAttributeCommissionedFabricsWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"OperationalCredentials CommissionedFabrics Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterOperationalCredentialsReadAttributeTrustedRootCertificatesWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPOperationalCredentials * cluster = [[CHIPOperationalCredentials alloc] initWithDevice:device endpoint:0 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"OperationalCredentialsReadAttributeTrustedRootCertificatesWithCompletionHandler"]; - - [cluster readAttributeTrustedRootCertificatesWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"OperationalCredentials TrustedRootCertificates Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterOperationalCredentialsReadAttributeCurrentFabricIndexWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPOperationalCredentials * cluster = [[CHIPOperationalCredentials alloc] initWithDevice:device endpoint:0 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"OperationalCredentialsReadAttributeCurrentFabricIndexWithCompletionHandler"]; - - [cluster readAttributeCurrentFabricIndexWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"OperationalCredentials CurrentFabricIndex Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterOperationalCredentialsReadAttributeServerGeneratedCommandListWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPOperationalCredentials * cluster = [[CHIPOperationalCredentials alloc] initWithDevice:device endpoint:0 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"OperationalCredentialsReadAttributeServerGeneratedCommandListWithCompletionHandler"]; - - [cluster readAttributeServerGeneratedCommandListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"OperationalCredentials ServerGeneratedCommandList Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterOperationalCredentialsReadAttributeClientGeneratedCommandListWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPOperationalCredentials * cluster = [[CHIPOperationalCredentials alloc] initWithDevice:device endpoint:0 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"OperationalCredentialsReadAttributeClientGeneratedCommandListWithCompletionHandler"]; - - [cluster readAttributeClientGeneratedCommandListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"OperationalCredentials ClientGeneratedCommandList Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterOperationalCredentialsReadAttributeAttributeListWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPOperationalCredentials * cluster = [[CHIPOperationalCredentials alloc] initWithDevice:device endpoint:0 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"OperationalCredentialsReadAttributeAttributeListWithCompletionHandler"]; - - [cluster readAttributeAttributeListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"OperationalCredentials AttributeList Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterOperationalCredentialsReadAttributeClusterRevisionWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPOperationalCredentials * cluster = [[CHIPOperationalCredentials alloc] initWithDevice:device endpoint:0 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"OperationalCredentialsReadAttributeClusterRevisionWithCompletionHandler"]; - - [cluster readAttributeClusterRevisionWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"OperationalCredentials ClusterRevision Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterPowerSourceReadAttributeStatusWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPPowerSource * cluster = [[CHIPPowerSource alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = [self expectationWithDescription:@"PowerSourceReadAttributeStatusWithCompletionHandler"]; - - [cluster readAttributeStatusWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"PowerSource Status Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterPowerSourceReadAttributeOrderWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPPowerSource * cluster = [[CHIPPowerSource alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = [self expectationWithDescription:@"PowerSourceReadAttributeOrderWithCompletionHandler"]; - - [cluster readAttributeOrderWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"PowerSource Order Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterPowerSourceReadAttributeDescriptionWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPPowerSource * cluster = [[CHIPPowerSource alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = [self expectationWithDescription:@"PowerSourceReadAttributeDescriptionWithCompletionHandler"]; - - [cluster readAttributeDescriptionWithCompletionHandler:^(NSString * _Nullable value, NSError * _Nullable err) { - NSLog(@"PowerSource Description Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterPowerSourceReadAttributeBatteryVoltageWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPPowerSource * cluster = [[CHIPPowerSource alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"PowerSourceReadAttributeBatteryVoltageWithCompletionHandler"]; - - [cluster readAttributeBatteryVoltageWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"PowerSource BatteryVoltage Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterPowerSourceReadAttributeBatteryPercentRemainingWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPPowerSource * cluster = [[CHIPPowerSource alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"PowerSourceReadAttributeBatteryPercentRemainingWithCompletionHandler"]; - - [cluster readAttributeBatteryPercentRemainingWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"PowerSource BatteryPercentRemaining Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterPowerSourceReadAttributeBatteryTimeRemainingWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPPowerSource * cluster = [[CHIPPowerSource alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"PowerSourceReadAttributeBatteryTimeRemainingWithCompletionHandler"]; - - [cluster readAttributeBatteryTimeRemainingWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"PowerSource BatteryTimeRemaining Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterPowerSourceReadAttributeBatteryChargeLevelWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPPowerSource * cluster = [[CHIPPowerSource alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"PowerSourceReadAttributeBatteryChargeLevelWithCompletionHandler"]; - - [cluster readAttributeBatteryChargeLevelWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"PowerSource BatteryChargeLevel Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterPowerSourceReadAttributeActiveBatteryFaultsWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPPowerSource * cluster = [[CHIPPowerSource alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"PowerSourceReadAttributeActiveBatteryFaultsWithCompletionHandler"]; - - [cluster readAttributeActiveBatteryFaultsWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"PowerSource ActiveBatteryFaults Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterPowerSourceReadAttributeBatteryChargeStateWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPPowerSource * cluster = [[CHIPPowerSource alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"PowerSourceReadAttributeBatteryChargeStateWithCompletionHandler"]; - - [cluster readAttributeBatteryChargeStateWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"PowerSource BatteryChargeState Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterPowerSourceReadAttributeServerGeneratedCommandListWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPPowerSource * cluster = [[CHIPPowerSource alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"PowerSourceReadAttributeServerGeneratedCommandListWithCompletionHandler"]; - - [cluster readAttributeServerGeneratedCommandListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"PowerSource ServerGeneratedCommandList Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterPowerSourceReadAttributeClientGeneratedCommandListWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPPowerSource * cluster = [[CHIPPowerSource alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"PowerSourceReadAttributeClientGeneratedCommandListWithCompletionHandler"]; - - [cluster readAttributeClientGeneratedCommandListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"PowerSource ClientGeneratedCommandList Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterPowerSourceReadAttributeAttributeListWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPPowerSource * cluster = [[CHIPPowerSource alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"PowerSourceReadAttributeAttributeListWithCompletionHandler"]; - - [cluster readAttributeAttributeListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"PowerSource AttributeList Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterPowerSourceReadAttributeFeatureMapWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPPowerSource * cluster = [[CHIPPowerSource alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = [self expectationWithDescription:@"PowerSourceReadAttributeFeatureMapWithCompletionHandler"]; - - [cluster readAttributeFeatureMapWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"PowerSource FeatureMap Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterPowerSourceReadAttributeClusterRevisionWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPPowerSource * cluster = [[CHIPPowerSource alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"PowerSourceReadAttributeClusterRevisionWithCompletionHandler"]; - - [cluster readAttributeClusterRevisionWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"PowerSource ClusterRevision Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterPowerSourceConfigurationReadAttributeSourcesWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPPowerSourceConfiguration * cluster = [[CHIPPowerSourceConfiguration alloc] initWithDevice:device endpoint:0 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"PowerSourceConfigurationReadAttributeSourcesWithCompletionHandler"]; - - [cluster readAttributeSourcesWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"PowerSourceConfiguration Sources Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterPowerSourceConfigurationReadAttributeServerGeneratedCommandListWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPPowerSourceConfiguration * cluster = [[CHIPPowerSourceConfiguration alloc] initWithDevice:device endpoint:0 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"PowerSourceConfigurationReadAttributeServerGeneratedCommandListWithCompletionHandler"]; - - [cluster readAttributeServerGeneratedCommandListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"PowerSourceConfiguration ServerGeneratedCommandList Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterPowerSourceConfigurationReadAttributeClientGeneratedCommandListWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPPowerSourceConfiguration * cluster = [[CHIPPowerSourceConfiguration alloc] initWithDevice:device endpoint:0 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"PowerSourceConfigurationReadAttributeClientGeneratedCommandListWithCompletionHandler"]; - - [cluster readAttributeClientGeneratedCommandListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"PowerSourceConfiguration ClientGeneratedCommandList Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterPowerSourceConfigurationReadAttributeAttributeListWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPPowerSourceConfiguration * cluster = [[CHIPPowerSourceConfiguration alloc] initWithDevice:device endpoint:0 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"PowerSourceConfigurationReadAttributeAttributeListWithCompletionHandler"]; - - [cluster readAttributeAttributeListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"PowerSourceConfiguration AttributeList Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterPowerSourceConfigurationReadAttributeClusterRevisionWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPPowerSourceConfiguration * cluster = [[CHIPPowerSourceConfiguration alloc] initWithDevice:device endpoint:0 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"PowerSourceConfigurationReadAttributeClusterRevisionWithCompletionHandler"]; - - [cluster readAttributeClusterRevisionWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"PowerSourceConfiguration ClusterRevision Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterPressureMeasurementReadAttributeMeasuredValueWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPPressureMeasurement * cluster = [[CHIPPressureMeasurement alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"PressureMeasurementReadAttributeMeasuredValueWithCompletionHandler"]; - - [cluster readAttributeMeasuredValueWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"PressureMeasurement MeasuredValue Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterPressureMeasurementReadAttributeMinMeasuredValueWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPPressureMeasurement * cluster = [[CHIPPressureMeasurement alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"PressureMeasurementReadAttributeMinMeasuredValueWithCompletionHandler"]; - - [cluster readAttributeMinMeasuredValueWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"PressureMeasurement MinMeasuredValue Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterPressureMeasurementReadAttributeMaxMeasuredValueWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPPressureMeasurement * cluster = [[CHIPPressureMeasurement alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"PressureMeasurementReadAttributeMaxMeasuredValueWithCompletionHandler"]; - - [cluster readAttributeMaxMeasuredValueWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"PressureMeasurement MaxMeasuredValue Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterPressureMeasurementReadAttributeAttributeListWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPPressureMeasurement * cluster = [[CHIPPressureMeasurement alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"PressureMeasurementReadAttributeAttributeListWithCompletionHandler"]; - - [cluster readAttributeAttributeListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"PressureMeasurement AttributeList Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterPressureMeasurementReadAttributeClusterRevisionWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPPressureMeasurement * cluster = [[CHIPPressureMeasurement alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"PressureMeasurementReadAttributeClusterRevisionWithCompletionHandler"]; - - [cluster readAttributeClusterRevisionWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"PressureMeasurement ClusterRevision Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterPumpConfigurationAndControlReadAttributeMaxPressureWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPPumpConfigurationAndControl * cluster = [[CHIPPumpConfigurationAndControl alloc] initWithDevice:device - endpoint:1 - queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"PumpConfigurationAndControlReadAttributeMaxPressureWithCompletionHandler"]; - - [cluster readAttributeMaxPressureWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"PumpConfigurationAndControl MaxPressure Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterPumpConfigurationAndControlReadAttributeMaxSpeedWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPPumpConfigurationAndControl * cluster = [[CHIPPumpConfigurationAndControl alloc] initWithDevice:device - endpoint:1 - queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"PumpConfigurationAndControlReadAttributeMaxSpeedWithCompletionHandler"]; - - [cluster readAttributeMaxSpeedWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"PumpConfigurationAndControl MaxSpeed Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterPumpConfigurationAndControlReadAttributeMaxFlowWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPPumpConfigurationAndControl * cluster = [[CHIPPumpConfigurationAndControl alloc] initWithDevice:device - endpoint:1 - queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"PumpConfigurationAndControlReadAttributeMaxFlowWithCompletionHandler"]; - - [cluster readAttributeMaxFlowWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"PumpConfigurationAndControl MaxFlow Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterPumpConfigurationAndControlReadAttributeMinConstPressureWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPPumpConfigurationAndControl * cluster = [[CHIPPumpConfigurationAndControl alloc] initWithDevice:device - endpoint:1 - queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"PumpConfigurationAndControlReadAttributeMinConstPressureWithCompletionHandler"]; - - [cluster readAttributeMinConstPressureWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"PumpConfigurationAndControl MinConstPressure Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterPumpConfigurationAndControlReadAttributeMaxConstPressureWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPPumpConfigurationAndControl * cluster = [[CHIPPumpConfigurationAndControl alloc] initWithDevice:device - endpoint:1 - queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"PumpConfigurationAndControlReadAttributeMaxConstPressureWithCompletionHandler"]; - - [cluster readAttributeMaxConstPressureWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"PumpConfigurationAndControl MaxConstPressure Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterPumpConfigurationAndControlReadAttributeMinCompPressureWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPPumpConfigurationAndControl * cluster = [[CHIPPumpConfigurationAndControl alloc] initWithDevice:device - endpoint:1 - queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"PumpConfigurationAndControlReadAttributeMinCompPressureWithCompletionHandler"]; - - [cluster readAttributeMinCompPressureWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"PumpConfigurationAndControl MinCompPressure Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterPumpConfigurationAndControlReadAttributeMaxCompPressureWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPPumpConfigurationAndControl * cluster = [[CHIPPumpConfigurationAndControl alloc] initWithDevice:device - endpoint:1 - queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"PumpConfigurationAndControlReadAttributeMaxCompPressureWithCompletionHandler"]; - - [cluster readAttributeMaxCompPressureWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"PumpConfigurationAndControl MaxCompPressure Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterPumpConfigurationAndControlReadAttributeMinConstSpeedWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPPumpConfigurationAndControl * cluster = [[CHIPPumpConfigurationAndControl alloc] initWithDevice:device - endpoint:1 - queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"PumpConfigurationAndControlReadAttributeMinConstSpeedWithCompletionHandler"]; - - [cluster readAttributeMinConstSpeedWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"PumpConfigurationAndControl MinConstSpeed Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterPumpConfigurationAndControlReadAttributeMaxConstSpeedWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPPumpConfigurationAndControl * cluster = [[CHIPPumpConfigurationAndControl alloc] initWithDevice:device - endpoint:1 - queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"PumpConfigurationAndControlReadAttributeMaxConstSpeedWithCompletionHandler"]; - - [cluster readAttributeMaxConstSpeedWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"PumpConfigurationAndControl MaxConstSpeed Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterPumpConfigurationAndControlReadAttributeMinConstFlowWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPPumpConfigurationAndControl * cluster = [[CHIPPumpConfigurationAndControl alloc] initWithDevice:device - endpoint:1 - queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"PumpConfigurationAndControlReadAttributeMinConstFlowWithCompletionHandler"]; - - [cluster readAttributeMinConstFlowWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"PumpConfigurationAndControl MinConstFlow Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterPumpConfigurationAndControlReadAttributeMaxConstFlowWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPPumpConfigurationAndControl * cluster = [[CHIPPumpConfigurationAndControl alloc] initWithDevice:device - endpoint:1 - queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"PumpConfigurationAndControlReadAttributeMaxConstFlowWithCompletionHandler"]; - - [cluster readAttributeMaxConstFlowWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"PumpConfigurationAndControl MaxConstFlow Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterPumpConfigurationAndControlReadAttributeMinConstTempWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPPumpConfigurationAndControl * cluster = [[CHIPPumpConfigurationAndControl alloc] initWithDevice:device - endpoint:1 - queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"PumpConfigurationAndControlReadAttributeMinConstTempWithCompletionHandler"]; - - [cluster readAttributeMinConstTempWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"PumpConfigurationAndControl MinConstTemp Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterPumpConfigurationAndControlReadAttributeMaxConstTempWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPPumpConfigurationAndControl * cluster = [[CHIPPumpConfigurationAndControl alloc] initWithDevice:device - endpoint:1 - queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"PumpConfigurationAndControlReadAttributeMaxConstTempWithCompletionHandler"]; - - [cluster readAttributeMaxConstTempWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"PumpConfigurationAndControl MaxConstTemp Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterPumpConfigurationAndControlReadAttributePumpStatusWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPPumpConfigurationAndControl * cluster = [[CHIPPumpConfigurationAndControl alloc] initWithDevice:device - endpoint:1 - queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"PumpConfigurationAndControlReadAttributePumpStatusWithCompletionHandler"]; - - [cluster readAttributePumpStatusWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"PumpConfigurationAndControl PumpStatus Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterPumpConfigurationAndControlReadAttributeEffectiveOperationModeWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPPumpConfigurationAndControl * cluster = [[CHIPPumpConfigurationAndControl alloc] initWithDevice:device - endpoint:1 - queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"PumpConfigurationAndControlReadAttributeEffectiveOperationModeWithCompletionHandler"]; - - [cluster readAttributeEffectiveOperationModeWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"PumpConfigurationAndControl EffectiveOperationMode Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterPumpConfigurationAndControlReadAttributeEffectiveControlModeWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPPumpConfigurationAndControl * cluster = [[CHIPPumpConfigurationAndControl alloc] initWithDevice:device - endpoint:1 - queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"PumpConfigurationAndControlReadAttributeEffectiveControlModeWithCompletionHandler"]; - - [cluster readAttributeEffectiveControlModeWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"PumpConfigurationAndControl EffectiveControlMode Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterPumpConfigurationAndControlReadAttributeCapacityWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPPumpConfigurationAndControl * cluster = [[CHIPPumpConfigurationAndControl alloc] initWithDevice:device - endpoint:1 - queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"PumpConfigurationAndControlReadAttributeCapacityWithCompletionHandler"]; - - [cluster readAttributeCapacityWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"PumpConfigurationAndControl Capacity Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterPumpConfigurationAndControlReadAttributeSpeedWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPPumpConfigurationAndControl * cluster = [[CHIPPumpConfigurationAndControl alloc] initWithDevice:device - endpoint:1 - queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"PumpConfigurationAndControlReadAttributeSpeedWithCompletionHandler"]; - - [cluster readAttributeSpeedWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"PumpConfigurationAndControl Speed Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterPumpConfigurationAndControlReadAttributeLifetimeRunningHoursWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPPumpConfigurationAndControl * cluster = [[CHIPPumpConfigurationAndControl alloc] initWithDevice:device - endpoint:1 - queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"PumpConfigurationAndControlReadAttributeLifetimeRunningHoursWithCompletionHandler"]; - - [cluster readAttributeLifetimeRunningHoursWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"PumpConfigurationAndControl LifetimeRunningHours Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterPumpConfigurationAndControlWriteAttributeLifetimeRunningHoursWithValue -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPPumpConfigurationAndControl * cluster = [[CHIPPumpConfigurationAndControl alloc] initWithDevice:device - endpoint:1 - queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"PumpConfigurationAndControlWriteAttributeLifetimeRunningHoursWithValue"]; - - NSNumber * _Nullable value = @(0); - [cluster writeAttributeLifetimeRunningHoursWithValue:value - completionHandler:^(NSError * _Nullable err) { - NSLog(@"PumpConfigurationAndControl LifetimeRunningHours Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterPumpConfigurationAndControlReadAttributePowerWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPPumpConfigurationAndControl * cluster = [[CHIPPumpConfigurationAndControl alloc] initWithDevice:device - endpoint:1 - queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"PumpConfigurationAndControlReadAttributePowerWithCompletionHandler"]; - - [cluster readAttributePowerWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"PumpConfigurationAndControl Power Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterPumpConfigurationAndControlReadAttributeLifetimeEnergyConsumedWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPPumpConfigurationAndControl * cluster = [[CHIPPumpConfigurationAndControl alloc] initWithDevice:device - endpoint:1 - queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"PumpConfigurationAndControlReadAttributeLifetimeEnergyConsumedWithCompletionHandler"]; - - [cluster readAttributeLifetimeEnergyConsumedWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"PumpConfigurationAndControl LifetimeEnergyConsumed Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterPumpConfigurationAndControlWriteAttributeLifetimeEnergyConsumedWithValue -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPPumpConfigurationAndControl * cluster = [[CHIPPumpConfigurationAndControl alloc] initWithDevice:device - endpoint:1 - queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"PumpConfigurationAndControlWriteAttributeLifetimeEnergyConsumedWithValue"]; - - NSNumber * _Nullable value = @(0); - [cluster writeAttributeLifetimeEnergyConsumedWithValue:value - completionHandler:^(NSError * _Nullable err) { - NSLog(@"PumpConfigurationAndControl LifetimeEnergyConsumed Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterPumpConfigurationAndControlReadAttributeOperationModeWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPPumpConfigurationAndControl * cluster = [[CHIPPumpConfigurationAndControl alloc] initWithDevice:device - endpoint:1 - queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"PumpConfigurationAndControlReadAttributeOperationModeWithCompletionHandler"]; - - [cluster readAttributeOperationModeWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"PumpConfigurationAndControl OperationMode Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterPumpConfigurationAndControlWriteAttributeOperationModeWithValue -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPPumpConfigurationAndControl * cluster = [[CHIPPumpConfigurationAndControl alloc] initWithDevice:device - endpoint:1 - queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"PumpConfigurationAndControlWriteAttributeOperationModeWithValue"]; - - NSNumber * _Nonnull value = @(0x00); - [cluster writeAttributeOperationModeWithValue:value - completionHandler:^(NSError * _Nullable err) { - NSLog(@"PumpConfigurationAndControl OperationMode Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterPumpConfigurationAndControlReadAttributeControlModeWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPPumpConfigurationAndControl * cluster = [[CHIPPumpConfigurationAndControl alloc] initWithDevice:device - endpoint:1 - queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"PumpConfigurationAndControlReadAttributeControlModeWithCompletionHandler"]; - - [cluster readAttributeControlModeWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"PumpConfigurationAndControl ControlMode Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterPumpConfigurationAndControlWriteAttributeControlModeWithValue -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPPumpConfigurationAndControl * cluster = [[CHIPPumpConfigurationAndControl alloc] initWithDevice:device - endpoint:1 - queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"PumpConfigurationAndControlWriteAttributeControlModeWithValue"]; - - NSNumber * _Nonnull value = @(0x00); - [cluster writeAttributeControlModeWithValue:value - completionHandler:^(NSError * _Nullable err) { - NSLog(@"PumpConfigurationAndControl ControlMode Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterPumpConfigurationAndControlReadAttributeAlarmMaskWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPPumpConfigurationAndControl * cluster = [[CHIPPumpConfigurationAndControl alloc] initWithDevice:device - endpoint:1 - queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"PumpConfigurationAndControlReadAttributeAlarmMaskWithCompletionHandler"]; - - [cluster readAttributeAlarmMaskWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"PumpConfigurationAndControl AlarmMask Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterPumpConfigurationAndControlReadAttributeServerGeneratedCommandListWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPPumpConfigurationAndControl * cluster = [[CHIPPumpConfigurationAndControl alloc] initWithDevice:device - endpoint:1 - queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = [self - expectationWithDescription:@"PumpConfigurationAndControlReadAttributeServerGeneratedCommandListWithCompletionHandler"]; - - [cluster readAttributeServerGeneratedCommandListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"PumpConfigurationAndControl ServerGeneratedCommandList Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterPumpConfigurationAndControlReadAttributeClientGeneratedCommandListWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPPumpConfigurationAndControl * cluster = [[CHIPPumpConfigurationAndControl alloc] initWithDevice:device - endpoint:1 - queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = [self - expectationWithDescription:@"PumpConfigurationAndControlReadAttributeClientGeneratedCommandListWithCompletionHandler"]; - - [cluster readAttributeClientGeneratedCommandListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"PumpConfigurationAndControl ClientGeneratedCommandList Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterPumpConfigurationAndControlReadAttributeAttributeListWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPPumpConfigurationAndControl * cluster = [[CHIPPumpConfigurationAndControl alloc] initWithDevice:device - endpoint:1 - queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"PumpConfigurationAndControlReadAttributeAttributeListWithCompletionHandler"]; - - [cluster readAttributeAttributeListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"PumpConfigurationAndControl AttributeList Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterPumpConfigurationAndControlReadAttributeFeatureMapWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPPumpConfigurationAndControl * cluster = [[CHIPPumpConfigurationAndControl alloc] initWithDevice:device - endpoint:1 - queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"PumpConfigurationAndControlReadAttributeFeatureMapWithCompletionHandler"]; - - [cluster readAttributeFeatureMapWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"PumpConfigurationAndControl FeatureMap Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterPumpConfigurationAndControlReadAttributeClusterRevisionWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPPumpConfigurationAndControl * cluster = [[CHIPPumpConfigurationAndControl alloc] initWithDevice:device - endpoint:1 - queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"PumpConfigurationAndControlReadAttributeClusterRevisionWithCompletionHandler"]; - - [cluster readAttributeClusterRevisionWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"PumpConfigurationAndControl ClusterRevision Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterRelativeHumidityMeasurementReadAttributeMeasuredValueWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPRelativeHumidityMeasurement * cluster = [[CHIPRelativeHumidityMeasurement alloc] initWithDevice:device - endpoint:1 - queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"RelativeHumidityMeasurementReadAttributeMeasuredValueWithCompletionHandler"]; - - [cluster readAttributeMeasuredValueWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"RelativeHumidityMeasurement MeasuredValue Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterRelativeHumidityMeasurementReadAttributeMinMeasuredValueWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPRelativeHumidityMeasurement * cluster = [[CHIPRelativeHumidityMeasurement alloc] initWithDevice:device - endpoint:1 - queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"RelativeHumidityMeasurementReadAttributeMinMeasuredValueWithCompletionHandler"]; - - [cluster readAttributeMinMeasuredValueWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"RelativeHumidityMeasurement MinMeasuredValue Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterRelativeHumidityMeasurementReadAttributeMaxMeasuredValueWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPRelativeHumidityMeasurement * cluster = [[CHIPRelativeHumidityMeasurement alloc] initWithDevice:device - endpoint:1 - queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"RelativeHumidityMeasurementReadAttributeMaxMeasuredValueWithCompletionHandler"]; - - [cluster readAttributeMaxMeasuredValueWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"RelativeHumidityMeasurement MaxMeasuredValue Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterRelativeHumidityMeasurementReadAttributeToleranceWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPRelativeHumidityMeasurement * cluster = [[CHIPRelativeHumidityMeasurement alloc] initWithDevice:device - endpoint:1 - queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"RelativeHumidityMeasurementReadAttributeToleranceWithCompletionHandler"]; - - [cluster readAttributeToleranceWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"RelativeHumidityMeasurement Tolerance Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterRelativeHumidityMeasurementReadAttributeServerGeneratedCommandListWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPRelativeHumidityMeasurement * cluster = [[CHIPRelativeHumidityMeasurement alloc] initWithDevice:device - endpoint:1 - queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = [self - expectationWithDescription:@"RelativeHumidityMeasurementReadAttributeServerGeneratedCommandListWithCompletionHandler"]; - - [cluster readAttributeServerGeneratedCommandListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"RelativeHumidityMeasurement ServerGeneratedCommandList Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterRelativeHumidityMeasurementReadAttributeClientGeneratedCommandListWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPRelativeHumidityMeasurement * cluster = [[CHIPRelativeHumidityMeasurement alloc] initWithDevice:device - endpoint:1 - queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = [self - expectationWithDescription:@"RelativeHumidityMeasurementReadAttributeClientGeneratedCommandListWithCompletionHandler"]; - - [cluster readAttributeClientGeneratedCommandListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"RelativeHumidityMeasurement ClientGeneratedCommandList Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterRelativeHumidityMeasurementReadAttributeAttributeListWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPRelativeHumidityMeasurement * cluster = [[CHIPRelativeHumidityMeasurement alloc] initWithDevice:device - endpoint:1 - queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"RelativeHumidityMeasurementReadAttributeAttributeListWithCompletionHandler"]; - - [cluster readAttributeAttributeListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"RelativeHumidityMeasurement AttributeList Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterRelativeHumidityMeasurementReadAttributeClusterRevisionWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPRelativeHumidityMeasurement * cluster = [[CHIPRelativeHumidityMeasurement alloc] initWithDevice:device - endpoint:1 - queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"RelativeHumidityMeasurementReadAttributeClusterRevisionWithCompletionHandler"]; - - [cluster readAttributeClusterRevisionWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"RelativeHumidityMeasurement ClusterRevision Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterScenesReadAttributeSceneCountWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPScenes * cluster = [[CHIPScenes alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = [self expectationWithDescription:@"ScenesReadAttributeSceneCountWithCompletionHandler"]; - - [cluster readAttributeSceneCountWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Scenes SceneCount Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterScenesReadAttributeCurrentSceneWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPScenes * cluster = [[CHIPScenes alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = [self expectationWithDescription:@"ScenesReadAttributeCurrentSceneWithCompletionHandler"]; - - [cluster readAttributeCurrentSceneWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Scenes CurrentScene Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterScenesReadAttributeCurrentGroupWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPScenes * cluster = [[CHIPScenes alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = [self expectationWithDescription:@"ScenesReadAttributeCurrentGroupWithCompletionHandler"]; - - [cluster readAttributeCurrentGroupWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Scenes CurrentGroup Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterScenesReadAttributeSceneValidWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPScenes * cluster = [[CHIPScenes alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = [self expectationWithDescription:@"ScenesReadAttributeSceneValidWithCompletionHandler"]; - - [cluster readAttributeSceneValidWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Scenes SceneValid Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterScenesReadAttributeNameSupportWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPScenes * cluster = [[CHIPScenes alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = [self expectationWithDescription:@"ScenesReadAttributeNameSupportWithCompletionHandler"]; - - [cluster readAttributeNameSupportWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Scenes NameSupport Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterScenesReadAttributeServerGeneratedCommandListWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPScenes * cluster = [[CHIPScenes alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"ScenesReadAttributeServerGeneratedCommandListWithCompletionHandler"]; - - [cluster readAttributeServerGeneratedCommandListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"Scenes ServerGeneratedCommandList Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterScenesReadAttributeClientGeneratedCommandListWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPScenes * cluster = [[CHIPScenes alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"ScenesReadAttributeClientGeneratedCommandListWithCompletionHandler"]; - - [cluster readAttributeClientGeneratedCommandListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"Scenes ClientGeneratedCommandList Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterScenesReadAttributeAttributeListWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPScenes * cluster = [[CHIPScenes alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = [self expectationWithDescription:@"ScenesReadAttributeAttributeListWithCompletionHandler"]; - - [cluster readAttributeAttributeListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"Scenes AttributeList Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterScenesReadAttributeClusterRevisionWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPScenes * cluster = [[CHIPScenes alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = [self expectationWithDescription:@"ScenesReadAttributeClusterRevisionWithCompletionHandler"]; - - [cluster readAttributeClusterRevisionWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Scenes ClusterRevision Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterSoftwareDiagnosticsReadAttributeThreadMetricsWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPSoftwareDiagnostics * cluster = [[CHIPSoftwareDiagnostics alloc] initWithDevice:device endpoint:0 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"SoftwareDiagnosticsReadAttributeThreadMetricsWithCompletionHandler"]; - - [cluster readAttributeThreadMetricsWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"SoftwareDiagnostics ThreadMetrics Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterSoftwareDiagnosticsReadAttributeCurrentHeapFreeWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPSoftwareDiagnostics * cluster = [[CHIPSoftwareDiagnostics alloc] initWithDevice:device endpoint:0 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"SoftwareDiagnosticsReadAttributeCurrentHeapFreeWithCompletionHandler"]; - - [cluster readAttributeCurrentHeapFreeWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"SoftwareDiagnostics CurrentHeapFree Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterSoftwareDiagnosticsReadAttributeCurrentHeapUsedWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPSoftwareDiagnostics * cluster = [[CHIPSoftwareDiagnostics alloc] initWithDevice:device endpoint:0 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"SoftwareDiagnosticsReadAttributeCurrentHeapUsedWithCompletionHandler"]; - - [cluster readAttributeCurrentHeapUsedWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"SoftwareDiagnostics CurrentHeapUsed Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterSoftwareDiagnosticsReadAttributeCurrentHeapHighWatermarkWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPSoftwareDiagnostics * cluster = [[CHIPSoftwareDiagnostics alloc] initWithDevice:device endpoint:0 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"SoftwareDiagnosticsReadAttributeCurrentHeapHighWatermarkWithCompletionHandler"]; - - [cluster readAttributeCurrentHeapHighWatermarkWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"SoftwareDiagnostics CurrentHeapHighWatermark Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterSoftwareDiagnosticsReadAttributeServerGeneratedCommandListWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPSoftwareDiagnostics * cluster = [[CHIPSoftwareDiagnostics alloc] initWithDevice:device endpoint:0 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"SoftwareDiagnosticsReadAttributeServerGeneratedCommandListWithCompletionHandler"]; - - [cluster readAttributeServerGeneratedCommandListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"SoftwareDiagnostics ServerGeneratedCommandList Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterSoftwareDiagnosticsReadAttributeClientGeneratedCommandListWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPSoftwareDiagnostics * cluster = [[CHIPSoftwareDiagnostics alloc] initWithDevice:device endpoint:0 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"SoftwareDiagnosticsReadAttributeClientGeneratedCommandListWithCompletionHandler"]; - - [cluster readAttributeClientGeneratedCommandListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"SoftwareDiagnostics ClientGeneratedCommandList Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterSoftwareDiagnosticsReadAttributeAttributeListWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPSoftwareDiagnostics * cluster = [[CHIPSoftwareDiagnostics alloc] initWithDevice:device endpoint:0 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"SoftwareDiagnosticsReadAttributeAttributeListWithCompletionHandler"]; - - [cluster readAttributeAttributeListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"SoftwareDiagnostics AttributeList Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterSoftwareDiagnosticsReadAttributeFeatureMapWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPSoftwareDiagnostics * cluster = [[CHIPSoftwareDiagnostics alloc] initWithDevice:device endpoint:0 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"SoftwareDiagnosticsReadAttributeFeatureMapWithCompletionHandler"]; - - [cluster readAttributeFeatureMapWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"SoftwareDiagnostics FeatureMap Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterSoftwareDiagnosticsReadAttributeClusterRevisionWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPSoftwareDiagnostics * cluster = [[CHIPSoftwareDiagnostics alloc] initWithDevice:device endpoint:0 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"SoftwareDiagnosticsReadAttributeClusterRevisionWithCompletionHandler"]; - - [cluster readAttributeClusterRevisionWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"SoftwareDiagnostics ClusterRevision Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterSwitchReadAttributeNumberOfPositionsWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPSwitch * cluster = [[CHIPSwitch alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"SwitchReadAttributeNumberOfPositionsWithCompletionHandler"]; - - [cluster readAttributeNumberOfPositionsWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Switch NumberOfPositions Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterSwitchReadAttributeCurrentPositionWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPSwitch * cluster = [[CHIPSwitch alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = [self expectationWithDescription:@"SwitchReadAttributeCurrentPositionWithCompletionHandler"]; - - [cluster readAttributeCurrentPositionWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Switch CurrentPosition Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterSwitchReadAttributeMultiPressMaxWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPSwitch * cluster = [[CHIPSwitch alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = [self expectationWithDescription:@"SwitchReadAttributeMultiPressMaxWithCompletionHandler"]; - - [cluster readAttributeMultiPressMaxWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Switch MultiPressMax Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterSwitchReadAttributeServerGeneratedCommandListWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPSwitch * cluster = [[CHIPSwitch alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"SwitchReadAttributeServerGeneratedCommandListWithCompletionHandler"]; - - [cluster readAttributeServerGeneratedCommandListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"Switch ServerGeneratedCommandList Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterSwitchReadAttributeClientGeneratedCommandListWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPSwitch * cluster = [[CHIPSwitch alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"SwitchReadAttributeClientGeneratedCommandListWithCompletionHandler"]; - - [cluster readAttributeClientGeneratedCommandListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"Switch ClientGeneratedCommandList Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterSwitchReadAttributeAttributeListWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPSwitch * cluster = [[CHIPSwitch alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = [self expectationWithDescription:@"SwitchReadAttributeAttributeListWithCompletionHandler"]; - - [cluster readAttributeAttributeListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"Switch AttributeList Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterSwitchReadAttributeFeatureMapWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPSwitch * cluster = [[CHIPSwitch alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = [self expectationWithDescription:@"SwitchReadAttributeFeatureMapWithCompletionHandler"]; - - [cluster readAttributeFeatureMapWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Switch FeatureMap Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterSwitchReadAttributeClusterRevisionWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPSwitch * cluster = [[CHIPSwitch alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = [self expectationWithDescription:@"SwitchReadAttributeClusterRevisionWithCompletionHandler"]; - - [cluster readAttributeClusterRevisionWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Switch ClusterRevision Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterTargetNavigatorReadAttributeTargetNavigatorListWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPTargetNavigator * cluster = [[CHIPTargetNavigator alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"TargetNavigatorReadAttributeTargetNavigatorListWithCompletionHandler"]; - - [cluster readAttributeTargetNavigatorListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"TargetNavigator TargetNavigatorList Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterTargetNavigatorReadAttributeCurrentNavigatorTargetWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPTargetNavigator * cluster = [[CHIPTargetNavigator alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"TargetNavigatorReadAttributeCurrentNavigatorTargetWithCompletionHandler"]; - - [cluster readAttributeCurrentNavigatorTargetWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"TargetNavigator CurrentNavigatorTarget Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterTargetNavigatorReadAttributeServerGeneratedCommandListWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPTargetNavigator * cluster = [[CHIPTargetNavigator alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"TargetNavigatorReadAttributeServerGeneratedCommandListWithCompletionHandler"]; - - [cluster readAttributeServerGeneratedCommandListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"TargetNavigator ServerGeneratedCommandList Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterTargetNavigatorReadAttributeClientGeneratedCommandListWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPTargetNavigator * cluster = [[CHIPTargetNavigator alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"TargetNavigatorReadAttributeClientGeneratedCommandListWithCompletionHandler"]; - - [cluster readAttributeClientGeneratedCommandListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"TargetNavigator ClientGeneratedCommandList Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterTargetNavigatorReadAttributeAttributeListWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPTargetNavigator * cluster = [[CHIPTargetNavigator alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"TargetNavigatorReadAttributeAttributeListWithCompletionHandler"]; - - [cluster readAttributeAttributeListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"TargetNavigator AttributeList Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterTargetNavigatorReadAttributeClusterRevisionWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPTargetNavigator * cluster = [[CHIPTargetNavigator alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"TargetNavigatorReadAttributeClusterRevisionWithCompletionHandler"]; - - [cluster readAttributeClusterRevisionWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"TargetNavigator ClusterRevision Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterTemperatureMeasurementReadAttributeMeasuredValueWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPTemperatureMeasurement * cluster = [[CHIPTemperatureMeasurement alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"TemperatureMeasurementReadAttributeMeasuredValueWithCompletionHandler"]; - - [cluster readAttributeMeasuredValueWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"TemperatureMeasurement MeasuredValue Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterTemperatureMeasurementReadAttributeMinMeasuredValueWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPTemperatureMeasurement * cluster = [[CHIPTemperatureMeasurement alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"TemperatureMeasurementReadAttributeMinMeasuredValueWithCompletionHandler"]; - - [cluster readAttributeMinMeasuredValueWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"TemperatureMeasurement MinMeasuredValue Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterTemperatureMeasurementReadAttributeMaxMeasuredValueWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPTemperatureMeasurement * cluster = [[CHIPTemperatureMeasurement alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"TemperatureMeasurementReadAttributeMaxMeasuredValueWithCompletionHandler"]; - - [cluster readAttributeMaxMeasuredValueWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"TemperatureMeasurement MaxMeasuredValue Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterTemperatureMeasurementReadAttributeToleranceWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPTemperatureMeasurement * cluster = [[CHIPTemperatureMeasurement alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"TemperatureMeasurementReadAttributeToleranceWithCompletionHandler"]; - - [cluster readAttributeToleranceWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"TemperatureMeasurement Tolerance Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterTemperatureMeasurementReadAttributeAttributeListWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPTemperatureMeasurement * cluster = [[CHIPTemperatureMeasurement alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"TemperatureMeasurementReadAttributeAttributeListWithCompletionHandler"]; - - [cluster readAttributeAttributeListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"TemperatureMeasurement AttributeList Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterTemperatureMeasurementReadAttributeClusterRevisionWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPTemperatureMeasurement * cluster = [[CHIPTemperatureMeasurement alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"TemperatureMeasurementReadAttributeClusterRevisionWithCompletionHandler"]; - - [cluster readAttributeClusterRevisionWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"TemperatureMeasurement ClusterRevision Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterThermostatUserInterfaceConfigurationReadAttributeTemperatureDisplayModeWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPThermostatUserInterfaceConfiguration * cluster = [[CHIPThermostatUserInterfaceConfiguration alloc] initWithDevice:device - endpoint:1 - queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = [self - expectationWithDescription:@"ThermostatUserInterfaceConfigurationReadAttributeTemperatureDisplayModeWithCompletionHandler"]; - - [cluster readAttributeTemperatureDisplayModeWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"ThermostatUserInterfaceConfiguration TemperatureDisplayMode Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterThermostatUserInterfaceConfigurationWriteAttributeTemperatureDisplayModeWithValue -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPThermostatUserInterfaceConfiguration * cluster = [[CHIPThermostatUserInterfaceConfiguration alloc] initWithDevice:device - endpoint:1 - queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"ThermostatUserInterfaceConfigurationWriteAttributeTemperatureDisplayModeWithValue"]; - - NSNumber * _Nonnull value = @(0x00); - [cluster writeAttributeTemperatureDisplayModeWithValue:value - completionHandler:^(NSError * _Nullable err) { - NSLog(@"ThermostatUserInterfaceConfiguration TemperatureDisplayMode Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterThermostatUserInterfaceConfigurationReadAttributeKeypadLockoutWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPThermostatUserInterfaceConfiguration * cluster = [[CHIPThermostatUserInterfaceConfiguration alloc] initWithDevice:device - endpoint:1 - queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"ThermostatUserInterfaceConfigurationReadAttributeKeypadLockoutWithCompletionHandler"]; - - [cluster readAttributeKeypadLockoutWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"ThermostatUserInterfaceConfiguration KeypadLockout Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterThermostatUserInterfaceConfigurationWriteAttributeKeypadLockoutWithValue -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPThermostatUserInterfaceConfiguration * cluster = [[CHIPThermostatUserInterfaceConfiguration alloc] initWithDevice:device - endpoint:1 - queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"ThermostatUserInterfaceConfigurationWriteAttributeKeypadLockoutWithValue"]; - - NSNumber * _Nonnull value = @(0x00); - [cluster writeAttributeKeypadLockoutWithValue:value - completionHandler:^(NSError * _Nullable err) { - NSLog(@"ThermostatUserInterfaceConfiguration KeypadLockout Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterThermostatUserInterfaceConfigurationReadAttributeScheduleProgrammingVisibilityWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPThermostatUserInterfaceConfiguration * cluster = [[CHIPThermostatUserInterfaceConfiguration alloc] initWithDevice:device - endpoint:1 - queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription: - @"ThermostatUserInterfaceConfigurationReadAttributeScheduleProgrammingVisibilityWithCompletionHandler"]; - - [cluster - readAttributeScheduleProgrammingVisibilityWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"ThermostatUserInterfaceConfiguration ScheduleProgrammingVisibility Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterThermostatUserInterfaceConfigurationWriteAttributeScheduleProgrammingVisibilityWithValue -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPThermostatUserInterfaceConfiguration * cluster = [[CHIPThermostatUserInterfaceConfiguration alloc] initWithDevice:device - endpoint:1 - queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = [self - expectationWithDescription:@"ThermostatUserInterfaceConfigurationWriteAttributeScheduleProgrammingVisibilityWithValue"]; - - NSNumber * _Nonnull value = @(0x00); - [cluster - writeAttributeScheduleProgrammingVisibilityWithValue:value - completionHandler:^(NSError * _Nullable err) { - NSLog( - @"ThermostatUserInterfaceConfiguration ScheduleProgrammingVisibility Error: %@", - err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterThermostatUserInterfaceConfigurationReadAttributeServerGeneratedCommandListWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPThermostatUserInterfaceConfiguration * cluster = [[CHIPThermostatUserInterfaceConfiguration alloc] initWithDevice:device - endpoint:1 - queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription: - @"ThermostatUserInterfaceConfigurationReadAttributeServerGeneratedCommandListWithCompletionHandler"]; - - [cluster readAttributeServerGeneratedCommandListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"ThermostatUserInterfaceConfiguration ServerGeneratedCommandList Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterThermostatUserInterfaceConfigurationReadAttributeClientGeneratedCommandListWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPThermostatUserInterfaceConfiguration * cluster = [[CHIPThermostatUserInterfaceConfiguration alloc] initWithDevice:device - endpoint:1 - queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription: - @"ThermostatUserInterfaceConfigurationReadAttributeClientGeneratedCommandListWithCompletionHandler"]; - - [cluster readAttributeClientGeneratedCommandListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"ThermostatUserInterfaceConfiguration ClientGeneratedCommandList Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterThermostatUserInterfaceConfigurationReadAttributeAttributeListWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPThermostatUserInterfaceConfiguration * cluster = [[CHIPThermostatUserInterfaceConfiguration alloc] initWithDevice:device - endpoint:1 - queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"ThermostatUserInterfaceConfigurationReadAttributeAttributeListWithCompletionHandler"]; - - [cluster readAttributeAttributeListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"ThermostatUserInterfaceConfiguration AttributeList Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterThermostatUserInterfaceConfigurationReadAttributeClusterRevisionWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPThermostatUserInterfaceConfiguration * cluster = [[CHIPThermostatUserInterfaceConfiguration alloc] initWithDevice:device - endpoint:1 - queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"ThermostatUserInterfaceConfigurationReadAttributeClusterRevisionWithCompletionHandler"]; - - [cluster readAttributeClusterRevisionWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"ThermostatUserInterfaceConfiguration ClusterRevision Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterThreadNetworkDiagnosticsReadAttributeChannelWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPThreadNetworkDiagnostics * cluster = [[CHIPThreadNetworkDiagnostics alloc] initWithDevice:device endpoint:0 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"ThreadNetworkDiagnosticsReadAttributeChannelWithCompletionHandler"]; - - [cluster readAttributeChannelWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"ThreadNetworkDiagnostics Channel Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterThreadNetworkDiagnosticsReadAttributeRoutingRoleWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPThreadNetworkDiagnostics * cluster = [[CHIPThreadNetworkDiagnostics alloc] initWithDevice:device endpoint:0 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"ThreadNetworkDiagnosticsReadAttributeRoutingRoleWithCompletionHandler"]; - - [cluster readAttributeRoutingRoleWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"ThreadNetworkDiagnostics RoutingRole Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterThreadNetworkDiagnosticsReadAttributeNetworkNameWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPThreadNetworkDiagnostics * cluster = [[CHIPThreadNetworkDiagnostics alloc] initWithDevice:device endpoint:0 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"ThreadNetworkDiagnosticsReadAttributeNetworkNameWithCompletionHandler"]; - - [cluster readAttributeNetworkNameWithCompletionHandler:^(NSString * _Nullable value, NSError * _Nullable err) { - NSLog(@"ThreadNetworkDiagnostics NetworkName Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterThreadNetworkDiagnosticsReadAttributePanIdWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPThreadNetworkDiagnostics * cluster = [[CHIPThreadNetworkDiagnostics alloc] initWithDevice:device endpoint:0 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"ThreadNetworkDiagnosticsReadAttributePanIdWithCompletionHandler"]; - - [cluster readAttributePanIdWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"ThreadNetworkDiagnostics PanId Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterThreadNetworkDiagnosticsReadAttributeExtendedPanIdWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPThreadNetworkDiagnostics * cluster = [[CHIPThreadNetworkDiagnostics alloc] initWithDevice:device endpoint:0 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"ThreadNetworkDiagnosticsReadAttributeExtendedPanIdWithCompletionHandler"]; - - [cluster readAttributeExtendedPanIdWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"ThreadNetworkDiagnostics ExtendedPanId Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterThreadNetworkDiagnosticsReadAttributeMeshLocalPrefixWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPThreadNetworkDiagnostics * cluster = [[CHIPThreadNetworkDiagnostics alloc] initWithDevice:device endpoint:0 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"ThreadNetworkDiagnosticsReadAttributeMeshLocalPrefixWithCompletionHandler"]; - - [cluster readAttributeMeshLocalPrefixWithCompletionHandler:^(NSData * _Nullable value, NSError * _Nullable err) { - NSLog(@"ThreadNetworkDiagnostics MeshLocalPrefix Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterThreadNetworkDiagnosticsReadAttributeOverrunCountWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPThreadNetworkDiagnostics * cluster = [[CHIPThreadNetworkDiagnostics alloc] initWithDevice:device endpoint:0 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"ThreadNetworkDiagnosticsReadAttributeOverrunCountWithCompletionHandler"]; - - [cluster readAttributeOverrunCountWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"ThreadNetworkDiagnostics OverrunCount Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterThreadNetworkDiagnosticsReadAttributeNeighborTableListWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPThreadNetworkDiagnostics * cluster = [[CHIPThreadNetworkDiagnostics alloc] initWithDevice:device endpoint:0 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"ThreadNetworkDiagnosticsReadAttributeNeighborTableListWithCompletionHandler"]; - - [cluster readAttributeNeighborTableListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"ThreadNetworkDiagnostics NeighborTableList Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterThreadNetworkDiagnosticsReadAttributeRouteTableListWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPThreadNetworkDiagnostics * cluster = [[CHIPThreadNetworkDiagnostics alloc] initWithDevice:device endpoint:0 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"ThreadNetworkDiagnosticsReadAttributeRouteTableListWithCompletionHandler"]; - - [cluster readAttributeRouteTableListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"ThreadNetworkDiagnostics RouteTableList Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterThreadNetworkDiagnosticsReadAttributePartitionIdWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPThreadNetworkDiagnostics * cluster = [[CHIPThreadNetworkDiagnostics alloc] initWithDevice:device endpoint:0 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"ThreadNetworkDiagnosticsReadAttributePartitionIdWithCompletionHandler"]; - - [cluster readAttributePartitionIdWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"ThreadNetworkDiagnostics PartitionId Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterThreadNetworkDiagnosticsReadAttributeWeightingWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPThreadNetworkDiagnostics * cluster = [[CHIPThreadNetworkDiagnostics alloc] initWithDevice:device endpoint:0 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"ThreadNetworkDiagnosticsReadAttributeWeightingWithCompletionHandler"]; - - [cluster readAttributeWeightingWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"ThreadNetworkDiagnostics Weighting Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterThreadNetworkDiagnosticsReadAttributeDataVersionWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPThreadNetworkDiagnostics * cluster = [[CHIPThreadNetworkDiagnostics alloc] initWithDevice:device endpoint:0 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"ThreadNetworkDiagnosticsReadAttributeDataVersionWithCompletionHandler"]; - - [cluster readAttributeDataVersionWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"ThreadNetworkDiagnostics DataVersion Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterThreadNetworkDiagnosticsReadAttributeStableDataVersionWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPThreadNetworkDiagnostics * cluster = [[CHIPThreadNetworkDiagnostics alloc] initWithDevice:device endpoint:0 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"ThreadNetworkDiagnosticsReadAttributeStableDataVersionWithCompletionHandler"]; - - [cluster readAttributeStableDataVersionWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"ThreadNetworkDiagnostics StableDataVersion Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterThreadNetworkDiagnosticsReadAttributeLeaderRouterIdWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPThreadNetworkDiagnostics * cluster = [[CHIPThreadNetworkDiagnostics alloc] initWithDevice:device endpoint:0 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"ThreadNetworkDiagnosticsReadAttributeLeaderRouterIdWithCompletionHandler"]; - - [cluster readAttributeLeaderRouterIdWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"ThreadNetworkDiagnostics LeaderRouterId Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterThreadNetworkDiagnosticsReadAttributeDetachedRoleCountWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPThreadNetworkDiagnostics * cluster = [[CHIPThreadNetworkDiagnostics alloc] initWithDevice:device endpoint:0 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"ThreadNetworkDiagnosticsReadAttributeDetachedRoleCountWithCompletionHandler"]; - - [cluster readAttributeDetachedRoleCountWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"ThreadNetworkDiagnostics DetachedRoleCount Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterThreadNetworkDiagnosticsReadAttributeChildRoleCountWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPThreadNetworkDiagnostics * cluster = [[CHIPThreadNetworkDiagnostics alloc] initWithDevice:device endpoint:0 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"ThreadNetworkDiagnosticsReadAttributeChildRoleCountWithCompletionHandler"]; - - [cluster readAttributeChildRoleCountWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"ThreadNetworkDiagnostics ChildRoleCount Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterThreadNetworkDiagnosticsReadAttributeRouterRoleCountWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPThreadNetworkDiagnostics * cluster = [[CHIPThreadNetworkDiagnostics alloc] initWithDevice:device endpoint:0 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"ThreadNetworkDiagnosticsReadAttributeRouterRoleCountWithCompletionHandler"]; - - [cluster readAttributeRouterRoleCountWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"ThreadNetworkDiagnostics RouterRoleCount Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterThreadNetworkDiagnosticsReadAttributeLeaderRoleCountWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPThreadNetworkDiagnostics * cluster = [[CHIPThreadNetworkDiagnostics alloc] initWithDevice:device endpoint:0 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"ThreadNetworkDiagnosticsReadAttributeLeaderRoleCountWithCompletionHandler"]; - - [cluster readAttributeLeaderRoleCountWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"ThreadNetworkDiagnostics LeaderRoleCount Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterThreadNetworkDiagnosticsReadAttributeAttachAttemptCountWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPThreadNetworkDiagnostics * cluster = [[CHIPThreadNetworkDiagnostics alloc] initWithDevice:device endpoint:0 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"ThreadNetworkDiagnosticsReadAttributeAttachAttemptCountWithCompletionHandler"]; - - [cluster readAttributeAttachAttemptCountWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"ThreadNetworkDiagnostics AttachAttemptCount Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterThreadNetworkDiagnosticsReadAttributePartitionIdChangeCountWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPThreadNetworkDiagnostics * cluster = [[CHIPThreadNetworkDiagnostics alloc] initWithDevice:device endpoint:0 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"ThreadNetworkDiagnosticsReadAttributePartitionIdChangeCountWithCompletionHandler"]; - - [cluster readAttributePartitionIdChangeCountWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"ThreadNetworkDiagnostics PartitionIdChangeCount Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterThreadNetworkDiagnosticsReadAttributeBetterPartitionAttachAttemptCountWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPThreadNetworkDiagnostics * cluster = [[CHIPThreadNetworkDiagnostics alloc] initWithDevice:device endpoint:0 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = [self - expectationWithDescription:@"ThreadNetworkDiagnosticsReadAttributeBetterPartitionAttachAttemptCountWithCompletionHandler"]; - - [cluster - readAttributeBetterPartitionAttachAttemptCountWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"ThreadNetworkDiagnostics BetterPartitionAttachAttemptCount Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterThreadNetworkDiagnosticsReadAttributeParentChangeCountWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPThreadNetworkDiagnostics * cluster = [[CHIPThreadNetworkDiagnostics alloc] initWithDevice:device endpoint:0 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"ThreadNetworkDiagnosticsReadAttributeParentChangeCountWithCompletionHandler"]; - - [cluster readAttributeParentChangeCountWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"ThreadNetworkDiagnostics ParentChangeCount Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterThreadNetworkDiagnosticsReadAttributeTxTotalCountWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPThreadNetworkDiagnostics * cluster = [[CHIPThreadNetworkDiagnostics alloc] initWithDevice:device endpoint:0 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"ThreadNetworkDiagnosticsReadAttributeTxTotalCountWithCompletionHandler"]; - - [cluster readAttributeTxTotalCountWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"ThreadNetworkDiagnostics TxTotalCount Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterThreadNetworkDiagnosticsReadAttributeTxUnicastCountWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPThreadNetworkDiagnostics * cluster = [[CHIPThreadNetworkDiagnostics alloc] initWithDevice:device endpoint:0 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"ThreadNetworkDiagnosticsReadAttributeTxUnicastCountWithCompletionHandler"]; - - [cluster readAttributeTxUnicastCountWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"ThreadNetworkDiagnostics TxUnicastCount Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterThreadNetworkDiagnosticsReadAttributeTxBroadcastCountWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPThreadNetworkDiagnostics * cluster = [[CHIPThreadNetworkDiagnostics alloc] initWithDevice:device endpoint:0 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"ThreadNetworkDiagnosticsReadAttributeTxBroadcastCountWithCompletionHandler"]; - - [cluster readAttributeTxBroadcastCountWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"ThreadNetworkDiagnostics TxBroadcastCount Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterThreadNetworkDiagnosticsReadAttributeTxAckRequestedCountWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPThreadNetworkDiagnostics * cluster = [[CHIPThreadNetworkDiagnostics alloc] initWithDevice:device endpoint:0 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"ThreadNetworkDiagnosticsReadAttributeTxAckRequestedCountWithCompletionHandler"]; - - [cluster readAttributeTxAckRequestedCountWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"ThreadNetworkDiagnostics TxAckRequestedCount Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterThreadNetworkDiagnosticsReadAttributeTxAckedCountWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPThreadNetworkDiagnostics * cluster = [[CHIPThreadNetworkDiagnostics alloc] initWithDevice:device endpoint:0 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"ThreadNetworkDiagnosticsReadAttributeTxAckedCountWithCompletionHandler"]; - - [cluster readAttributeTxAckedCountWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"ThreadNetworkDiagnostics TxAckedCount Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterThreadNetworkDiagnosticsReadAttributeTxNoAckRequestedCountWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPThreadNetworkDiagnostics * cluster = [[CHIPThreadNetworkDiagnostics alloc] initWithDevice:device endpoint:0 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"ThreadNetworkDiagnosticsReadAttributeTxNoAckRequestedCountWithCompletionHandler"]; - - [cluster readAttributeTxNoAckRequestedCountWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"ThreadNetworkDiagnostics TxNoAckRequestedCount Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterThreadNetworkDiagnosticsReadAttributeTxDataCountWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPThreadNetworkDiagnostics * cluster = [[CHIPThreadNetworkDiagnostics alloc] initWithDevice:device endpoint:0 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"ThreadNetworkDiagnosticsReadAttributeTxDataCountWithCompletionHandler"]; - - [cluster readAttributeTxDataCountWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"ThreadNetworkDiagnostics TxDataCount Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterThreadNetworkDiagnosticsReadAttributeTxDataPollCountWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPThreadNetworkDiagnostics * cluster = [[CHIPThreadNetworkDiagnostics alloc] initWithDevice:device endpoint:0 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"ThreadNetworkDiagnosticsReadAttributeTxDataPollCountWithCompletionHandler"]; - - [cluster readAttributeTxDataPollCountWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"ThreadNetworkDiagnostics TxDataPollCount Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterThreadNetworkDiagnosticsReadAttributeTxBeaconCountWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPThreadNetworkDiagnostics * cluster = [[CHIPThreadNetworkDiagnostics alloc] initWithDevice:device endpoint:0 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"ThreadNetworkDiagnosticsReadAttributeTxBeaconCountWithCompletionHandler"]; - - [cluster readAttributeTxBeaconCountWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"ThreadNetworkDiagnostics TxBeaconCount Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterThreadNetworkDiagnosticsReadAttributeTxBeaconRequestCountWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPThreadNetworkDiagnostics * cluster = [[CHIPThreadNetworkDiagnostics alloc] initWithDevice:device endpoint:0 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"ThreadNetworkDiagnosticsReadAttributeTxBeaconRequestCountWithCompletionHandler"]; - - [cluster readAttributeTxBeaconRequestCountWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"ThreadNetworkDiagnostics TxBeaconRequestCount Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterThreadNetworkDiagnosticsReadAttributeTxOtherCountWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPThreadNetworkDiagnostics * cluster = [[CHIPThreadNetworkDiagnostics alloc] initWithDevice:device endpoint:0 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"ThreadNetworkDiagnosticsReadAttributeTxOtherCountWithCompletionHandler"]; - - [cluster readAttributeTxOtherCountWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"ThreadNetworkDiagnostics TxOtherCount Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterThreadNetworkDiagnosticsReadAttributeTxRetryCountWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPThreadNetworkDiagnostics * cluster = [[CHIPThreadNetworkDiagnostics alloc] initWithDevice:device endpoint:0 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"ThreadNetworkDiagnosticsReadAttributeTxRetryCountWithCompletionHandler"]; - - [cluster readAttributeTxRetryCountWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"ThreadNetworkDiagnostics TxRetryCount Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterThreadNetworkDiagnosticsReadAttributeTxDirectMaxRetryExpiryCountWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPThreadNetworkDiagnostics * cluster = [[CHIPThreadNetworkDiagnostics alloc] initWithDevice:device endpoint:0 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"ThreadNetworkDiagnosticsReadAttributeTxDirectMaxRetryExpiryCountWithCompletionHandler"]; - - [cluster readAttributeTxDirectMaxRetryExpiryCountWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"ThreadNetworkDiagnostics TxDirectMaxRetryExpiryCount Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterThreadNetworkDiagnosticsReadAttributeTxIndirectMaxRetryExpiryCountWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPThreadNetworkDiagnostics * cluster = [[CHIPThreadNetworkDiagnostics alloc] initWithDevice:device endpoint:0 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = [self - expectationWithDescription:@"ThreadNetworkDiagnosticsReadAttributeTxIndirectMaxRetryExpiryCountWithCompletionHandler"]; - - [cluster - readAttributeTxIndirectMaxRetryExpiryCountWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"ThreadNetworkDiagnostics TxIndirectMaxRetryExpiryCount Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterThreadNetworkDiagnosticsReadAttributeTxErrCcaCountWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPThreadNetworkDiagnostics * cluster = [[CHIPThreadNetworkDiagnostics alloc] initWithDevice:device endpoint:0 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"ThreadNetworkDiagnosticsReadAttributeTxErrCcaCountWithCompletionHandler"]; - - [cluster readAttributeTxErrCcaCountWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"ThreadNetworkDiagnostics TxErrCcaCount Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterThreadNetworkDiagnosticsReadAttributeTxErrAbortCountWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPThreadNetworkDiagnostics * cluster = [[CHIPThreadNetworkDiagnostics alloc] initWithDevice:device endpoint:0 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"ThreadNetworkDiagnosticsReadAttributeTxErrAbortCountWithCompletionHandler"]; - - [cluster readAttributeTxErrAbortCountWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"ThreadNetworkDiagnostics TxErrAbortCount Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterThreadNetworkDiagnosticsReadAttributeTxErrBusyChannelCountWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPThreadNetworkDiagnostics * cluster = [[CHIPThreadNetworkDiagnostics alloc] initWithDevice:device endpoint:0 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"ThreadNetworkDiagnosticsReadAttributeTxErrBusyChannelCountWithCompletionHandler"]; - - [cluster readAttributeTxErrBusyChannelCountWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"ThreadNetworkDiagnostics TxErrBusyChannelCount Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterThreadNetworkDiagnosticsReadAttributeRxTotalCountWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPThreadNetworkDiagnostics * cluster = [[CHIPThreadNetworkDiagnostics alloc] initWithDevice:device endpoint:0 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"ThreadNetworkDiagnosticsReadAttributeRxTotalCountWithCompletionHandler"]; - - [cluster readAttributeRxTotalCountWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"ThreadNetworkDiagnostics RxTotalCount Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterThreadNetworkDiagnosticsReadAttributeRxUnicastCountWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPThreadNetworkDiagnostics * cluster = [[CHIPThreadNetworkDiagnostics alloc] initWithDevice:device endpoint:0 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"ThreadNetworkDiagnosticsReadAttributeRxUnicastCountWithCompletionHandler"]; - - [cluster readAttributeRxUnicastCountWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"ThreadNetworkDiagnostics RxUnicastCount Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterThreadNetworkDiagnosticsReadAttributeRxBroadcastCountWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPThreadNetworkDiagnostics * cluster = [[CHIPThreadNetworkDiagnostics alloc] initWithDevice:device endpoint:0 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"ThreadNetworkDiagnosticsReadAttributeRxBroadcastCountWithCompletionHandler"]; - - [cluster readAttributeRxBroadcastCountWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"ThreadNetworkDiagnostics RxBroadcastCount Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterThreadNetworkDiagnosticsReadAttributeRxDataCountWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPThreadNetworkDiagnostics * cluster = [[CHIPThreadNetworkDiagnostics alloc] initWithDevice:device endpoint:0 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"ThreadNetworkDiagnosticsReadAttributeRxDataCountWithCompletionHandler"]; - - [cluster readAttributeRxDataCountWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"ThreadNetworkDiagnostics RxDataCount Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterThreadNetworkDiagnosticsReadAttributeRxDataPollCountWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPThreadNetworkDiagnostics * cluster = [[CHIPThreadNetworkDiagnostics alloc] initWithDevice:device endpoint:0 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"ThreadNetworkDiagnosticsReadAttributeRxDataPollCountWithCompletionHandler"]; - - [cluster readAttributeRxDataPollCountWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"ThreadNetworkDiagnostics RxDataPollCount Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterThreadNetworkDiagnosticsReadAttributeRxBeaconCountWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPThreadNetworkDiagnostics * cluster = [[CHIPThreadNetworkDiagnostics alloc] initWithDevice:device endpoint:0 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"ThreadNetworkDiagnosticsReadAttributeRxBeaconCountWithCompletionHandler"]; - - [cluster readAttributeRxBeaconCountWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"ThreadNetworkDiagnostics RxBeaconCount Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterThreadNetworkDiagnosticsReadAttributeRxBeaconRequestCountWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPThreadNetworkDiagnostics * cluster = [[CHIPThreadNetworkDiagnostics alloc] initWithDevice:device endpoint:0 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"ThreadNetworkDiagnosticsReadAttributeRxBeaconRequestCountWithCompletionHandler"]; - - [cluster readAttributeRxBeaconRequestCountWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"ThreadNetworkDiagnostics RxBeaconRequestCount Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterThreadNetworkDiagnosticsReadAttributeRxOtherCountWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPThreadNetworkDiagnostics * cluster = [[CHIPThreadNetworkDiagnostics alloc] initWithDevice:device endpoint:0 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"ThreadNetworkDiagnosticsReadAttributeRxOtherCountWithCompletionHandler"]; - - [cluster readAttributeRxOtherCountWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"ThreadNetworkDiagnostics RxOtherCount Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterThreadNetworkDiagnosticsReadAttributeRxAddressFilteredCountWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPThreadNetworkDiagnostics * cluster = [[CHIPThreadNetworkDiagnostics alloc] initWithDevice:device endpoint:0 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"ThreadNetworkDiagnosticsReadAttributeRxAddressFilteredCountWithCompletionHandler"]; - - [cluster readAttributeRxAddressFilteredCountWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"ThreadNetworkDiagnostics RxAddressFilteredCount Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterThreadNetworkDiagnosticsReadAttributeRxDestAddrFilteredCountWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPThreadNetworkDiagnostics * cluster = [[CHIPThreadNetworkDiagnostics alloc] initWithDevice:device endpoint:0 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"ThreadNetworkDiagnosticsReadAttributeRxDestAddrFilteredCountWithCompletionHandler"]; - - [cluster readAttributeRxDestAddrFilteredCountWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"ThreadNetworkDiagnostics RxDestAddrFilteredCount Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterThreadNetworkDiagnosticsReadAttributeRxDuplicatedCountWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPThreadNetworkDiagnostics * cluster = [[CHIPThreadNetworkDiagnostics alloc] initWithDevice:device endpoint:0 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"ThreadNetworkDiagnosticsReadAttributeRxDuplicatedCountWithCompletionHandler"]; - - [cluster readAttributeRxDuplicatedCountWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"ThreadNetworkDiagnostics RxDuplicatedCount Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterThreadNetworkDiagnosticsReadAttributeRxErrNoFrameCountWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPThreadNetworkDiagnostics * cluster = [[CHIPThreadNetworkDiagnostics alloc] initWithDevice:device endpoint:0 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"ThreadNetworkDiagnosticsReadAttributeRxErrNoFrameCountWithCompletionHandler"]; - - [cluster readAttributeRxErrNoFrameCountWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"ThreadNetworkDiagnostics RxErrNoFrameCount Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterThreadNetworkDiagnosticsReadAttributeRxErrUnknownNeighborCountWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPThreadNetworkDiagnostics * cluster = [[CHIPThreadNetworkDiagnostics alloc] initWithDevice:device endpoint:0 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"ThreadNetworkDiagnosticsReadAttributeRxErrUnknownNeighborCountWithCompletionHandler"]; - - [cluster readAttributeRxErrUnknownNeighborCountWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"ThreadNetworkDiagnostics RxErrUnknownNeighborCount Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterThreadNetworkDiagnosticsReadAttributeRxErrInvalidSrcAddrCountWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPThreadNetworkDiagnostics * cluster = [[CHIPThreadNetworkDiagnostics alloc] initWithDevice:device endpoint:0 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"ThreadNetworkDiagnosticsReadAttributeRxErrInvalidSrcAddrCountWithCompletionHandler"]; - - [cluster readAttributeRxErrInvalidSrcAddrCountWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"ThreadNetworkDiagnostics RxErrInvalidSrcAddrCount Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterThreadNetworkDiagnosticsReadAttributeRxErrSecCountWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPThreadNetworkDiagnostics * cluster = [[CHIPThreadNetworkDiagnostics alloc] initWithDevice:device endpoint:0 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"ThreadNetworkDiagnosticsReadAttributeRxErrSecCountWithCompletionHandler"]; - - [cluster readAttributeRxErrSecCountWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"ThreadNetworkDiagnostics RxErrSecCount Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterThreadNetworkDiagnosticsReadAttributeRxErrFcsCountWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPThreadNetworkDiagnostics * cluster = [[CHIPThreadNetworkDiagnostics alloc] initWithDevice:device endpoint:0 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"ThreadNetworkDiagnosticsReadAttributeRxErrFcsCountWithCompletionHandler"]; - - [cluster readAttributeRxErrFcsCountWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"ThreadNetworkDiagnostics RxErrFcsCount Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterThreadNetworkDiagnosticsReadAttributeRxErrOtherCountWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPThreadNetworkDiagnostics * cluster = [[CHIPThreadNetworkDiagnostics alloc] initWithDevice:device endpoint:0 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"ThreadNetworkDiagnosticsReadAttributeRxErrOtherCountWithCompletionHandler"]; - - [cluster readAttributeRxErrOtherCountWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"ThreadNetworkDiagnostics RxErrOtherCount Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterThreadNetworkDiagnosticsReadAttributeActiveTimestampWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPThreadNetworkDiagnostics * cluster = [[CHIPThreadNetworkDiagnostics alloc] initWithDevice:device endpoint:0 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"ThreadNetworkDiagnosticsReadAttributeActiveTimestampWithCompletionHandler"]; - - [cluster readAttributeActiveTimestampWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"ThreadNetworkDiagnostics ActiveTimestamp Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterThreadNetworkDiagnosticsReadAttributePendingTimestampWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPThreadNetworkDiagnostics * cluster = [[CHIPThreadNetworkDiagnostics alloc] initWithDevice:device endpoint:0 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"ThreadNetworkDiagnosticsReadAttributePendingTimestampWithCompletionHandler"]; - - [cluster readAttributePendingTimestampWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"ThreadNetworkDiagnostics PendingTimestamp Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterThreadNetworkDiagnosticsReadAttributeDelayWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPThreadNetworkDiagnostics * cluster = [[CHIPThreadNetworkDiagnostics alloc] initWithDevice:device endpoint:0 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"ThreadNetworkDiagnosticsReadAttributeDelayWithCompletionHandler"]; - - [cluster readAttributeDelayWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"ThreadNetworkDiagnostics Delay Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterThreadNetworkDiagnosticsReadAttributeSecurityPolicyWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPThreadNetworkDiagnostics * cluster = [[CHIPThreadNetworkDiagnostics alloc] initWithDevice:device endpoint:0 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"ThreadNetworkDiagnosticsReadAttributeSecurityPolicyWithCompletionHandler"]; - - [cluster readAttributeSecurityPolicyWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"ThreadNetworkDiagnostics SecurityPolicy Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterThreadNetworkDiagnosticsReadAttributeChannelMaskWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPThreadNetworkDiagnostics * cluster = [[CHIPThreadNetworkDiagnostics alloc] initWithDevice:device endpoint:0 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"ThreadNetworkDiagnosticsReadAttributeChannelMaskWithCompletionHandler"]; - - [cluster readAttributeChannelMaskWithCompletionHandler:^(NSData * _Nullable value, NSError * _Nullable err) { - NSLog(@"ThreadNetworkDiagnostics ChannelMask Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterThreadNetworkDiagnosticsReadAttributeOperationalDatasetComponentsWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPThreadNetworkDiagnostics * cluster = [[CHIPThreadNetworkDiagnostics alloc] initWithDevice:device endpoint:0 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"ThreadNetworkDiagnosticsReadAttributeOperationalDatasetComponentsWithCompletionHandler"]; - - [cluster readAttributeOperationalDatasetComponentsWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"ThreadNetworkDiagnostics OperationalDatasetComponents Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterThreadNetworkDiagnosticsReadAttributeActiveNetworkFaultsListWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPThreadNetworkDiagnostics * cluster = [[CHIPThreadNetworkDiagnostics alloc] initWithDevice:device endpoint:0 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"ThreadNetworkDiagnosticsReadAttributeActiveNetworkFaultsListWithCompletionHandler"]; - - [cluster readAttributeActiveNetworkFaultsListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"ThreadNetworkDiagnostics ActiveNetworkFaultsList Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterThreadNetworkDiagnosticsReadAttributeServerGeneratedCommandListWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPThreadNetworkDiagnostics * cluster = [[CHIPThreadNetworkDiagnostics alloc] initWithDevice:device endpoint:0 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"ThreadNetworkDiagnosticsReadAttributeServerGeneratedCommandListWithCompletionHandler"]; - - [cluster readAttributeServerGeneratedCommandListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"ThreadNetworkDiagnostics ServerGeneratedCommandList Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterThreadNetworkDiagnosticsReadAttributeClientGeneratedCommandListWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPThreadNetworkDiagnostics * cluster = [[CHIPThreadNetworkDiagnostics alloc] initWithDevice:device endpoint:0 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"ThreadNetworkDiagnosticsReadAttributeClientGeneratedCommandListWithCompletionHandler"]; - - [cluster readAttributeClientGeneratedCommandListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"ThreadNetworkDiagnostics ClientGeneratedCommandList Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterThreadNetworkDiagnosticsReadAttributeAttributeListWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPThreadNetworkDiagnostics * cluster = [[CHIPThreadNetworkDiagnostics alloc] initWithDevice:device endpoint:0 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"ThreadNetworkDiagnosticsReadAttributeAttributeListWithCompletionHandler"]; - - [cluster readAttributeAttributeListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"ThreadNetworkDiagnostics AttributeList Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterThreadNetworkDiagnosticsReadAttributeFeatureMapWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPThreadNetworkDiagnostics * cluster = [[CHIPThreadNetworkDiagnostics alloc] initWithDevice:device endpoint:0 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"ThreadNetworkDiagnosticsReadAttributeFeatureMapWithCompletionHandler"]; - - [cluster readAttributeFeatureMapWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"ThreadNetworkDiagnostics FeatureMap Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterThreadNetworkDiagnosticsReadAttributeClusterRevisionWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPThreadNetworkDiagnostics * cluster = [[CHIPThreadNetworkDiagnostics alloc] initWithDevice:device endpoint:0 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"ThreadNetworkDiagnosticsReadAttributeClusterRevisionWithCompletionHandler"]; - - [cluster readAttributeClusterRevisionWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"ThreadNetworkDiagnostics ClusterRevision Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterTimeFormatLocalizationReadAttributeHourFormatWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPTimeFormatLocalization * cluster = [[CHIPTimeFormatLocalization alloc] initWithDevice:device endpoint:0 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"TimeFormatLocalizationReadAttributeHourFormatWithCompletionHandler"]; - - [cluster readAttributeHourFormatWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"TimeFormatLocalization HourFormat Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterTimeFormatLocalizationWriteAttributeHourFormatWithValue -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPTimeFormatLocalization * cluster = [[CHIPTimeFormatLocalization alloc] initWithDevice:device endpoint:0 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = [self expectationWithDescription:@"TimeFormatLocalizationWriteAttributeHourFormatWithValue"]; - - NSNumber * _Nonnull value = @(0x00); - [cluster writeAttributeHourFormatWithValue:value - completionHandler:^(NSError * _Nullable err) { - NSLog(@"TimeFormatLocalization HourFormat Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTimeFormatLocalizationReadAttributeActiveCalendarTypeWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPTimeFormatLocalization * cluster = [[CHIPTimeFormatLocalization alloc] initWithDevice:device endpoint:0 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"TimeFormatLocalizationReadAttributeActiveCalendarTypeWithCompletionHandler"]; - - [cluster readAttributeActiveCalendarTypeWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"TimeFormatLocalization ActiveCalendarType Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterTimeFormatLocalizationWriteAttributeActiveCalendarTypeWithValue -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPTimeFormatLocalization * cluster = [[CHIPTimeFormatLocalization alloc] initWithDevice:device endpoint:0 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"TimeFormatLocalizationWriteAttributeActiveCalendarTypeWithValue"]; - - NSNumber * _Nonnull value = @(0); - [cluster writeAttributeActiveCalendarTypeWithValue:value - completionHandler:^(NSError * _Nullable err) { - NSLog(@"TimeFormatLocalization ActiveCalendarType Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTimeFormatLocalizationReadAttributeSupportedCalendarTypesWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPTimeFormatLocalization * cluster = [[CHIPTimeFormatLocalization alloc] initWithDevice:device endpoint:0 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"TimeFormatLocalizationReadAttributeSupportedCalendarTypesWithCompletionHandler"]; - - [cluster readAttributeSupportedCalendarTypesWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"TimeFormatLocalization SupportedCalendarTypes Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterTimeFormatLocalizationReadAttributeServerGeneratedCommandListWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPTimeFormatLocalization * cluster = [[CHIPTimeFormatLocalization alloc] initWithDevice:device endpoint:0 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"TimeFormatLocalizationReadAttributeServerGeneratedCommandListWithCompletionHandler"]; - - [cluster readAttributeServerGeneratedCommandListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"TimeFormatLocalization ServerGeneratedCommandList Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterTimeFormatLocalizationReadAttributeClientGeneratedCommandListWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPTimeFormatLocalization * cluster = [[CHIPTimeFormatLocalization alloc] initWithDevice:device endpoint:0 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"TimeFormatLocalizationReadAttributeClientGeneratedCommandListWithCompletionHandler"]; - - [cluster readAttributeClientGeneratedCommandListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"TimeFormatLocalization ClientGeneratedCommandList Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterTimeFormatLocalizationReadAttributeClusterRevisionWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPTimeFormatLocalization * cluster = [[CHIPTimeFormatLocalization alloc] initWithDevice:device endpoint:0 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"TimeFormatLocalizationReadAttributeClusterRevisionWithCompletionHandler"]; - - [cluster readAttributeClusterRevisionWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"TimeFormatLocalization ClusterRevision Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterUnitLocalizationReadAttributeTemperatureUnitWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPUnitLocalization * cluster = [[CHIPUnitLocalization alloc] initWithDevice:device endpoint:0 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"UnitLocalizationReadAttributeTemperatureUnitWithCompletionHandler"]; - - [cluster readAttributeTemperatureUnitWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"UnitLocalization TemperatureUnit Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterUnitLocalizationWriteAttributeTemperatureUnitWithValue -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPUnitLocalization * cluster = [[CHIPUnitLocalization alloc] initWithDevice:device endpoint:0 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = [self expectationWithDescription:@"UnitLocalizationWriteAttributeTemperatureUnitWithValue"]; - - NSNumber * _Nonnull value = @(0); - [cluster writeAttributeTemperatureUnitWithValue:value - completionHandler:^(NSError * _Nullable err) { - NSLog(@"UnitLocalization TemperatureUnit Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterUnitLocalizationReadAttributeAttributeListWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPUnitLocalization * cluster = [[CHIPUnitLocalization alloc] initWithDevice:device endpoint:0 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"UnitLocalizationReadAttributeAttributeListWithCompletionHandler"]; - - [cluster readAttributeAttributeListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"UnitLocalization AttributeList Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterUnitLocalizationReadAttributeFeatureMapWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPUnitLocalization * cluster = [[CHIPUnitLocalization alloc] initWithDevice:device endpoint:0 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"UnitLocalizationReadAttributeFeatureMapWithCompletionHandler"]; - - [cluster readAttributeFeatureMapWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"UnitLocalization FeatureMap Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterUnitLocalizationReadAttributeClusterRevisionWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPUnitLocalization * cluster = [[CHIPUnitLocalization alloc] initWithDevice:device endpoint:0 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"UnitLocalizationReadAttributeClusterRevisionWithCompletionHandler"]; - - [cluster readAttributeClusterRevisionWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"UnitLocalization ClusterRevision Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterUserLabelReadAttributeLabelListWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPUserLabel * cluster = [[CHIPUserLabel alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = [self expectationWithDescription:@"UserLabelReadAttributeLabelListWithCompletionHandler"]; - - [cluster readAttributeLabelListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"UserLabel LabelList Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterUserLabelWriteAttributeLabelListWithValue -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPUserLabel * cluster = [[CHIPUserLabel alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = [self expectationWithDescription:@"UserLabelWriteAttributeLabelListWithValue"]; - - NSArray * _Nonnull value = [NSArray array]; - [cluster writeAttributeLabelListWithValue:value - completionHandler:^(NSError * _Nullable err) { - NSLog(@"UserLabel LabelList Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterUserLabelReadAttributeServerGeneratedCommandListWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPUserLabel * cluster = [[CHIPUserLabel alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"UserLabelReadAttributeServerGeneratedCommandListWithCompletionHandler"]; - - [cluster readAttributeServerGeneratedCommandListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"UserLabel ServerGeneratedCommandList Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterUserLabelReadAttributeClientGeneratedCommandListWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPUserLabel * cluster = [[CHIPUserLabel alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"UserLabelReadAttributeClientGeneratedCommandListWithCompletionHandler"]; - - [cluster readAttributeClientGeneratedCommandListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"UserLabel ClientGeneratedCommandList Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterUserLabelReadAttributeClusterRevisionWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPUserLabel * cluster = [[CHIPUserLabel alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"UserLabelReadAttributeClusterRevisionWithCompletionHandler"]; - - [cluster readAttributeClusterRevisionWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"UserLabel ClusterRevision Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterWakeOnLanReadAttributeWakeOnLanMacAddressWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPWakeOnLan * cluster = [[CHIPWakeOnLan alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"WakeOnLanReadAttributeWakeOnLanMacAddressWithCompletionHandler"]; - - [cluster readAttributeWakeOnLanMacAddressWithCompletionHandler:^(NSString * _Nullable value, NSError * _Nullable err) { - NSLog(@"WakeOnLan WakeOnLanMacAddress Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterWakeOnLanReadAttributeServerGeneratedCommandListWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPWakeOnLan * cluster = [[CHIPWakeOnLan alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"WakeOnLanReadAttributeServerGeneratedCommandListWithCompletionHandler"]; - - [cluster readAttributeServerGeneratedCommandListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"WakeOnLan ServerGeneratedCommandList Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterWakeOnLanReadAttributeClientGeneratedCommandListWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPWakeOnLan * cluster = [[CHIPWakeOnLan alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"WakeOnLanReadAttributeClientGeneratedCommandListWithCompletionHandler"]; - - [cluster readAttributeClientGeneratedCommandListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"WakeOnLan ClientGeneratedCommandList Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterWakeOnLanReadAttributeAttributeListWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPWakeOnLan * cluster = [[CHIPWakeOnLan alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = [self expectationWithDescription:@"WakeOnLanReadAttributeAttributeListWithCompletionHandler"]; - - [cluster readAttributeAttributeListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"WakeOnLan AttributeList Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterWakeOnLanReadAttributeClusterRevisionWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPWakeOnLan * cluster = [[CHIPWakeOnLan alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"WakeOnLanReadAttributeClusterRevisionWithCompletionHandler"]; - - [cluster readAttributeClusterRevisionWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"WakeOnLan ClusterRevision Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterWiFiNetworkDiagnosticsReadAttributeBssidWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPWiFiNetworkDiagnostics * cluster = [[CHIPWiFiNetworkDiagnostics alloc] initWithDevice:device endpoint:0 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"WiFiNetworkDiagnosticsReadAttributeBssidWithCompletionHandler"]; - - [cluster readAttributeBssidWithCompletionHandler:^(NSData * _Nullable value, NSError * _Nullable err) { - NSLog(@"WiFiNetworkDiagnostics Bssid Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterWiFiNetworkDiagnosticsReadAttributeSecurityTypeWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPWiFiNetworkDiagnostics * cluster = [[CHIPWiFiNetworkDiagnostics alloc] initWithDevice:device endpoint:0 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"WiFiNetworkDiagnosticsReadAttributeSecurityTypeWithCompletionHandler"]; - - [cluster readAttributeSecurityTypeWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"WiFiNetworkDiagnostics SecurityType Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterWiFiNetworkDiagnosticsReadAttributeWiFiVersionWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPWiFiNetworkDiagnostics * cluster = [[CHIPWiFiNetworkDiagnostics alloc] initWithDevice:device endpoint:0 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"WiFiNetworkDiagnosticsReadAttributeWiFiVersionWithCompletionHandler"]; - - [cluster readAttributeWiFiVersionWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"WiFiNetworkDiagnostics WiFiVersion Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterWiFiNetworkDiagnosticsReadAttributeChannelNumberWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPWiFiNetworkDiagnostics * cluster = [[CHIPWiFiNetworkDiagnostics alloc] initWithDevice:device endpoint:0 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"WiFiNetworkDiagnosticsReadAttributeChannelNumberWithCompletionHandler"]; - - [cluster readAttributeChannelNumberWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"WiFiNetworkDiagnostics ChannelNumber Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterWiFiNetworkDiagnosticsReadAttributeRssiWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPWiFiNetworkDiagnostics * cluster = [[CHIPWiFiNetworkDiagnostics alloc] initWithDevice:device endpoint:0 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"WiFiNetworkDiagnosticsReadAttributeRssiWithCompletionHandler"]; - - [cluster readAttributeRssiWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"WiFiNetworkDiagnostics Rssi Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterWiFiNetworkDiagnosticsReadAttributeBeaconLostCountWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPWiFiNetworkDiagnostics * cluster = [[CHIPWiFiNetworkDiagnostics alloc] initWithDevice:device endpoint:0 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"WiFiNetworkDiagnosticsReadAttributeBeaconLostCountWithCompletionHandler"]; - - [cluster readAttributeBeaconLostCountWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"WiFiNetworkDiagnostics BeaconLostCount Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterWiFiNetworkDiagnosticsReadAttributeBeaconRxCountWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPWiFiNetworkDiagnostics * cluster = [[CHIPWiFiNetworkDiagnostics alloc] initWithDevice:device endpoint:0 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"WiFiNetworkDiagnosticsReadAttributeBeaconRxCountWithCompletionHandler"]; - - [cluster readAttributeBeaconRxCountWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"WiFiNetworkDiagnostics BeaconRxCount Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterWiFiNetworkDiagnosticsReadAttributePacketMulticastRxCountWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPWiFiNetworkDiagnostics * cluster = [[CHIPWiFiNetworkDiagnostics alloc] initWithDevice:device endpoint:0 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"WiFiNetworkDiagnosticsReadAttributePacketMulticastRxCountWithCompletionHandler"]; - - [cluster readAttributePacketMulticastRxCountWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"WiFiNetworkDiagnostics PacketMulticastRxCount Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterWiFiNetworkDiagnosticsReadAttributePacketMulticastTxCountWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPWiFiNetworkDiagnostics * cluster = [[CHIPWiFiNetworkDiagnostics alloc] initWithDevice:device endpoint:0 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"WiFiNetworkDiagnosticsReadAttributePacketMulticastTxCountWithCompletionHandler"]; - - [cluster readAttributePacketMulticastTxCountWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"WiFiNetworkDiagnostics PacketMulticastTxCount Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterWiFiNetworkDiagnosticsReadAttributePacketUnicastRxCountWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPWiFiNetworkDiagnostics * cluster = [[CHIPWiFiNetworkDiagnostics alloc] initWithDevice:device endpoint:0 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"WiFiNetworkDiagnosticsReadAttributePacketUnicastRxCountWithCompletionHandler"]; - - [cluster readAttributePacketUnicastRxCountWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"WiFiNetworkDiagnostics PacketUnicastRxCount Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterWiFiNetworkDiagnosticsReadAttributePacketUnicastTxCountWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPWiFiNetworkDiagnostics * cluster = [[CHIPWiFiNetworkDiagnostics alloc] initWithDevice:device endpoint:0 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"WiFiNetworkDiagnosticsReadAttributePacketUnicastTxCountWithCompletionHandler"]; - - [cluster readAttributePacketUnicastTxCountWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"WiFiNetworkDiagnostics PacketUnicastTxCount Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterWiFiNetworkDiagnosticsReadAttributeCurrentMaxRateWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPWiFiNetworkDiagnostics * cluster = [[CHIPWiFiNetworkDiagnostics alloc] initWithDevice:device endpoint:0 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"WiFiNetworkDiagnosticsReadAttributeCurrentMaxRateWithCompletionHandler"]; - - [cluster readAttributeCurrentMaxRateWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"WiFiNetworkDiagnostics CurrentMaxRate Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterWiFiNetworkDiagnosticsReadAttributeOverrunCountWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPWiFiNetworkDiagnostics * cluster = [[CHIPWiFiNetworkDiagnostics alloc] initWithDevice:device endpoint:0 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"WiFiNetworkDiagnosticsReadAttributeOverrunCountWithCompletionHandler"]; - - [cluster readAttributeOverrunCountWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"WiFiNetworkDiagnostics OverrunCount Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterWiFiNetworkDiagnosticsReadAttributeServerGeneratedCommandListWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPWiFiNetworkDiagnostics * cluster = [[CHIPWiFiNetworkDiagnostics alloc] initWithDevice:device endpoint:0 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"WiFiNetworkDiagnosticsReadAttributeServerGeneratedCommandListWithCompletionHandler"]; - - [cluster readAttributeServerGeneratedCommandListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"WiFiNetworkDiagnostics ServerGeneratedCommandList Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterWiFiNetworkDiagnosticsReadAttributeClientGeneratedCommandListWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPWiFiNetworkDiagnostics * cluster = [[CHIPWiFiNetworkDiagnostics alloc] initWithDevice:device endpoint:0 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"WiFiNetworkDiagnosticsReadAttributeClientGeneratedCommandListWithCompletionHandler"]; - - [cluster readAttributeClientGeneratedCommandListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"WiFiNetworkDiagnostics ClientGeneratedCommandList Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterWiFiNetworkDiagnosticsReadAttributeAttributeListWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPWiFiNetworkDiagnostics * cluster = [[CHIPWiFiNetworkDiagnostics alloc] initWithDevice:device endpoint:0 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"WiFiNetworkDiagnosticsReadAttributeAttributeListWithCompletionHandler"]; - - [cluster readAttributeAttributeListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"WiFiNetworkDiagnostics AttributeList Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterWiFiNetworkDiagnosticsReadAttributeFeatureMapWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPWiFiNetworkDiagnostics * cluster = [[CHIPWiFiNetworkDiagnostics alloc] initWithDevice:device endpoint:0 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"WiFiNetworkDiagnosticsReadAttributeFeatureMapWithCompletionHandler"]; - - [cluster readAttributeFeatureMapWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"WiFiNetworkDiagnostics FeatureMap Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterWiFiNetworkDiagnosticsReadAttributeClusterRevisionWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPWiFiNetworkDiagnostics * cluster = [[CHIPWiFiNetworkDiagnostics alloc] initWithDevice:device endpoint:0 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"WiFiNetworkDiagnosticsReadAttributeClusterRevisionWithCompletionHandler"]; - - [cluster readAttributeClusterRevisionWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"WiFiNetworkDiagnostics ClusterRevision Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterWindowCoveringReadAttributeTypeWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPWindowCovering * cluster = [[CHIPWindowCovering alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = [self expectationWithDescription:@"WindowCoveringReadAttributeTypeWithCompletionHandler"]; - - [cluster readAttributeTypeWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"WindowCovering Type Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterWindowCoveringReadAttributeCurrentPositionLiftWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPWindowCovering * cluster = [[CHIPWindowCovering alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"WindowCoveringReadAttributeCurrentPositionLiftWithCompletionHandler"]; - - [cluster readAttributeCurrentPositionLiftWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"WindowCovering CurrentPositionLift Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterWindowCoveringReadAttributeCurrentPositionTiltWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPWindowCovering * cluster = [[CHIPWindowCovering alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"WindowCoveringReadAttributeCurrentPositionTiltWithCompletionHandler"]; - - [cluster readAttributeCurrentPositionTiltWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"WindowCovering CurrentPositionTilt Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterWindowCoveringReadAttributeConfigStatusWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPWindowCovering * cluster = [[CHIPWindowCovering alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"WindowCoveringReadAttributeConfigStatusWithCompletionHandler"]; - - [cluster readAttributeConfigStatusWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"WindowCovering ConfigStatus Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterWindowCoveringReadAttributeCurrentPositionLiftPercentageWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPWindowCovering * cluster = [[CHIPWindowCovering alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"WindowCoveringReadAttributeCurrentPositionLiftPercentageWithCompletionHandler"]; - - [cluster - readAttributeCurrentPositionLiftPercentageWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"WindowCovering CurrentPositionLiftPercentage Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterWindowCoveringReadAttributeCurrentPositionTiltPercentageWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPWindowCovering * cluster = [[CHIPWindowCovering alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"WindowCoveringReadAttributeCurrentPositionTiltPercentageWithCompletionHandler"]; - - [cluster - readAttributeCurrentPositionTiltPercentageWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"WindowCovering CurrentPositionTiltPercentage Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterWindowCoveringReadAttributeOperationalStatusWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPWindowCovering * cluster = [[CHIPWindowCovering alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"WindowCoveringReadAttributeOperationalStatusWithCompletionHandler"]; - - [cluster readAttributeOperationalStatusWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"WindowCovering OperationalStatus Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterWindowCoveringReadAttributeTargetPositionLiftPercent100thsWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPWindowCovering * cluster = [[CHIPWindowCovering alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"WindowCoveringReadAttributeTargetPositionLiftPercent100thsWithCompletionHandler"]; - - [cluster - readAttributeTargetPositionLiftPercent100thsWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"WindowCovering TargetPositionLiftPercent100ths Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterWindowCoveringReadAttributeTargetPositionTiltPercent100thsWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPWindowCovering * cluster = [[CHIPWindowCovering alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"WindowCoveringReadAttributeTargetPositionTiltPercent100thsWithCompletionHandler"]; - - [cluster - readAttributeTargetPositionTiltPercent100thsWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"WindowCovering TargetPositionTiltPercent100ths Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterWindowCoveringReadAttributeEndProductTypeWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPWindowCovering * cluster = [[CHIPWindowCovering alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"WindowCoveringReadAttributeEndProductTypeWithCompletionHandler"]; - - [cluster readAttributeEndProductTypeWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"WindowCovering EndProductType Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterWindowCoveringReadAttributeCurrentPositionLiftPercent100thsWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPWindowCovering * cluster = [[CHIPWindowCovering alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"WindowCoveringReadAttributeCurrentPositionLiftPercent100thsWithCompletionHandler"]; - - [cluster - readAttributeCurrentPositionLiftPercent100thsWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"WindowCovering CurrentPositionLiftPercent100ths Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterWindowCoveringReadAttributeCurrentPositionTiltPercent100thsWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPWindowCovering * cluster = [[CHIPWindowCovering alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"WindowCoveringReadAttributeCurrentPositionTiltPercent100thsWithCompletionHandler"]; - - [cluster - readAttributeCurrentPositionTiltPercent100thsWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"WindowCovering CurrentPositionTiltPercent100ths Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterWindowCoveringReadAttributeInstalledOpenLimitLiftWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPWindowCovering * cluster = [[CHIPWindowCovering alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"WindowCoveringReadAttributeInstalledOpenLimitLiftWithCompletionHandler"]; - - [cluster readAttributeInstalledOpenLimitLiftWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"WindowCovering InstalledOpenLimitLift Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterWindowCoveringReadAttributeInstalledClosedLimitLiftWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPWindowCovering * cluster = [[CHIPWindowCovering alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"WindowCoveringReadAttributeInstalledClosedLimitLiftWithCompletionHandler"]; - - [cluster readAttributeInstalledClosedLimitLiftWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"WindowCovering InstalledClosedLimitLift Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterWindowCoveringReadAttributeInstalledOpenLimitTiltWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPWindowCovering * cluster = [[CHIPWindowCovering alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"WindowCoveringReadAttributeInstalledOpenLimitTiltWithCompletionHandler"]; - - [cluster readAttributeInstalledOpenLimitTiltWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"WindowCovering InstalledOpenLimitTilt Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterWindowCoveringReadAttributeInstalledClosedLimitTiltWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPWindowCovering * cluster = [[CHIPWindowCovering alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"WindowCoveringReadAttributeInstalledClosedLimitTiltWithCompletionHandler"]; - - [cluster readAttributeInstalledClosedLimitTiltWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"WindowCovering InstalledClosedLimitTilt Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterWindowCoveringReadAttributeModeWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPWindowCovering * cluster = [[CHIPWindowCovering alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = [self expectationWithDescription:@"WindowCoveringReadAttributeModeWithCompletionHandler"]; - - [cluster readAttributeModeWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"WindowCovering Mode Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterWindowCoveringWriteAttributeModeWithValue -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPWindowCovering * cluster = [[CHIPWindowCovering alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = [self expectationWithDescription:@"WindowCoveringWriteAttributeModeWithValue"]; - - NSNumber * _Nonnull value = @(0x00); - [cluster writeAttributeModeWithValue:value - completionHandler:^(NSError * _Nullable err) { - NSLog(@"WindowCovering Mode Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterWindowCoveringReadAttributeSafetyStatusWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPWindowCovering * cluster = [[CHIPWindowCovering alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"WindowCoveringReadAttributeSafetyStatusWithCompletionHandler"]; - - [cluster readAttributeSafetyStatusWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"WindowCovering SafetyStatus Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterWindowCoveringReadAttributeServerGeneratedCommandListWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPWindowCovering * cluster = [[CHIPWindowCovering alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"WindowCoveringReadAttributeServerGeneratedCommandListWithCompletionHandler"]; - - [cluster readAttributeServerGeneratedCommandListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"WindowCovering ServerGeneratedCommandList Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterWindowCoveringReadAttributeClientGeneratedCommandListWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPWindowCovering * cluster = [[CHIPWindowCovering alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"WindowCoveringReadAttributeClientGeneratedCommandListWithCompletionHandler"]; - - [cluster readAttributeClientGeneratedCommandListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"WindowCovering ClientGeneratedCommandList Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterWindowCoveringReadAttributeAttributeListWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPWindowCovering * cluster = [[CHIPWindowCovering alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"WindowCoveringReadAttributeAttributeListWithCompletionHandler"]; - - [cluster readAttributeAttributeListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"WindowCovering AttributeList Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterWindowCoveringReadAttributeFeatureMapWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPWindowCovering * cluster = [[CHIPWindowCovering alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"WindowCoveringReadAttributeFeatureMapWithCompletionHandler"]; - - [cluster readAttributeFeatureMapWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"WindowCovering FeatureMap Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterWindowCoveringReadAttributeClusterRevisionWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPWindowCovering * cluster = [[CHIPWindowCovering alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"WindowCoveringReadAttributeClusterRevisionWithCompletionHandler"]; - - [cluster readAttributeClusterRevisionWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"WindowCovering ClusterRevision Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - @end