blob: 4fd3677cd015832e2d9a8c3f1d5ffabb999b7cfa [file] [log] [blame]
//
// CHIPClustersTests.m
// CHIPClustersTests
/*
*
* Copyright (c) 2021 Project CHIP Authors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
// THIS FILE IS GENERATED BY ZAP
// module headers
#import <CHIP/CHIP.h>
#import <CHIP/CHIPTestClustersObjc.h>
#import "CHIPErrorTestUtils.h"
#import <app/util/af-enums.h>
#import <math.h> // For INFINITY
// system dependencies
#import <XCTest/XCTest.h>
const uint16_t kPairingTimeoutInSeconds = 10;
const uint16_t kAddressResolveTimeoutInSeconds = 10;
const uint16_t kCASESetupTimeoutInSeconds = 30;
const uint16_t kTimeoutInSeconds = 3;
const uint64_t kDeviceId = 1;
const uint16_t kDiscriminator = 3840;
const uint32_t kSetupPINCode = 20202021;
const uint16_t kRemotePort = 5540;
const uint16_t kLocalPort = 5541;
NSString * kAddress = @"::1";
// This test suite reuses a device object to speed up the test process for CI.
// The following global variable holds the reference to the device object.
static CHIPDevice * mConnectedDevice;
// Test Util APIs
void WaitForMs(XCTestExpectation * expectation, dispatch_queue_t queue, unsigned int ms)
{
dispatch_after(dispatch_time(DISPATCH_TIME_NOW, ms * NSEC_PER_MSEC), queue, ^{
[expectation fulfill];
});
}
void WaitForCommissionee(XCTestExpectation * expectation, dispatch_queue_t queue)
{
CHIPDeviceController * controller = [CHIPDeviceController sharedController];
XCTAssertNotNil(controller);
[controller getConnectedDevice:kDeviceId
queue:dispatch_get_main_queue()
completionHandler:^(CHIPDevice * _Nullable device, NSError * _Nullable error) {
XCTAssertEqual(error.code, 0);
[expectation fulfill];
mConnectedDevice = device;
}];
}
CHIPDevice * GetConnectedDevice(void)
{
XCTAssertNotNil(mConnectedDevice);
return mConnectedDevice;
}
@interface CHIPToolPairingDelegate : NSObject <CHIPDevicePairingDelegate>
@property (nonatomic, strong) XCTestExpectation * expectation;
@end
@implementation CHIPToolPairingDelegate
- (id)initWithExpectation:(XCTestExpectation *)expectation
{
self = [super init];
if (self) {
_expectation = expectation;
}
return self;
}
- (void)onPairingComplete:(NSError *)error
{
XCTAssertEqual(error.code, 0);
[_expectation fulfill];
_expectation = nil;
}
- (void)onAddressUpdated:(NSError *)error
{
XCTAssertEqual(error.code, 0);
[_expectation fulfill];
_expectation = nil;
}
@end
@interface CHIPClustersTests : XCTestCase
@end
@implementation CHIPClustersTests
- (void)setUp
{
[super setUp];
[self setContinueAfterFailure:NO];
}
- (void)testInitStack
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Pairing Complete"];
CHIPDeviceController * controller = [CHIPDeviceController sharedController];
XCTAssertNotNil(controller);
CHIPToolPairingDelegate * pairing = [[CHIPToolPairingDelegate alloc] initWithExpectation:expectation];
dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.pairing", DISPATCH_QUEUE_SERIAL);
[controller setListenPort:kLocalPort];
[controller setPairingDelegate:pairing queue:callbackQueue];
BOOL started = [controller startup:nil vendorId:0 nocSigner:nil];
XCTAssertTrue(started);
NSError * error;
[controller pairDevice:kDeviceId
address:kAddress
port:kRemotePort
discriminator:kDiscriminator
setupPINCode:kSetupPINCode
error:&error];
XCTAssertEqual(error.code, 0);
[self waitForExpectationsWithTimeout:kPairingTimeoutInSeconds handler:nil];
__block XCTestExpectation * connectionExpectation = [self expectationWithDescription:@"CASE established"];
[controller getConnectedDevice:kDeviceId
queue:dispatch_get_main_queue()
completionHandler:^(CHIPDevice * _Nullable device, NSError * _Nullable error) {
XCTAssertEqual(error.code, 0);
[connectionExpectation fulfill];
connectionExpectation = nil;
}];
[self waitForExpectationsWithTimeout:kCASESetupTimeoutInSeconds handler:nil];
}
- (void)testShutdownStack
{
CHIPDeviceController * controller = [CHIPDeviceController sharedController];
XCTAssertNotNil(controller);
NSError * error;
[controller unpairDevice:kDeviceId error:&error];
XCTAssertEqual(error.code, 0);
BOOL stopped = [controller shutdown];
XCTAssertTrue(stopped);
}
- (void)testReuseChipClusterObject
{
CHIPDeviceController * controller = [CHIPDeviceController sharedController];
XCTAssertNotNil(controller);
__block CHIPDevice * device;
__block XCTestExpectation * connectionExpectation = [self expectationWithDescription:@"CASE established"];
[controller getConnectedDevice:kDeviceId
queue:dispatch_get_main_queue()
completionHandler:^(CHIPDevice * _Nullable retrievedDevice, NSError * _Nullable error) {
XCTAssertEqual(error.code, 0);
[connectionExpectation fulfill];
connectionExpectation = nil;
device = retrievedDevice;
}];
[self waitForExpectationsWithTimeout:kCASESetupTimeoutInSeconds handler:nil];
XCTestExpectation * expectation = [self expectationWithDescription:@"ReuseCHIPClusterObjectFirstCall"];
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestCluster * cluster = [[CHIPTestCluster alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster testWithCompletionHandler:^(NSError * err) {
NSLog(@"ReuseCHIPClusterObject test Error: %@", err);
XCTAssertEqual(err.code, 0);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
expectation = [self expectationWithDescription:@"ReuseCHIPClusterObjectSecondCall"];
// Reuse the CHIPCluster Object for multiple times.
[cluster testWithCompletionHandler:^(NSError * err) {
NSLog(@"ReuseCHIPClusterObject test Error: %@", err);
XCTAssertEqual(err.code, 0);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_BI_1_1_000000_WaitForCommissionee
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"];
dispatch_queue_t queue = dispatch_get_main_queue();
WaitForCommissionee(expectation, queue);
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_BI_1_1_000001_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"read the global attribute: ClusterRevision"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestBinaryInputBasic * cluster = [[CHIPTestBinaryInputBasic alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeClusterRevisionWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"read the global attribute: ClusterRevision Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertEqual([actualValue unsignedShortValue], 1U);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_BI_1_1_000002_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Read the global attribute constraints: ClusterRevision"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestBinaryInputBasic * cluster = [[CHIPTestBinaryInputBasic alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeClusterRevisionWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"Read the global attribute constraints: ClusterRevision Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_BI_1_1_000003_WriteAttribute
{
XCTestExpectation * expectation =
[self expectationWithDescription:@"write the default values to mandatory global attribute: ClusterRevision"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestBinaryInputBasic * cluster = [[CHIPTestBinaryInputBasic alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
id clusterRevisionArgument;
clusterRevisionArgument = [NSNumber numberWithUnsignedShort:1U];
[cluster
writeAttributeClusterRevisionWithValue:clusterRevisionArgument
completionHandler:^(NSError * _Nullable err) {
NSLog(@"write the default values to mandatory global attribute: ClusterRevision Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], EMBER_ZCL_STATUS_UNSUPPORTED_WRITE);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_BI_1_1_000004_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"reads back global attribute: ClusterRevision"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestBinaryInputBasic * cluster = [[CHIPTestBinaryInputBasic alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeClusterRevisionWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"reads back global attribute: ClusterRevision Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertEqual([actualValue unsignedShortValue], 1U);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_BI_2_1_000000_WaitForCommissionee
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"];
dispatch_queue_t queue = dispatch_get_main_queue();
WaitForCommissionee(expectation, queue);
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_BI_2_1_000001_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Read mandatory non-global attribute: OutOfService"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestBinaryInputBasic * cluster = [[CHIPTestBinaryInputBasic alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeOutOfServiceWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"Read mandatory non-global attribute: OutOfService Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertEqual([actualValue boolValue], 0);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_BI_2_1_000002_ReadAttribute
{
XCTestExpectation * expectation =
[self expectationWithDescription:@"Read mandatory non-global attribute constraints: OutOfService"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestBinaryInputBasic * cluster = [[CHIPTestBinaryInputBasic alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeOutOfServiceWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"Read mandatory non-global attribute constraints: OutOfService Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_BI_2_1_000003_WriteAttribute
{
XCTestExpectation * expectation =
[self expectationWithDescription:@"Write the default values to mandatory non-global attribute: OutOfService"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestBinaryInputBasic * cluster = [[CHIPTestBinaryInputBasic alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
id outOfServiceArgument;
outOfServiceArgument = [NSNumber numberWithBool:0];
[cluster
writeAttributeOutOfServiceWithValue:outOfServiceArgument
completionHandler:^(NSError * _Nullable err) {
NSLog(@"Write the default values to mandatory non-global attribute: OutOfService Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_BI_2_1_000004_ReadAttribute
{
XCTestExpectation * expectation =
[self expectationWithDescription:@"Reads back the mandatory non-global attribute: OutOfService"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestBinaryInputBasic * cluster = [[CHIPTestBinaryInputBasic alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeOutOfServiceWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"Reads back the mandatory non-global attribute: OutOfService Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertEqual([actualValue boolValue], 0);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_BI_2_1_000005_ReadAttribute
{
XCTestExpectation * expectation =
[self expectationWithDescription:@"Read mandatory non-global attribute constraints: PresentValue"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestBinaryInputBasic * cluster = [[CHIPTestBinaryInputBasic alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributePresentValueWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"Read mandatory non-global attribute constraints: PresentValue Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_BI_2_1_000006_WriteAttribute
{
XCTestExpectation * expectation =
[self expectationWithDescription:@"Write the default values to mandatory non-global attribute: PresentValue"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestBinaryInputBasic * cluster = [[CHIPTestBinaryInputBasic alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
id presentValueArgument;
presentValueArgument = [NSNumber numberWithBool:0];
[cluster
writeAttributePresentValueWithValue:presentValueArgument
completionHandler:^(NSError * _Nullable err) {
NSLog(@"Write the default values to mandatory non-global attribute: PresentValue Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_BI_2_1_000007_ReadAttribute
{
XCTestExpectation * expectation =
[self expectationWithDescription:@"Reads back the mandatory non-global attribute: PresentValue"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestBinaryInputBasic * cluster = [[CHIPTestBinaryInputBasic alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributePresentValueWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"Reads back the mandatory non-global attribute: PresentValue Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertEqual([actualValue boolValue], 0);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_BI_2_1_000008_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Read mandatory non-global attribute: StatusFlags"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestBinaryInputBasic * cluster = [[CHIPTestBinaryInputBasic alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeStatusFlagsWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"Read mandatory non-global attribute: StatusFlags Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertEqual([actualValue unsignedCharValue], 0);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_BI_2_1_000009_ReadAttribute
{
XCTestExpectation * expectation =
[self expectationWithDescription:@"Read mandatory non-global attribute constraints: StatusFlags"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestBinaryInputBasic * cluster = [[CHIPTestBinaryInputBasic alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeStatusFlagsWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"Read mandatory non-global attribute constraints: StatusFlags Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertLessThanOrEqual([actualValue unsignedCharValue], 15);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_BI_2_1_000010_WriteAttribute
{
XCTestExpectation * expectation =
[self expectationWithDescription:@"Write the default values to mandatory non-global attribute: StatusFlags"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestBinaryInputBasic * cluster = [[CHIPTestBinaryInputBasic alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
id statusFlagsArgument;
statusFlagsArgument = [NSNumber numberWithUnsignedChar:0];
[cluster writeAttributeStatusFlagsWithValue:statusFlagsArgument
completionHandler:^(NSError * _Nullable err) {
NSLog(@"Write the default values to mandatory non-global attribute: StatusFlags Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], EMBER_ZCL_STATUS_UNSUPPORTED_WRITE);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_BI_2_1_000011_ReadAttribute
{
XCTestExpectation * expectation =
[self expectationWithDescription:@"Reads back the mandatory non-global attribute: StatusFlags"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestBinaryInputBasic * cluster = [[CHIPTestBinaryInputBasic alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeStatusFlagsWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"Reads back the mandatory non-global attribute: StatusFlags Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertEqual([actualValue unsignedCharValue], 0);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_BI_2_2_000000_WaitForCommissionee
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"];
dispatch_queue_t queue = dispatch_get_main_queue();
WaitForCommissionee(expectation, queue);
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_BI_2_2_000001_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Reads PresentValue attribute from DUT"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestBinaryInputBasic * cluster = [[CHIPTestBinaryInputBasic alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributePresentValueWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"Reads PresentValue attribute from DUT Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertEqual([actualValue boolValue], 0);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_BI_2_2_000002_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Reads OutOfService attribute from DUT"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestBinaryInputBasic * cluster = [[CHIPTestBinaryInputBasic alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeOutOfServiceWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"Reads OutOfService attribute from DUT Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertEqual([actualValue boolValue], 0);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_BI_2_2_000003_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Reads StatusFlags attribute from DUT"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestBinaryInputBasic * cluster = [[CHIPTestBinaryInputBasic alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeStatusFlagsWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"Reads StatusFlags attribute from DUT Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertEqual([actualValue unsignedCharValue], 0);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_BI_2_2_000004_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Reads PresentValue attribute from DUT"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestBinaryInputBasic * cluster = [[CHIPTestBinaryInputBasic alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributePresentValueWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"Reads PresentValue attribute from DUT Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertEqual([actualValue boolValue], 0);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_BI_2_2_000005_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Reads OutOfService attribute from DUT"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestBinaryInputBasic * cluster = [[CHIPTestBinaryInputBasic alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeOutOfServiceWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"Reads OutOfService attribute from DUT Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertEqual([actualValue boolValue], 0);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_BI_2_2_000006_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Reads StatusFlags attribute from DUT"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestBinaryInputBasic * cluster = [[CHIPTestBinaryInputBasic alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeStatusFlagsWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"Reads StatusFlags attribute from DUT Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertEqual([actualValue unsignedCharValue], 0);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_BI_2_2_000007_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Reads StatusFlags attribute from DUT"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestBinaryInputBasic * cluster = [[CHIPTestBinaryInputBasic alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeStatusFlagsWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"Reads StatusFlags attribute from DUT Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertEqual([actualValue unsignedCharValue], 0);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_BI_2_2_000008_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Reads StatusFlags attribute from DUT"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestBinaryInputBasic * cluster = [[CHIPTestBinaryInputBasic alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeStatusFlagsWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"Reads StatusFlags attribute from DUT Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertEqual([actualValue unsignedCharValue], 0);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_BOOL_1_1_000000_WaitForCommissionee
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"];
dispatch_queue_t queue = dispatch_get_main_queue();
WaitForCommissionee(expectation, queue);
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_BOOL_1_1_000001_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"read the global attribute: ClusterRevision"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestBooleanState * cluster = [[CHIPTestBooleanState alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeClusterRevisionWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"read the global attribute: ClusterRevision Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertEqual([actualValue unsignedShortValue], 1U);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_BOOL_1_1_000002_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Read the global attribute constraints: ClusterRevision"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestBooleanState * cluster = [[CHIPTestBooleanState alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeClusterRevisionWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"Read the global attribute constraints: ClusterRevision Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_BOOL_1_1_000003_WriteAttribute
{
XCTestExpectation * expectation =
[self expectationWithDescription:@"write the default values to mandatory global attribute: ClusterRevision"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestBooleanState * cluster = [[CHIPTestBooleanState alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
id clusterRevisionArgument;
clusterRevisionArgument = [NSNumber numberWithUnsignedShort:1U];
[cluster
writeAttributeClusterRevisionWithValue:clusterRevisionArgument
completionHandler:^(NSError * _Nullable err) {
NSLog(@"write the default values to mandatory global attribute: ClusterRevision Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], EMBER_ZCL_STATUS_UNSUPPORTED_WRITE);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_BOOL_1_1_000004_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"reads back global attribute: ClusterRevision"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestBooleanState * cluster = [[CHIPTestBooleanState alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeClusterRevisionWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"reads back global attribute: ClusterRevision Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertEqual([actualValue unsignedShortValue], 1U);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_BOOL_2_1_000000_WaitForCommissionee
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"];
dispatch_queue_t queue = dispatch_get_main_queue();
WaitForCommissionee(expectation, queue);
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_BOOL_2_1_000001_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Read mandatory non-global attribute: StateValue"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestBooleanState * cluster = [[CHIPTestBooleanState alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeStateValueWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"Read mandatory non-global attribute: StateValue Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertEqual([actualValue boolValue], 0);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_BOOL_2_1_000002_ReadAttribute
{
XCTestExpectation * expectation =
[self expectationWithDescription:@"Read mandatory non-global attribute constraints: StateValue"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestBooleanState * cluster = [[CHIPTestBooleanState alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeStateValueWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"Read mandatory non-global attribute constraints: StateValue Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_BOOL_2_1_000003_WriteAttribute
{
XCTestExpectation * expectation =
[self expectationWithDescription:@"Write the default value to mandatory non-global attribute: StateValue"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestBooleanState * cluster = [[CHIPTestBooleanState alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
id stateValueArgument;
stateValueArgument = [NSNumber numberWithBool:1];
[cluster writeAttributeStateValueWithValue:stateValueArgument
completionHandler:^(NSError * _Nullable err) {
NSLog(@"Write the default value to mandatory non-global attribute: StateValue Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], EMBER_ZCL_STATUS_UNSUPPORTED_WRITE);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_BOOL_2_1_000004_ReadAttribute
{
XCTestExpectation * expectation =
[self expectationWithDescription:@"Reads back the mandatory non-global attribute: StateValue"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestBooleanState * cluster = [[CHIPTestBooleanState alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeStateValueWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"Reads back the mandatory non-global attribute: StateValue Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertEqual([actualValue boolValue], 0);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_CC_1_1_000000_WaitForCommissionee
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"];
dispatch_queue_t queue = dispatch_get_main_queue();
WaitForCommissionee(expectation, queue);
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_CC_1_1_000001_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Read the global attribute constraints : ClusterRevision"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeClusterRevisionWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"Read the global attribute constraints : ClusterRevision Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_CC_1_1_000002_WriteAttribute
{
XCTestExpectation * expectation =
[self expectationWithDescription:@"write the default values to mandatory global attribute: ClusterRevision"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
id clusterRevisionArgument;
clusterRevisionArgument = [NSNumber numberWithUnsignedShort:4U];
[cluster
writeAttributeClusterRevisionWithValue:clusterRevisionArgument
completionHandler:^(NSError * _Nullable err) {
NSLog(@"write the default values to mandatory global attribute: ClusterRevision Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], EMBER_ZCL_STATUS_UNSUPPORTED_WRITE);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_CC_2_1_000000_WaitForCommissionee
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"];
dispatch_queue_t queue = dispatch_get_main_queue();
WaitForCommissionee(expectation, queue);
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_CC_2_1_000001_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Reads mandatory attribute: CurrentHue"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeCurrentHueWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"Reads mandatory attribute: CurrentHue Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertEqual([actualValue unsignedCharValue], 0);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_CC_2_1_000002_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Validate constraints of attribute: current hue"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeCurrentHueWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"Validate constraints of attribute: current hue Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertLessThanOrEqual([actualValue unsignedCharValue], 254);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_CC_2_1_000003_WriteAttribute
{
XCTestExpectation * expectation =
[self expectationWithDescription:@"Write the default value to mandatory attribute: CurrentHue"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
id currentHueArgument;
currentHueArgument = [NSNumber numberWithUnsignedChar:0];
[cluster writeAttributeCurrentHueWithValue:currentHueArgument
completionHandler:^(NSError * _Nullable err) {
NSLog(@"Write the default value to mandatory attribute: CurrentHue Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], EMBER_ZCL_STATUS_UNSUPPORTED_WRITE);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_CC_2_1_000004_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Reads back mandatory attribute: CurrentHue"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeCurrentHueWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"Reads back mandatory attribute: CurrentHue Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertEqual([actualValue unsignedCharValue], 0);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_CC_2_1_000005_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Reads mandatory attribute: CurrentSaturation"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeCurrentSaturationWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"Reads mandatory attribute: CurrentSaturation Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertEqual([actualValue unsignedCharValue], 0);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_CC_2_1_000006_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Validate constraints of attribute: CurrentSaturation"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeCurrentSaturationWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"Validate constraints of attribute: CurrentSaturation Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertLessThanOrEqual([actualValue unsignedCharValue], 254);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_CC_2_1_000007_WriteAttribute
{
XCTestExpectation * expectation =
[self expectationWithDescription:@"Write the default value to mandatory attribute: CurrentSaturation"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
id currentSaturationArgument;
currentSaturationArgument = [NSNumber numberWithUnsignedChar:0];
[cluster
writeAttributeCurrentSaturationWithValue:currentSaturationArgument
completionHandler:^(NSError * _Nullable err) {
NSLog(@"Write the default value to mandatory attribute: CurrentSaturation Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], EMBER_ZCL_STATUS_UNSUPPORTED_WRITE);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_CC_2_1_000008_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Reads back mandatory attribute: CurrentSaturation"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeCurrentSaturationWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"Reads back mandatory attribute: CurrentSaturation Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertEqual([actualValue unsignedCharValue], 0);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_CC_2_1_000009_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Read the mandatory attribute: CurrentX"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeCurrentXWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"Read the mandatory attribute: CurrentX Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertEqual([actualValue unsignedShortValue], 24939U);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_CC_2_1_000010_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Validate constraints of attribute: CurrentX"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeCurrentXWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"Validate constraints of attribute: CurrentX Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertLessThanOrEqual([actualValue unsignedShortValue], 65279);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_CC_2_1_000011_WriteAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Write the default value to mandatory attribute: CurrentX"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
id currentXArgument;
currentXArgument = [NSNumber numberWithUnsignedShort:24939U];
[cluster writeAttributeCurrentXWithValue:currentXArgument
completionHandler:^(NSError * _Nullable err) {
NSLog(@"Write the default value to mandatory attribute: CurrentX Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], EMBER_ZCL_STATUS_UNSUPPORTED_WRITE);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_CC_2_1_000012_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Reads back mandatory attribute: CurrentX"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeCurrentXWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"Reads back mandatory attribute: CurrentX Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertEqual([actualValue unsignedShortValue], 24939U);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_CC_2_1_000013_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Read the mandatory attribute: CurrentY"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeCurrentYWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"Read the mandatory attribute: CurrentY Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertEqual([actualValue unsignedShortValue], 24701U);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_CC_2_1_000014_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Validate constraints of attribute: CurrentY"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeCurrentYWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"Validate constraints of attribute: CurrentY Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertLessThanOrEqual([actualValue unsignedShortValue], 65279);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_CC_2_1_000015_WriteAttribute
{
XCTestExpectation * expectation =
[self expectationWithDescription:@"Write the default values to mandatory attribute: CurrentY"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
id currentYArgument;
currentYArgument = [NSNumber numberWithUnsignedShort:24701U];
[cluster writeAttributeCurrentYWithValue:currentYArgument
completionHandler:^(NSError * _Nullable err) {
NSLog(@"Write the default values to mandatory attribute: CurrentY Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], EMBER_ZCL_STATUS_UNSUPPORTED_WRITE);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_CC_2_1_000016_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Reads back mandatory attribute: CurrentY"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeCurrentYWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"Reads back mandatory attribute: CurrentY Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertEqual([actualValue unsignedShortValue], 24701U);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_CC_2_1_000017_ReadAttribute
{
XCTestExpectation * expectation =
[self expectationWithDescription:@"Validate constraints of attribute: ColorTemperatureMireds"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeColorTemperatureWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"Validate constraints of attribute: ColorTemperatureMireds Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertLessThanOrEqual([actualValue unsignedShortValue], 65279);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_CC_2_1_000018_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Validate constraints of attribute: ColorMode"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeColorModeWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"Validate constraints of attribute: ColorMode Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertLessThanOrEqual([actualValue unsignedCharValue], 2);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_CC_2_1_000019_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Read the mandatory attribute: Options"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeColorControlOptionsWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"Read the mandatory attribute: Options Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertEqual([actualValue unsignedCharValue], 0);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_CC_2_1_000020_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Validate constraints of attribute: Options"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeColorControlOptionsWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"Validate constraints of attribute: Options Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_CC_2_1_000021_WriteAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Write the default values to mandatory attribute: Options"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
id colorControlOptionsArgument;
colorControlOptionsArgument = [NSNumber numberWithUnsignedChar:0];
[cluster writeAttributeColorControlOptionsWithValue:colorControlOptionsArgument
completionHandler:^(NSError * _Nullable err) {
NSLog(@"Write the default values to mandatory attribute: Options Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_CC_2_1_000022_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Reads back mandatory attribute: Options"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeColorControlOptionsWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"Reads back mandatory attribute: Options Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertEqual([actualValue unsignedCharValue], 0);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_CC_2_1_000023_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Read the mandatory attribute: EnhancedCurrentHue"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeEnhancedCurrentHueWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"Read the mandatory attribute: EnhancedCurrentHue Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertEqual([actualValue unsignedShortValue], 0U);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_CC_2_1_000024_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Validate constraints of attribute: EnhancedCurrentHue"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeEnhancedCurrentHueWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"Validate constraints of attribute: EnhancedCurrentHue Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_CC_2_1_000025_WriteAttribute
{
XCTestExpectation * expectation =
[self expectationWithDescription:@"Write the default values to mandatory attribute: EnhancedCurrentHue"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
id enhancedCurrentHueArgument;
enhancedCurrentHueArgument = [NSNumber numberWithUnsignedShort:0U];
[cluster
writeAttributeEnhancedCurrentHueWithValue:enhancedCurrentHueArgument
completionHandler:^(NSError * _Nullable err) {
NSLog(@"Write the default values to mandatory attribute: EnhancedCurrentHue Error: %@", err);
XCTAssertEqual(
[CHIPErrorTestUtils errorToZCLErrorCode:err], EMBER_ZCL_STATUS_UNSUPPORTED_WRITE);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_CC_2_1_000026_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Reads back mandatory attribute: EnhancedCurrentHue"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeEnhancedCurrentHueWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"Reads back mandatory attribute: EnhancedCurrentHue Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertEqual([actualValue unsignedShortValue], 0U);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_CC_2_1_000027_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Validate constraints of attribute: EnhancedColorMode"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeEnhancedColorModeWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"Validate constraints of attribute: EnhancedColorMode Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_CC_2_1_000028_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Read the mandatory attribute: ColorLoopActive"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeColorLoopActiveWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"Read the mandatory attribute: ColorLoopActive Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertEqual([actualValue unsignedCharValue], 0);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_CC_2_1_000029_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Validate constraints of attribute: ColorLoopActive"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeColorLoopActiveWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"Validate constraints of attribute: ColorLoopActive Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_CC_2_1_000030_WriteAttribute
{
XCTestExpectation * expectation =
[self expectationWithDescription:@"Write the default values to mandatory attribute: ColorLoopActive"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
id colorLoopActiveArgument;
colorLoopActiveArgument = [NSNumber numberWithUnsignedChar:0];
[cluster
writeAttributeColorLoopActiveWithValue:colorLoopActiveArgument
completionHandler:^(NSError * _Nullable err) {
NSLog(@"Write the default values to mandatory attribute: ColorLoopActive Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], EMBER_ZCL_STATUS_UNSUPPORTED_WRITE);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_CC_2_1_000031_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Reads back mandatory attribute: ColorLoopActive"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeColorLoopActiveWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"Reads back mandatory attribute: ColorLoopActive Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertEqual([actualValue unsignedCharValue], 0);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_CC_2_1_000032_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Read the mandatory attribute: ColorLoopDirection"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeColorLoopDirectionWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"Read the mandatory attribute: ColorLoopDirection Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertEqual([actualValue unsignedCharValue], 0);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_CC_2_1_000033_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Validate constraints of attribute: ColorLoopDirection"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeColorLoopDirectionWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"Validate constraints of attribute: ColorLoopDirection Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_CC_2_1_000034_WriteAttribute
{
XCTestExpectation * expectation =
[self expectationWithDescription:@"Write the default values to mandatory attribute: ColorLoopDirection"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
id colorLoopDirectionArgument;
colorLoopDirectionArgument = [NSNumber numberWithUnsignedChar:0];
[cluster
writeAttributeColorLoopDirectionWithValue:colorLoopDirectionArgument
completionHandler:^(NSError * _Nullable err) {
NSLog(@"Write the default values to mandatory attribute: ColorLoopDirection Error: %@", err);
XCTAssertEqual(
[CHIPErrorTestUtils errorToZCLErrorCode:err], EMBER_ZCL_STATUS_UNSUPPORTED_WRITE);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_CC_2_1_000035_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Reads back mandatory attribute: ColorLoopDirection"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeColorLoopDirectionWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"Reads back mandatory attribute: ColorLoopDirection Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertEqual([actualValue unsignedCharValue], 0);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_CC_2_1_000036_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Read the mandatory attribute: ColorLoopTime"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeColorLoopTimeWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"Read the mandatory attribute: ColorLoopTime Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertEqual([actualValue unsignedShortValue], 25U);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_CC_2_1_000037_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Validate constraints of attribute: ColorLoopTime"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeColorLoopTimeWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"Validate constraints of attribute: ColorLoopTime Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_CC_2_1_000038_WriteAttribute
{
XCTestExpectation * expectation =
[self expectationWithDescription:@"Write the default values to mandatory attribute: ColorLoopTime"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
id colorLoopTimeArgument;
colorLoopTimeArgument = [NSNumber numberWithUnsignedShort:25U];
[cluster
writeAttributeColorLoopTimeWithValue:colorLoopTimeArgument
completionHandler:^(NSError * _Nullable err) {
NSLog(@"Write the default values to mandatory attribute: ColorLoopTime Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], EMBER_ZCL_STATUS_UNSUPPORTED_WRITE);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_CC_2_1_000039_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Reads back mandatory attribute: ColorLoopTime"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeColorLoopTimeWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"Reads back mandatory attribute: ColorLoopTime Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertEqual([actualValue unsignedShortValue], 25U);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_CC_2_1_000040_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Read the mandatory attribute: ColorLoopStartEnhancedHue"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeColorLoopStartEnhancedHueWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"Read the mandatory attribute: ColorLoopStartEnhancedHue Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertEqual([actualValue unsignedShortValue], 8960U);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_CC_2_1_000041_ReadAttribute
{
XCTestExpectation * expectation =
[self expectationWithDescription:@"Validate constraints of attribute: ColorLoopStartEnhancedHue"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeColorLoopStartEnhancedHueWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"Validate constraints of attribute: ColorLoopStartEnhancedHue Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_CC_2_1_000042_WriteAttribute
{
XCTestExpectation * expectation =
[self expectationWithDescription:@"Write the default values to mandatory attribute: ColorLoopStartEnhancedHue"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
id colorLoopStartEnhancedHueArgument;
colorLoopStartEnhancedHueArgument = [NSNumber numberWithUnsignedShort:8960U];
[cluster writeAttributeColorLoopStartEnhancedHueWithValue:colorLoopStartEnhancedHueArgument
completionHandler:^(NSError * _Nullable err) {
NSLog(@"Write the default values to mandatory attribute: ColorLoopStartEnhancedHue "
@"Error: %@",
err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err],
EMBER_ZCL_STATUS_UNSUPPORTED_WRITE);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_CC_2_1_000043_ReadAttribute
{
XCTestExpectation * expectation =
[self expectationWithDescription:@"Reads back mandatory attribute: ColorLoopStartEnhancedHue"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeColorLoopStartEnhancedHueWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"Reads back mandatory attribute: ColorLoopStartEnhancedHue Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertEqual([actualValue unsignedShortValue], 8960U);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_CC_2_1_000044_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Read the mandatory attribute: ColorLoopStoredEnhancedHue"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeColorLoopStoredEnhancedHueWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"Read the mandatory attribute: ColorLoopStoredEnhancedHue Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertEqual([actualValue unsignedShortValue], 0U);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_CC_2_1_000045_ReadAttribute
{
XCTestExpectation * expectation =
[self expectationWithDescription:@"Validate constraints of attribute: ColorLoopStoredEnhancedHue"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeColorLoopStoredEnhancedHueWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"Validate constraints of attribute: ColorLoopStoredEnhancedHue Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_CC_2_1_000046_WriteAttribute
{
XCTestExpectation * expectation =
[self expectationWithDescription:@"Write the default values to mandatory attribute: ColorLoopStoredEnhancedHue"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
id colorLoopStoredEnhancedHueArgument;
colorLoopStoredEnhancedHueArgument = [NSNumber numberWithUnsignedShort:0U];
[cluster writeAttributeColorLoopStoredEnhancedHueWithValue:colorLoopStoredEnhancedHueArgument
completionHandler:^(NSError * _Nullable err) {
NSLog(@"Write the default values to mandatory attribute: "
@"ColorLoopStoredEnhancedHue Error: %@",
err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err],
EMBER_ZCL_STATUS_UNSUPPORTED_WRITE);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_CC_2_1_000047_ReadAttribute
{
XCTestExpectation * expectation =
[self expectationWithDescription:@"Reads back mandatory attribute: ColorLoopStoredEnhancedHue"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeColorLoopStoredEnhancedHueWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"Reads back mandatory attribute: ColorLoopStoredEnhancedHue Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertEqual([actualValue unsignedShortValue], 0U);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_CC_2_1_000048_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Read the mandatory attribute: ColorCapabilities"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeColorCapabilitiesWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"Read the mandatory attribute: ColorCapabilities Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertEqual([actualValue unsignedShortValue], 0U);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_CC_2_1_000049_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Validate constraints of attribute: ColorCapabilities"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeColorCapabilitiesWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"Validate constraints of attribute: ColorCapabilities Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertLessThanOrEqual([actualValue unsignedShortValue], 65279);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_CC_2_1_000050_WriteAttribute
{
XCTestExpectation * expectation =
[self expectationWithDescription:@"Write the default values to mandatory attribute: ColorCapabilities"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
id colorCapabilitiesArgument;
colorCapabilitiesArgument = [NSNumber numberWithUnsignedShort:0U];
[cluster
writeAttributeColorCapabilitiesWithValue:colorCapabilitiesArgument
completionHandler:^(NSError * _Nullable err) {
NSLog(@"Write the default values to mandatory attribute: ColorCapabilities Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], EMBER_ZCL_STATUS_UNSUPPORTED_WRITE);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_CC_2_1_000051_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Reads back mandatory attribute: ColorCapabilities"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeColorCapabilitiesWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"Reads back mandatory attribute: ColorCapabilities Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertEqual([actualValue unsignedShortValue], 0U);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_CC_2_1_000052_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Read the mandatory attribute: ColorTempPhysicalMinMireds"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeColorTempPhysicalMinWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"Read the mandatory attribute: ColorTempPhysicalMinMireds Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertEqual([actualValue unsignedShortValue], 0U);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_CC_2_1_000053_ReadAttribute
{
XCTestExpectation * expectation =
[self expectationWithDescription:@"Validate constraints of attribute: ColorTempPhysicalMinMireds"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeColorTempPhysicalMinWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"Validate constraints of attribute: ColorTempPhysicalMinMireds Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertLessThanOrEqual([actualValue unsignedShortValue], 65279);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_CC_2_1_000054_WriteAttribute
{
XCTestExpectation * expectation =
[self expectationWithDescription:@"Write the default values to mandatory attribute: ColorTempPhysicalMinMireds"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
id colorTempPhysicalMinArgument;
colorTempPhysicalMinArgument = [NSNumber numberWithUnsignedShort:0U];
[cluster
writeAttributeColorTempPhysicalMinWithValue:colorTempPhysicalMinArgument
completionHandler:^(NSError * _Nullable err) {
NSLog(
@"Write the default values to mandatory attribute: ColorTempPhysicalMinMireds Error: %@",
err);
XCTAssertEqual(
[CHIPErrorTestUtils errorToZCLErrorCode:err], EMBER_ZCL_STATUS_UNSUPPORTED_WRITE);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_CC_2_1_000055_ReadAttribute
{
XCTestExpectation * expectation =
[self expectationWithDescription:@"Reads back mandatory attribute: ColorTempPhysicalMinMireds"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeColorTempPhysicalMinWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"Reads back mandatory attribute: ColorTempPhysicalMinMireds Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertEqual([actualValue unsignedShortValue], 0U);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_CC_2_1_000056_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Read the mandatory attribute: ColorTempPhysicalMaxMireds"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeColorTempPhysicalMaxWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"Read the mandatory attribute: ColorTempPhysicalMaxMireds Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertEqual([actualValue unsignedShortValue], 65279U);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_CC_2_1_000057_ReadAttribute
{
XCTestExpectation * expectation =
[self expectationWithDescription:@"Validate constraints of attribute: ColorTempPhysicalMaxMireds"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeColorTempPhysicalMaxWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"Validate constraints of attribute: ColorTempPhysicalMaxMireds Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertLessThanOrEqual([actualValue unsignedShortValue], 65279);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_CC_2_1_000058_WriteAttribute
{
XCTestExpectation * expectation =
[self expectationWithDescription:@"Write the default values to mandatory attribute: ColorTempPhysicalMaxMireds"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
id colorTempPhysicalMaxArgument;
colorTempPhysicalMaxArgument = [NSNumber numberWithUnsignedShort:65279U];
[cluster
writeAttributeColorTempPhysicalMaxWithValue:colorTempPhysicalMaxArgument
completionHandler:^(NSError * _Nullable err) {
NSLog(
@"Write the default values to mandatory attribute: ColorTempPhysicalMaxMireds Error: %@",
err);
XCTAssertEqual(
[CHIPErrorTestUtils errorToZCLErrorCode:err], EMBER_ZCL_STATUS_UNSUPPORTED_WRITE);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_CC_2_1_000059_ReadAttribute
{
XCTestExpectation * expectation =
[self expectationWithDescription:@"Reads back mandatory attribute: ColorTempPhysicalMaxMireds"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeColorTempPhysicalMaxWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"Reads back mandatory attribute: ColorTempPhysicalMaxMireds Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertEqual([actualValue unsignedShortValue], 65279U);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_CC_2_1_000060_ReadAttribute
{
XCTestExpectation * expectation =
[self expectationWithDescription:@"Read the optional attribute: CoupleColorTempToLevelMinMireds"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster
readAttributeCoupleColorTempToLevelMinMiredsWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"Read the optional attribute: CoupleColorTempToLevelMinMireds Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_CC_2_1_000061_WriteAttribute
{
XCTestExpectation * expectation =
[self expectationWithDescription:@"Write the default values to optional attribute: CoupleColorTempToLevelMinMireds"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
id coupleColorTempToLevelMinMiredsArgument;
coupleColorTempToLevelMinMiredsArgument = [NSNumber numberWithUnsignedShort:0U];
[cluster writeAttributeCoupleColorTempToLevelMinMiredsWithValue:coupleColorTempToLevelMinMiredsArgument
completionHandler:^(NSError * _Nullable err) {
NSLog(@"Write the default values to optional attribute: "
@"CoupleColorTempToLevelMinMireds Error: %@",
err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err],
EMBER_ZCL_STATUS_UNSUPPORTED_WRITE);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_CC_2_1_000062_ReadAttribute
{
XCTestExpectation * expectation =
[self expectationWithDescription:@"Reads back optional attribute: CoupleColorTempToLevelMinMireds"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster
readAttributeCoupleColorTempToLevelMinMiredsWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"Reads back optional attribute: CoupleColorTempToLevelMinMireds Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertEqual([actualValue unsignedShortValue], 0U);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_CC_2_1_000063_ReadAttribute
{
XCTestExpectation * expectation =
[self expectationWithDescription:@"Read the optional attribute: StartUpColorTemperatureMireds"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster
readAttributeStartUpColorTemperatureMiredsWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"Read the optional attribute: StartUpColorTemperatureMireds Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertLessThanOrEqual([actualValue unsignedShortValue], 65279);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_CC_2_1_000064_WriteAttribute
{
XCTestExpectation * expectation =
[self expectationWithDescription:@"Write the default values to optional attribute: StartUpColorTemperatureMireds"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
id startUpColorTemperatureMiredsArgument;
startUpColorTemperatureMiredsArgument = [NSNumber numberWithUnsignedShort:0U];
[cluster writeAttributeStartUpColorTemperatureMiredsWithValue:startUpColorTemperatureMiredsArgument
completionHandler:^(NSError * _Nullable err) {
NSLog(@"Write the default values to optional attribute: "
@"StartUpColorTemperatureMireds Error: %@",
err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_CC_2_1_000065_ReadAttribute
{
XCTestExpectation * expectation =
[self expectationWithDescription:@"Reads back optional attribute: StartUpColorTemperatureMireds"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster
readAttributeStartUpColorTemperatureMiredsWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"Reads back optional attribute: StartUpColorTemperatureMireds Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertEqual([actualValue unsignedShortValue], 0U);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_CC_2_1_000066_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Read the Optional attribute: RemainingTime"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeRemainingTimeWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"Read the Optional attribute: RemainingTime Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertEqual([actualValue unsignedShortValue], 0U);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_CC_2_1_000067_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Validate constraints of attribute: RemainingTime"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeRemainingTimeWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"Validate constraints of attribute: RemainingTime Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertLessThanOrEqual([actualValue unsignedShortValue], 254);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_CC_2_1_000068_WriteAttribute
{
XCTestExpectation * expectation =
[self expectationWithDescription:@"Write the default values to optional attribute: RemainingTime"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
id remainingTimeArgument;
remainingTimeArgument = [NSNumber numberWithUnsignedShort:0U];
[cluster
writeAttributeRemainingTimeWithValue:remainingTimeArgument
completionHandler:^(NSError * _Nullable err) {
NSLog(@"Write the default values to optional attribute: RemainingTime Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], EMBER_ZCL_STATUS_UNSUPPORTED_WRITE);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_CC_2_1_000069_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Reads back optional attribute: RemainingTime"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeRemainingTimeWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"Reads back optional attribute: RemainingTime Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertEqual([actualValue unsignedShortValue], 0U);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_CC_2_1_000070_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Read the optional attribute: DriftCompensation"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeDriftCompensationWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"Read the optional attribute: DriftCompensation Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertLessThanOrEqual([actualValue unsignedCharValue], 4);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_CC_2_1_000071_WriteAttribute
{
XCTestExpectation * expectation =
[self expectationWithDescription:@"Write the default values to optional attribute: DriftCompensation"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
id driftCompensationArgument;
driftCompensationArgument = [NSNumber numberWithUnsignedChar:0];
[cluster
writeAttributeDriftCompensationWithValue:driftCompensationArgument
completionHandler:^(NSError * _Nullable err) {
NSLog(@"Write the default values to optional attribute: DriftCompensation Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], EMBER_ZCL_STATUS_UNSUPPORTED_WRITE);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_CC_2_1_000072_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Reads back optional attribute: DriftCompensation"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeDriftCompensationWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"Reads back optional attribute: DriftCompensation Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertEqual([actualValue unsignedCharValue], 0);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_CC_2_1_000073_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Read the optional attribute: CompensationText"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeCompensationTextWithCompletionHandler:^(NSString * _Nullable value, NSError * _Nullable err) {
NSLog(@"Read the optional attribute: CompensationText Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertLessThanOrEqual([actualValue length], 254);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_CC_2_1_000074_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Read the mandatory attribute: NumberOfPrimaries"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeNumberOfPrimariesWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"Read the mandatory attribute: NumberOfPrimaries Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertLessThanOrEqual([actualValue unsignedCharValue], 6);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_CC_2_1_000075_WriteAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Write the default mandatory attribute: NumberOfPrimaries"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
id numberOfPrimariesArgument;
numberOfPrimariesArgument = [NSNumber numberWithUnsignedChar:0];
[cluster
writeAttributeNumberOfPrimariesWithValue:numberOfPrimariesArgument
completionHandler:^(NSError * _Nullable err) {
NSLog(@"Write the default mandatory attribute: NumberOfPrimaries Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], EMBER_ZCL_STATUS_UNSUPPORTED_WRITE);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_CC_2_1_000076_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Read back the mandatory attribute: NumberOfPrimaries"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeNumberOfPrimariesWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"Read back the mandatory attribute: NumberOfPrimaries Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertEqual([actualValue unsignedCharValue], 0);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_CC_2_1_000077_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Read the mandatory attribute: Primary1X"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributePrimary1XWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"Read the mandatory attribute: Primary1X Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertLessThanOrEqual([actualValue unsignedShortValue], 65279);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_CC_2_1_000078_WriteAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Write the default mandatory attribute: Primary1X"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
id primary1XArgument;
primary1XArgument = [NSNumber numberWithUnsignedShort:0U];
[cluster writeAttributePrimary1XWithValue:primary1XArgument
completionHandler:^(NSError * _Nullable err) {
NSLog(@"Write the default mandatory attribute: Primary1X Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], EMBER_ZCL_STATUS_UNSUPPORTED_WRITE);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_CC_2_1_000079_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Read back the mandatory attribute: Primary1X"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributePrimary1XWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"Read back the mandatory attribute: Primary1X Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertEqual([actualValue unsignedShortValue], 0U);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_CC_2_1_000080_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Read the mandatory attribute: Primary1Y"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributePrimary1YWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"Read the mandatory attribute: Primary1Y Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertLessThanOrEqual([actualValue unsignedShortValue], 65279);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_CC_2_1_000081_WriteAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Write the default mandatory attribute: Primary1Y"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
id primary1YArgument;
primary1YArgument = [NSNumber numberWithUnsignedShort:0U];
[cluster writeAttributePrimary1YWithValue:primary1YArgument
completionHandler:^(NSError * _Nullable err) {
NSLog(@"Write the default mandatory attribute: Primary1Y Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], EMBER_ZCL_STATUS_UNSUPPORTED_WRITE);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_CC_2_1_000082_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Read back the mandatory attribute: Primary1Y"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributePrimary1YWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"Read back the mandatory attribute: Primary1Y Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertEqual([actualValue unsignedShortValue], 0U);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_CC_2_1_000083_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Read the mandatory attribute: Primary1Intensity"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributePrimary1IntensityWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"Read the mandatory attribute: Primary1Intensity Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_CC_2_1_000084_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Read the mandatory attribute: Primary2X"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributePrimary2XWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"Read the mandatory attribute: Primary2X Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertLessThanOrEqual([actualValue unsignedShortValue], 65279);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_CC_2_1_000085_WriteAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Write the default mandatory attribute: Primary2X"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
id primary2XArgument;
primary2XArgument = [NSNumber numberWithUnsignedShort:0U];
[cluster writeAttributePrimary2XWithValue:primary2XArgument
completionHandler:^(NSError * _Nullable err) {
NSLog(@"Write the default mandatory attribute: Primary2X Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], EMBER_ZCL_STATUS_UNSUPPORTED_WRITE);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_CC_2_1_000086_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Read back the mandatory attribute: Primary2X"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributePrimary2XWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"Read back the mandatory attribute: Primary2X Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertEqual([actualValue unsignedShortValue], 0U);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_CC_2_1_000087_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Read the mandatory attribute: Primary2Y"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributePrimary2YWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"Read the mandatory attribute: Primary2Y Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertLessThanOrEqual([actualValue unsignedShortValue], 65279);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_CC_2_1_000088_WriteAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Write the default mandatory attribute: Primary2Y"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
id primary2YArgument;
primary2YArgument = [NSNumber numberWithUnsignedShort:0U];
[cluster writeAttributePrimary2YWithValue:primary2YArgument
completionHandler:^(NSError * _Nullable err) {
NSLog(@"Write the default mandatory attribute: Primary2Y Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], EMBER_ZCL_STATUS_UNSUPPORTED_WRITE);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_CC_2_1_000089_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Read back the mandatory attribute: Primary2Y"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributePrimary2YWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"Read back the mandatory attribute: Primary2Y Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertEqual([actualValue unsignedShortValue], 0U);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_CC_2_1_000090_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Validate constraints of attribute: Primary2Intensity"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributePrimary2IntensityWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"Validate constraints of attribute: Primary2Intensity Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_CC_2_1_000091_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Read the mandatory attribute: Primary3X"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributePrimary3XWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"Read the mandatory attribute: Primary3X Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertLessThanOrEqual([actualValue unsignedShortValue], 65279);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_CC_2_1_000092_WriteAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Write the default mandatory attribute: Primary3X"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
id primary3XArgument;
primary3XArgument = [NSNumber numberWithUnsignedShort:0U];
[cluster writeAttributePrimary3XWithValue:primary3XArgument
completionHandler:^(NSError * _Nullable err) {
NSLog(@"Write the default mandatory attribute: Primary3X Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], EMBER_ZCL_STATUS_UNSUPPORTED_WRITE);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_CC_2_1_000093_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Read back the mandatory attribute: Primary3X"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributePrimary3XWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"Read back the mandatory attribute: Primary3X Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertEqual([actualValue unsignedShortValue], 0U);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_CC_2_1_000094_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Read the mandatory attribute: Primary3Y"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributePrimary3YWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"Read the mandatory attribute: Primary3Y Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertLessThanOrEqual([actualValue unsignedShortValue], 65279);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_CC_2_1_000095_WriteAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Write the default mandatory attribute: Primary3Y"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
id primary3YArgument;
primary3YArgument = [NSNumber numberWithUnsignedShort:0U];
[cluster writeAttributePrimary3YWithValue:primary3YArgument
completionHandler:^(NSError * _Nullable err) {
NSLog(@"Write the default mandatory attribute: Primary3Y Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], EMBER_ZCL_STATUS_UNSUPPORTED_WRITE);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_CC_2_1_000096_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Read back the mandatory attribute: Primary3Y"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributePrimary3YWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"Read back the mandatory attribute: Primary3Y Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertEqual([actualValue unsignedShortValue], 0U);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_CC_2_1_000097_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Read the mandatory attribute: Primary3Intensity"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributePrimary3IntensityWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"Read the mandatory attribute: Primary3Intensity Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_CC_2_1_000098_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Read the mandatory attribute: Primary4X"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributePrimary4XWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"Read the mandatory attribute: Primary4X Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertLessThanOrEqual([actualValue unsignedShortValue], 65279);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_CC_2_1_000099_WriteAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Write the default mandatory attribute: Primary4X"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
id primary4XArgument;
primary4XArgument = [NSNumber numberWithUnsignedShort:0U];
[cluster writeAttributePrimary4XWithValue:primary4XArgument
completionHandler:^(NSError * _Nullable err) {
NSLog(@"Write the default mandatory attribute: Primary4X Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], EMBER_ZCL_STATUS_UNSUPPORTED_WRITE);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_CC_2_1_000100_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Read back the mandatory attribute: Primary4X"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributePrimary4XWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"Read back the mandatory attribute: Primary4X Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertEqual([actualValue unsignedShortValue], 0U);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_CC_2_1_000101_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Read the mandatory attribute: Primary4Y"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributePrimary4YWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"Read the mandatory attribute: Primary4Y Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertLessThanOrEqual([actualValue unsignedShortValue], 65279);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_CC_2_1_000102_WriteAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Write the default mandatory attribute: Primary4Y"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
id primary4YArgument;
primary4YArgument = [NSNumber numberWithUnsignedShort:0U];
[cluster writeAttributePrimary4YWithValue:primary4YArgument
completionHandler:^(NSError * _Nullable err) {
NSLog(@"Write the default mandatory attribute: Primary4Y Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], EMBER_ZCL_STATUS_UNSUPPORTED_WRITE);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_CC_2_1_000103_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Read back the mandatory attribute: Primary4Y"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributePrimary4YWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"Read back the mandatory attribute: Primary4Y Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertEqual([actualValue unsignedShortValue], 0U);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_CC_2_1_000104_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Read the mandatory attribute: Primary4Intensity"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributePrimary4IntensityWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"Read the mandatory attribute: Primary4Intensity Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_CC_2_1_000105_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Read the mandatory attribute: Primary5X"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributePrimary5XWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"Read the mandatory attribute: Primary5X Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertLessThanOrEqual([actualValue unsignedShortValue], 65279);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_CC_2_1_000106_WriteAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Write the default mandatory attribute: Primary5X"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
id primary5XArgument;
primary5XArgument = [NSNumber numberWithUnsignedShort:0U];
[cluster writeAttributePrimary5XWithValue:primary5XArgument
completionHandler:^(NSError * _Nullable err) {
NSLog(@"Write the default mandatory attribute: Primary5X Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], EMBER_ZCL_STATUS_UNSUPPORTED_WRITE);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_CC_2_1_000107_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Read back the mandatory attribute: Primary5X"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributePrimary5XWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"Read back the mandatory attribute: Primary5X Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertEqual([actualValue unsignedShortValue], 0U);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_CC_2_1_000108_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Read the mandatory attribute: Primary5Y"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributePrimary5YWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"Read the mandatory attribute: Primary5Y Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertLessThanOrEqual([actualValue unsignedShortValue], 65279);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_CC_2_1_000109_WriteAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Write the default mandatory attribute: Primary5Y"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
id primary5YArgument;
primary5YArgument = [NSNumber numberWithUnsignedShort:0U];
[cluster writeAttributePrimary5YWithValue:primary5YArgument
completionHandler:^(NSError * _Nullable err) {
NSLog(@"Write the default mandatory attribute: Primary5Y Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], EMBER_ZCL_STATUS_UNSUPPORTED_WRITE);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_CC_2_1_000110_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Read back the mandatory attribute: Primary5Y"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributePrimary5YWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"Read back the mandatory attribute: Primary5Y Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertEqual([actualValue unsignedShortValue], 0U);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_CC_2_1_000111_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Read the mandatory attribute: Primary5Intensity"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributePrimary5IntensityWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"Read the mandatory attribute: Primary5Intensity Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_CC_2_1_000112_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Read the mandatory attribute: Primary6X"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributePrimary6XWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"Read the mandatory attribute: Primary6X Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertLessThanOrEqual([actualValue unsignedShortValue], 65279);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_CC_2_1_000113_WriteAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Write the default mandatory attribute: Primary6X"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
id primary6XArgument;
primary6XArgument = [NSNumber numberWithUnsignedShort:0U];
[cluster writeAttributePrimary6XWithValue:primary6XArgument
completionHandler:^(NSError * _Nullable err) {
NSLog(@"Write the default mandatory attribute: Primary6X Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], EMBER_ZCL_STATUS_UNSUPPORTED_WRITE);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_CC_2_1_000114_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Read back the mandatory attribute: Primary6X"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributePrimary6XWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"Read back the mandatory attribute: Primary6X Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertEqual([actualValue unsignedShortValue], 0U);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_CC_2_1_000115_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Read the mandatory attribute: Primary6Y"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributePrimary6YWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"Read the mandatory attribute: Primary6Y Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertLessThanOrEqual([actualValue unsignedShortValue], 65279);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_CC_2_1_000116_WriteAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Write the default mandatory attribute: Primary6Y"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
id primary6YArgument;
primary6YArgument = [NSNumber numberWithUnsignedShort:0U];
[cluster writeAttributePrimary6YWithValue:primary6YArgument
completionHandler:^(NSError * _Nullable err) {
NSLog(@"Write the default mandatory attribute: Primary6Y Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], EMBER_ZCL_STATUS_UNSUPPORTED_WRITE);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_CC_2_1_000117_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Read back the mandatory attribute: Primary6Y"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributePrimary6YWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"Read back the mandatory attribute: Primary6Y Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertEqual([actualValue unsignedShortValue], 0U);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_CC_2_1_000118_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Read the mandatory attribute: Primary6Intensity"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributePrimary6IntensityWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"Read the mandatory attribute: Primary6Intensity Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_CC_2_1_000119_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Read the optional attribute: WhitePointX"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeWhitePointXWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"Read the optional attribute: WhitePointX Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertLessThanOrEqual([actualValue unsignedShortValue], 65279);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_CC_2_1_000120_WriteAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Write the default optional attribute: WhitePointX"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
id whitePointXArgument;
whitePointXArgument = [NSNumber numberWithUnsignedShort:0U];
[cluster writeAttributeWhitePointXWithValue:whitePointXArgument
completionHandler:^(NSError * _Nullable err) {
NSLog(@"Write the default optional attribute: WhitePointX Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_CC_2_1_000121_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Read back the optional attribute: WhitePointX"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeWhitePointXWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"Read back the optional attribute: WhitePointX Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertEqual([actualValue unsignedShortValue], 0U);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_CC_2_1_000122_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Read the optional attribute: WhitePointY"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeWhitePointYWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"Read the optional attribute: WhitePointY Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertLessThanOrEqual([actualValue unsignedShortValue], 65279);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_CC_2_1_000123_WriteAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Write the default optional attribute: WhitePointY"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
id whitePointYArgument;
whitePointYArgument = [NSNumber numberWithUnsignedShort:0U];
[cluster writeAttributeWhitePointYWithValue:whitePointYArgument
completionHandler:^(NSError * _Nullable err) {
NSLog(@"Write the default optional attribute: WhitePointY Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_CC_2_1_000124_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Read back the optional attribute: WhitePointY"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeWhitePointYWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"Read back the optional attribute: WhitePointY Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertEqual([actualValue unsignedShortValue], 0U);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_CC_2_1_000125_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Read the optional attribute: ColorPointRX"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeColorPointRXWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"Read the optional attribute: ColorPointRX Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertLessThanOrEqual([actualValue unsignedShortValue], 65279);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_CC_2_1_000126_WriteAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Write the default optional attribute: ColorPointRX"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
id colorPointRXArgument;
colorPointRXArgument = [NSNumber numberWithUnsignedShort:0U];
[cluster writeAttributeColorPointRXWithValue:colorPointRXArgument
completionHandler:^(NSError * _Nullable err) {
NSLog(@"Write the default optional attribute: ColorPointRX Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_CC_2_1_000127_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Read back the optional attribute: ColorPointRX"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeColorPointRXWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"Read back the optional attribute: ColorPointRX Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertEqual([actualValue unsignedShortValue], 0U);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_CC_2_1_000128_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Read the optional attribute: ColorPointRY"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeColorPointRYWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"Read the optional attribute: ColorPointRY Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertLessThanOrEqual([actualValue unsignedShortValue], 65279);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_CC_2_1_000129_WriteAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Write the default optional attribute: ColorPointRY"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
id colorPointRYArgument;
colorPointRYArgument = [NSNumber numberWithUnsignedShort:0U];
[cluster writeAttributeColorPointRYWithValue:colorPointRYArgument
completionHandler:^(NSError * _Nullable err) {
NSLog(@"Write the default optional attribute: ColorPointRY Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_CC_2_1_000130_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Read back the optional attribute: ColorPointRY"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeColorPointRYWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"Read back the optional attribute: ColorPointRY Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertEqual([actualValue unsignedShortValue], 0U);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_CC_2_1_000131_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Read the optional attribute: ColorPointRIntensity"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeColorPointRIntensityWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"Read the optional attribute: ColorPointRIntensity Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_CC_2_1_000132_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Read the optional attribute: ColorPointGX"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeColorPointGXWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"Read the optional attribute: ColorPointGX Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertLessThanOrEqual([actualValue unsignedShortValue], 65279);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_CC_2_1_000133_WriteAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Write the default optional attribute: ColorPointGX"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
id colorPointGXArgument;
colorPointGXArgument = [NSNumber numberWithUnsignedShort:0U];
[cluster writeAttributeColorPointGXWithValue:colorPointGXArgument
completionHandler:^(NSError * _Nullable err) {
NSLog(@"Write the default optional attribute: ColorPointGX Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_CC_2_1_000134_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Read back the optional attribute: ColorPointGX"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeColorPointGXWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"Read back the optional attribute: ColorPointGX Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertEqual([actualValue unsignedShortValue], 0U);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_CC_2_1_000135_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Read the optional attribute: ColorPointGY"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeColorPointGYWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"Read the optional attribute: ColorPointGY Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertLessThanOrEqual([actualValue unsignedShortValue], 65279);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_CC_2_1_000136_WriteAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Write the default optional attribute: ColorPointGY"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
id colorPointGYArgument;
colorPointGYArgument = [NSNumber numberWithUnsignedShort:0U];
[cluster writeAttributeColorPointGYWithValue:colorPointGYArgument
completionHandler:^(NSError * _Nullable err) {
NSLog(@"Write the default optional attribute: ColorPointGY Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_CC_2_1_000137_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Read back the optional attribute: ColorPointGY"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeColorPointGYWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"Read back the optional attribute: ColorPointGY Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertEqual([actualValue unsignedShortValue], 0U);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_CC_2_1_000138_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Read the optional attribute: ColorPointGIntensity"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeColorPointGIntensityWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"Read the optional attribute: ColorPointGIntensity Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_CC_2_1_000139_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Read the optional attribute: ColorPointBX"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeColorPointBXWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"Read the optional attribute: ColorPointBX Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertLessThanOrEqual([actualValue unsignedShortValue], 65279);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_CC_2_1_000140_WriteAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Write the default optional attribute: ColorPointBX"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
id colorPointBXArgument;
colorPointBXArgument = [NSNumber numberWithUnsignedShort:0U];
[cluster writeAttributeColorPointBXWithValue:colorPointBXArgument
completionHandler:^(NSError * _Nullable err) {
NSLog(@"Write the default optional attribute: ColorPointBX Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_CC_2_1_000141_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Read back the optional attribute: ColorPointBX"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeColorPointBXWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"Read back the optional attribute: ColorPointBX Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertEqual([actualValue unsignedShortValue], 0U);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_CC_2_1_000142_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Read the optional attribute: ColorPointBY"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeColorPointBYWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"Read the optional attribute: ColorPointBY Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertLessThanOrEqual([actualValue unsignedShortValue], 65279);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_CC_2_1_000143_WriteAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Write the default optional attribute: ColorPointBY"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
id colorPointBYArgument;
colorPointBYArgument = [NSNumber numberWithUnsignedShort:0U];
[cluster writeAttributeColorPointBYWithValue:colorPointBYArgument
completionHandler:^(NSError * _Nullable err) {
NSLog(@"Write the default optional attribute: ColorPointBY Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_CC_2_1_000144_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Read back the optional attribute: ColorPointBY"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeColorPointBYWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"Read back the optional attribute: ColorPointBY Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertEqual([actualValue unsignedShortValue], 0U);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_CC_2_1_000145_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Read the optional attribute: ColorPointBIntensity"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeColorPointBIntensityWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"Read the optional attribute: ColorPointBIntensity Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_CC_3_1_000000_WaitForCommissionee
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"];
dispatch_queue_t queue = dispatch_get_main_queue();
WaitForCommissionee(expectation, queue);
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_CC_3_1_000001_On
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Turn on light for color control tests"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster onWithCompletionHandler:^(NSError * _Nullable err) {
NSLog(@"Turn on light for color control tests Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_CC_3_1_000002_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Check on/off attribute value is true after on command"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeOnOffWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"Check on/off attribute value is true after on command Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertEqual([actualValue boolValue], 1);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_CC_3_1_000003_MoveToHue
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Move to hue shortest distance command"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
__auto_type * params = [[CHIPColorControlClusterMoveToHueParams alloc] init];
params.hue = [NSNumber numberWithUnsignedChar:150];
params.direction = [NSNumber numberWithUnsignedChar:0];
params.transitionTime = [NSNumber numberWithUnsignedShort:100U];
params.optionsMask = [NSNumber numberWithUnsignedChar:0];
params.optionsOverride = [NSNumber numberWithUnsignedChar:0];
[cluster moveToHueWithParams:params
completionHandler:^(NSError * _Nullable err) {
NSLog(@"Move to hue shortest distance command Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_CC_3_1_000004_MoveToHue
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Move to hue longest distance command"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
__auto_type * params = [[CHIPColorControlClusterMoveToHueParams alloc] init];
params.hue = [NSNumber numberWithUnsignedChar:200];
params.direction = [NSNumber numberWithUnsignedChar:1];
params.transitionTime = [NSNumber numberWithUnsignedShort:100U];
params.optionsMask = [NSNumber numberWithUnsignedChar:0];
params.optionsOverride = [NSNumber numberWithUnsignedChar:0];
[cluster moveToHueWithParams:params
completionHandler:^(NSError * _Nullable err) {
NSLog(@"Move to hue longest distance command Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_CC_3_1_000005_MoveToHue
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Move to hue up command"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
__auto_type * params = [[CHIPColorControlClusterMoveToHueParams alloc] init];
params.hue = [NSNumber numberWithUnsignedChar:250];
params.direction = [NSNumber numberWithUnsignedChar:2];
params.transitionTime = [NSNumber numberWithUnsignedShort:100U];
params.optionsMask = [NSNumber numberWithUnsignedChar:0];
params.optionsOverride = [NSNumber numberWithUnsignedChar:0];
[cluster moveToHueWithParams:params
completionHandler:^(NSError * _Nullable err) {
NSLog(@"Move to hue up command Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_CC_3_1_000006_MoveToHue
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Move to hue down command"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
__auto_type * params = [[CHIPColorControlClusterMoveToHueParams alloc] init];
params.hue = [NSNumber numberWithUnsignedChar:225];
params.direction = [NSNumber numberWithUnsignedChar:3];
params.transitionTime = [NSNumber numberWithUnsignedShort:100U];
params.optionsMask = [NSNumber numberWithUnsignedChar:0];
params.optionsOverride = [NSNumber numberWithUnsignedChar:0];
[cluster moveToHueWithParams:params
completionHandler:^(NSError * _Nullable err) {
NSLog(@"Move to hue down command Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_CC_3_1_000007_Off
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Turn off light that we turned on"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster offWithCompletionHandler:^(NSError * _Nullable err) {
NSLog(@"Turn off light that we turned on Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_CC_3_1_000008_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Check on/off attribute value is false after off command"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeOnOffWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"Check on/off attribute value is false after off command Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertEqual([actualValue boolValue], 0);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_CC_3_2_000000_WaitForCommissionee
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"];
dispatch_queue_t queue = dispatch_get_main_queue();
WaitForCommissionee(expectation, queue);
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_CC_3_2_000001_On
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Turn on light for color control tests"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster onWithCompletionHandler:^(NSError * _Nullable err) {
NSLog(@"Turn on light for color control tests Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_CC_3_2_000002_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Check on/off attribute value is true after on command"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeOnOffWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"Check on/off attribute value is true after on command Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertEqual([actualValue boolValue], 1);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_CC_3_2_000003_MoveHue
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Move hue up command"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
__auto_type * params = [[CHIPColorControlClusterMoveHueParams alloc] init];
params.moveMode = [NSNumber numberWithUnsignedChar:1];
params.rate = [NSNumber numberWithUnsignedChar:50];
params.optionsMask = [NSNumber numberWithUnsignedChar:0];
params.optionsOverride = [NSNumber numberWithUnsignedChar:0];
[cluster moveHueWithParams:params
completionHandler:^(NSError * _Nullable err) {
NSLog(@"Move hue up command Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_CC_3_2_000004_MoveHue
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Move hue stop command"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
__auto_type * params = [[CHIPColorControlClusterMoveHueParams alloc] init];
params.moveMode = [NSNumber numberWithUnsignedChar:0];
params.rate = [NSNumber numberWithUnsignedChar:50];
params.optionsMask = [NSNumber numberWithUnsignedChar:0];
params.optionsOverride = [NSNumber numberWithUnsignedChar:0];
[cluster moveHueWithParams:params
completionHandler:^(NSError * _Nullable err) {
NSLog(@"Move hue stop command Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_CC_3_2_000005_MoveHue
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Move hue down command"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
__auto_type * params = [[CHIPColorControlClusterMoveHueParams alloc] init];
params.moveMode = [NSNumber numberWithUnsignedChar:3];
params.rate = [NSNumber numberWithUnsignedChar:50];
params.optionsMask = [NSNumber numberWithUnsignedChar:0];
params.optionsOverride = [NSNumber numberWithUnsignedChar:0];
[cluster moveHueWithParams:params
completionHandler:^(NSError * _Nullable err) {
NSLog(@"Move hue down command Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_CC_3_2_000006_MoveHue
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Move hue stop command"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
__auto_type * params = [[CHIPColorControlClusterMoveHueParams alloc] init];
params.moveMode = [NSNumber numberWithUnsignedChar:0];
params.rate = [NSNumber numberWithUnsignedChar:50];
params.optionsMask = [NSNumber numberWithUnsignedChar:0];
params.optionsOverride = [NSNumber numberWithUnsignedChar:0];
[cluster moveHueWithParams:params
completionHandler:^(NSError * _Nullable err) {
NSLog(@"Move hue stop command Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_CC_3_2_000007_Off
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Turn off light that we turned on"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster offWithCompletionHandler:^(NSError * _Nullable err) {
NSLog(@"Turn off light that we turned on Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_CC_3_2_000008_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Check on/off attribute value is false after off command"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeOnOffWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"Check on/off attribute value is false after off command Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertEqual([actualValue boolValue], 0);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_CC_3_3_000000_WaitForCommissionee
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"];
dispatch_queue_t queue = dispatch_get_main_queue();
WaitForCommissionee(expectation, queue);
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_CC_3_3_000001_On
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Turn on light for color control tests"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster onWithCompletionHandler:^(NSError * _Nullable err) {
NSLog(@"Turn on light for color control tests Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_CC_3_3_000002_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Check on/off attribute value is true after on command"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeOnOffWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"Check on/off attribute value is true after on command Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertEqual([actualValue boolValue], 1);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_CC_3_3_000003_StepHue
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Step hue up command"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
__auto_type * params = [[CHIPColorControlClusterStepHueParams alloc] init];
params.stepMode = [NSNumber numberWithUnsignedChar:1];
params.stepSize = [NSNumber numberWithUnsignedChar:5];
params.transitionTime = [NSNumber numberWithUnsignedChar:25];
params.optionsMask = [NSNumber numberWithUnsignedChar:0];
params.optionsOverride = [NSNumber numberWithUnsignedChar:0];
[cluster stepHueWithParams:params
completionHandler:^(NSError * _Nullable err) {
NSLog(@"Step hue up command Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_CC_3_3_000004_StepHue
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Step hue down command"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
__auto_type * params = [[CHIPColorControlClusterStepHueParams alloc] init];
params.stepMode = [NSNumber numberWithUnsignedChar:3];
params.stepSize = [NSNumber numberWithUnsignedChar:5];
params.transitionTime = [NSNumber numberWithUnsignedChar:25];
params.optionsMask = [NSNumber numberWithUnsignedChar:0];
params.optionsOverride = [NSNumber numberWithUnsignedChar:0];
[cluster stepHueWithParams:params
completionHandler:^(NSError * _Nullable err) {
NSLog(@"Step hue down command Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_CC_3_3_000005_Off
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Turn off light that we turned on"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster offWithCompletionHandler:^(NSError * _Nullable err) {
NSLog(@"Turn off light that we turned on Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_CC_3_3_000006_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Check on/off attribute value is false after off command"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeOnOffWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"Check on/off attribute value is false after off command Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertEqual([actualValue boolValue], 0);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_CC_4_1_000000_WaitForCommissionee
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"];
dispatch_queue_t queue = dispatch_get_main_queue();
WaitForCommissionee(expectation, queue);
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_CC_4_1_000001_On
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Turn on light for color control tests"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster onWithCompletionHandler:^(NSError * _Nullable err) {
NSLog(@"Turn on light for color control tests Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_CC_4_1_000002_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Check on/off attribute value is true after on command"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeOnOffWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"Check on/off attribute value is true after on command Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertEqual([actualValue boolValue], 1);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_CC_4_1_000003_MoveToSaturation
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Move to saturation command"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
__auto_type * params = [[CHIPColorControlClusterMoveToSaturationParams alloc] init];
params.saturation = [NSNumber numberWithUnsignedChar:90];
params.transitionTime = [NSNumber numberWithUnsignedShort:10U];
params.optionsMask = [NSNumber numberWithUnsignedChar:0];
params.optionsOverride = [NSNumber numberWithUnsignedChar:0];
[cluster moveToSaturationWithParams:params
completionHandler:^(NSError * _Nullable err) {
NSLog(@"Move to saturation command Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_CC_4_1_000004_Off
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Turn off light that we turned on"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster offWithCompletionHandler:^(NSError * _Nullable err) {
NSLog(@"Turn off light that we turned on Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_CC_4_1_000005_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Check on/off attribute value is false after off command"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeOnOffWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"Check on/off attribute value is false after off command Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertEqual([actualValue boolValue], 0);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_CC_4_2_000000_WaitForCommissionee
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"];
dispatch_queue_t queue = dispatch_get_main_queue();
WaitForCommissionee(expectation, queue);
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_CC_4_2_000001_On
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Turn on light for color control tests"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster onWithCompletionHandler:^(NSError * _Nullable err) {
NSLog(@"Turn on light for color control tests Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_CC_4_2_000002_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Check on/off attribute value is true after on command"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeOnOffWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"Check on/off attribute value is true after on command Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertEqual([actualValue boolValue], 1);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_CC_4_2_000003_MoveSaturation
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Move saturation up command"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
__auto_type * params = [[CHIPColorControlClusterMoveSaturationParams alloc] init];
params.moveMode = [NSNumber numberWithUnsignedChar:1];
params.rate = [NSNumber numberWithUnsignedChar:5];
params.optionsMask = [NSNumber numberWithUnsignedChar:0];
params.optionsOverride = [NSNumber numberWithUnsignedChar:0];
[cluster moveSaturationWithParams:params
completionHandler:^(NSError * _Nullable err) {
NSLog(@"Move saturation up command Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_CC_4_2_000004_MoveSaturation
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Move saturation down command"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
__auto_type * params = [[CHIPColorControlClusterMoveSaturationParams alloc] init];
params.moveMode = [NSNumber numberWithUnsignedChar:3];
params.rate = [NSNumber numberWithUnsignedChar:5];
params.optionsMask = [NSNumber numberWithUnsignedChar:0];
params.optionsOverride = [NSNumber numberWithUnsignedChar:0];
[cluster moveSaturationWithParams:params
completionHandler:^(NSError * _Nullable err) {
NSLog(@"Move saturation down command Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_CC_4_2_000005_MoveSaturation
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Move saturation up command"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
__auto_type * params = [[CHIPColorControlClusterMoveSaturationParams alloc] init];
params.moveMode = [NSNumber numberWithUnsignedChar:1];
params.rate = [NSNumber numberWithUnsignedChar:5];
params.optionsMask = [NSNumber numberWithUnsignedChar:0];
params.optionsOverride = [NSNumber numberWithUnsignedChar:0];
[cluster moveSaturationWithParams:params
completionHandler:^(NSError * _Nullable err) {
NSLog(@"Move saturation up command Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_CC_4_2_000006_MoveSaturation
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Move saturation stop command"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
__auto_type * params = [[CHIPColorControlClusterMoveSaturationParams alloc] init];
params.moveMode = [NSNumber numberWithUnsignedChar:0];
params.rate = [NSNumber numberWithUnsignedChar:5];
params.optionsMask = [NSNumber numberWithUnsignedChar:0];
params.optionsOverride = [NSNumber numberWithUnsignedChar:0];
[cluster moveSaturationWithParams:params
completionHandler:^(NSError * _Nullable err) {
NSLog(@"Move saturation stop command Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_CC_4_2_000007_MoveSaturation
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Move saturation down command"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
__auto_type * params = [[CHIPColorControlClusterMoveSaturationParams alloc] init];
params.moveMode = [NSNumber numberWithUnsignedChar:3];
params.rate = [NSNumber numberWithUnsignedChar:5];
params.optionsMask = [NSNumber numberWithUnsignedChar:0];
params.optionsOverride = [NSNumber numberWithUnsignedChar:0];
[cluster moveSaturationWithParams:params
completionHandler:^(NSError * _Nullable err) {
NSLog(@"Move saturation down command Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_CC_4_2_000008_MoveSaturation
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Move saturation stop command"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
__auto_type * params = [[CHIPColorControlClusterMoveSaturationParams alloc] init];
params.moveMode = [NSNumber numberWithUnsignedChar:0];
params.rate = [NSNumber numberWithUnsignedChar:5];
params.optionsMask = [NSNumber numberWithUnsignedChar:0];
params.optionsOverride = [NSNumber numberWithUnsignedChar:0];
[cluster moveSaturationWithParams:params
completionHandler:^(NSError * _Nullable err) {
NSLog(@"Move saturation stop command Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_CC_4_2_000009_Off
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Turn off light that we turned on"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster offWithCompletionHandler:^(NSError * _Nullable err) {
NSLog(@"Turn off light that we turned on Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_CC_4_2_000010_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Check on/off attribute value is false after off command"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeOnOffWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"Check on/off attribute value is false after off command Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertEqual([actualValue boolValue], 0);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_CC_4_3_000000_WaitForCommissionee
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"];
dispatch_queue_t queue = dispatch_get_main_queue();
WaitForCommissionee(expectation, queue);
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_CC_4_3_000001_On
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Turn on light for color control tests"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster onWithCompletionHandler:^(NSError * _Nullable err) {
NSLog(@"Turn on light for color control tests Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_CC_4_3_000002_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Check on/off attribute value is true after on command"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeOnOffWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"Check on/off attribute value is true after on command Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertEqual([actualValue boolValue], 1);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_CC_4_3_000003_StepSaturation
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Step saturation up command"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
__auto_type * params = [[CHIPColorControlClusterStepSaturationParams alloc] init];
params.stepMode = [NSNumber numberWithUnsignedChar:1];
params.stepSize = [NSNumber numberWithUnsignedChar:15];
params.transitionTime = [NSNumber numberWithUnsignedChar:10];
params.optionsMask = [NSNumber numberWithUnsignedChar:0];
params.optionsOverride = [NSNumber numberWithUnsignedChar:0];
[cluster stepSaturationWithParams:params
completionHandler:^(NSError * _Nullable err) {
NSLog(@"Step saturation up command Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_CC_4_3_000004_StepSaturation
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Step saturation down command"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
__auto_type * params = [[CHIPColorControlClusterStepSaturationParams alloc] init];
params.stepMode = [NSNumber numberWithUnsignedChar:3];
params.stepSize = [NSNumber numberWithUnsignedChar:20];
params.transitionTime = [NSNumber numberWithUnsignedChar:10];
params.optionsMask = [NSNumber numberWithUnsignedChar:0];
params.optionsOverride = [NSNumber numberWithUnsignedChar:0];
[cluster stepSaturationWithParams:params
completionHandler:^(NSError * _Nullable err) {
NSLog(@"Step saturation down command Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_CC_4_3_000005_Off
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Turn off light that we turned on"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster offWithCompletionHandler:^(NSError * _Nullable err) {
NSLog(@"Turn off light that we turned on Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_CC_4_3_000006_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Check on/off attribute value is false after off command"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeOnOffWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"Check on/off attribute value is false after off command Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertEqual([actualValue boolValue], 0);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_CC_4_4_000000_WaitForCommissionee
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"];
dispatch_queue_t queue = dispatch_get_main_queue();
WaitForCommissionee(expectation, queue);
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_CC_4_4_000001_On
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Turn on light for color control tests"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster onWithCompletionHandler:^(NSError * _Nullable err) {
NSLog(@"Turn on light for color control tests Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_CC_4_4_000002_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Check on/off attribute value is true after on command"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeOnOffWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"Check on/off attribute value is true after on command Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertEqual([actualValue boolValue], 1);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_CC_4_4_000003_MoveToHueAndSaturation
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Move To current hue and saturation command"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
__auto_type * params = [[CHIPColorControlClusterMoveToHueAndSaturationParams alloc] init];
params.hue = [NSNumber numberWithUnsignedChar:40];
params.saturation = [NSNumber numberWithUnsignedChar:160];
params.transitionTime = [NSNumber numberWithUnsignedShort:10U];
params.optionsMask = [NSNumber numberWithUnsignedChar:0];
params.optionsOverride = [NSNumber numberWithUnsignedChar:0];
[cluster moveToHueAndSaturationWithParams:params
completionHandler:^(NSError * _Nullable err) {
NSLog(@"Move To current hue and saturation command Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_CC_4_4_000004_Off
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Turn off light that we turned on"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster offWithCompletionHandler:^(NSError * _Nullable err) {
NSLog(@"Turn off light that we turned on Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_CC_4_4_000005_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Check on/off attribute value is false after off command"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeOnOffWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"Check on/off attribute value is false after off command Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertEqual([actualValue boolValue], 0);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_CC_5_1_000000_WaitForCommissionee
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"];
dispatch_queue_t queue = dispatch_get_main_queue();
WaitForCommissionee(expectation, queue);
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_CC_5_1_000001_On
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Turn on light for color control tests"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster onWithCompletionHandler:^(NSError * _Nullable err) {
NSLog(@"Turn on light for color control tests Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_CC_5_1_000002_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Check on/off attribute value is true after on command"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeOnOffWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"Check on/off attribute value is true after on command Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertEqual([actualValue boolValue], 1);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_CC_5_1_000003_MoveToColor
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Move to Color command"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
__auto_type * params = [[CHIPColorControlClusterMoveToColorParams alloc] init];
params.colorX = [NSNumber numberWithUnsignedShort:200U];
params.colorY = [NSNumber numberWithUnsignedShort:300U];
params.transitionTime = [NSNumber numberWithUnsignedShort:20U];
params.optionsMask = [NSNumber numberWithUnsignedChar:0];
params.optionsOverride = [NSNumber numberWithUnsignedChar:0];
[cluster moveToColorWithParams:params
completionHandler:^(NSError * _Nullable err) {
NSLog(@"Move to Color command Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_CC_5_1_000004_Off
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Turn off light that we turned on"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster offWithCompletionHandler:^(NSError * _Nullable err) {
NSLog(@"Turn off light that we turned on Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_CC_5_1_000005_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Check on/off attribute value is false after off command"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeOnOffWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"Check on/off attribute value is false after off command Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertEqual([actualValue boolValue], 0);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_CC_5_2_000000_WaitForCommissionee
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"];
dispatch_queue_t queue = dispatch_get_main_queue();
WaitForCommissionee(expectation, queue);
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_CC_5_2_000001_On
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Turn on light for color control tests"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster onWithCompletionHandler:^(NSError * _Nullable err) {
NSLog(@"Turn on light for color control tests Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_CC_5_2_000002_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Check on/off attribute value is true after on command"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeOnOffWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"Check on/off attribute value is true after on command Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertEqual([actualValue boolValue], 1);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_CC_5_2_000003_MoveColor
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Move Color command"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
__auto_type * params = [[CHIPColorControlClusterMoveColorParams alloc] init];
params.rateX = [NSNumber numberWithShort:15];
params.rateY = [NSNumber numberWithShort:20];
params.optionsMask = [NSNumber numberWithUnsignedChar:0];
params.optionsOverride = [NSNumber numberWithUnsignedChar:0];
[cluster moveColorWithParams:params
completionHandler:^(NSError * _Nullable err) {
NSLog(@"Move Color command Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_CC_5_2_000004_StopMoveStep
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Stop Move Step command"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
__auto_type * params = [[CHIPColorControlClusterStopMoveStepParams alloc] init];
params.optionsMask = [NSNumber numberWithUnsignedChar:0];
params.optionsOverride = [NSNumber numberWithUnsignedChar:0];
[cluster stopMoveStepWithParams:params
completionHandler:^(NSError * _Nullable err) {
NSLog(@"Stop Move Step command Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_CC_5_2_000005_Off
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Turn off light that we turned on"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster offWithCompletionHandler:^(NSError * _Nullable err) {
NSLog(@"Turn off light that we turned on Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_CC_5_2_000006_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Check on/off attribute value is false after off command"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeOnOffWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"Check on/off attribute value is false after off command Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertEqual([actualValue boolValue], 0);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_CC_5_3_000000_WaitForCommissionee
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"];
dispatch_queue_t queue = dispatch_get_main_queue();
WaitForCommissionee(expectation, queue);
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_CC_5_3_000001_On
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Turn on light for color control tests"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster onWithCompletionHandler:^(NSError * _Nullable err) {
NSLog(@"Turn on light for color control tests Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_CC_5_3_000002_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Check on/off attribute value is true after on command"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeOnOffWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"Check on/off attribute value is true after on command Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertEqual([actualValue boolValue], 1);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_CC_5_3_000003_StepColor
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Step Color command"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
__auto_type * params = [[CHIPColorControlClusterStepColorParams alloc] init];
params.stepX = [NSNumber numberWithShort:15];
params.stepY = [NSNumber numberWithShort:20];
params.transitionTime = [NSNumber numberWithUnsignedShort:50U];
params.optionsMask = [NSNumber numberWithUnsignedChar:0];
params.optionsOverride = [NSNumber numberWithUnsignedChar:0];
[cluster stepColorWithParams:params
completionHandler:^(NSError * _Nullable err) {
NSLog(@"Step Color command Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_CC_5_3_000004_Off
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Turn off light that we turned on"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster offWithCompletionHandler:^(NSError * _Nullable err) {
NSLog(@"Turn off light that we turned on Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_CC_5_3_000005_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Check on/off attribute value is false after off command"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeOnOffWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"Check on/off attribute value is false after off command Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertEqual([actualValue boolValue], 0);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_CC_6_1_000000_WaitForCommissionee
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"];
dispatch_queue_t queue = dispatch_get_main_queue();
WaitForCommissionee(expectation, queue);
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_CC_6_1_000001_On
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Turn on light for color control tests"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster onWithCompletionHandler:^(NSError * _Nullable err) {
NSLog(@"Turn on light for color control tests Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_CC_6_1_000002_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Check on/off attribute value is true after on command"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeOnOffWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"Check on/off attribute value is true after on command Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertEqual([actualValue boolValue], 1);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_CC_6_1_000003_MoveToColorTemperature
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Move To Color Temperature command"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
__auto_type * params = [[CHIPColorControlClusterMoveToColorTemperatureParams alloc] init];
params.colorTemperature = [NSNumber numberWithUnsignedShort:100U];
params.transitionTime = [NSNumber numberWithUnsignedShort:10U];
params.optionsMask = [NSNumber numberWithUnsignedChar:0];
params.optionsOverride = [NSNumber numberWithUnsignedChar:0];
[cluster moveToColorTemperatureWithParams:params
completionHandler:^(NSError * _Nullable err) {
NSLog(@"Move To Color Temperature command Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_CC_6_1_000004_Off
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Turn off light that we turned on"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster offWithCompletionHandler:^(NSError * _Nullable err) {
NSLog(@"Turn off light that we turned on Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_CC_6_1_000005_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Check on/off attribute value is false after off command"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeOnOffWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"Check on/off attribute value is false after off command Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertEqual([actualValue boolValue], 0);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_CC_6_2_000000_WaitForCommissionee
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"];
dispatch_queue_t queue = dispatch_get_main_queue();
WaitForCommissionee(expectation, queue);
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_CC_6_2_000001_On
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Turn on light for color control tests"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster onWithCompletionHandler:^(NSError * _Nullable err) {
NSLog(@"Turn on light for color control tests Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_CC_6_2_000002_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Check on/off attribute value is true after on command"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeOnOffWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"Check on/off attribute value is true after on command Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertEqual([actualValue boolValue], 1);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_CC_6_2_000003_MoveColorTemperature
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Move up color temperature command"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
__auto_type * params = [[CHIPColorControlClusterMoveColorTemperatureParams alloc] init];
params.moveMode = [NSNumber numberWithUnsignedChar:1];
params.rate = [NSNumber numberWithUnsignedShort:10U];
params.colorTemperatureMinimum = [NSNumber numberWithUnsignedShort:1U];
params.colorTemperatureMaximum = [NSNumber numberWithUnsignedShort:255U];
params.optionsMask = [NSNumber numberWithUnsignedChar:0];
params.optionsOverride = [NSNumber numberWithUnsignedChar:0];
[cluster moveColorTemperatureWithParams:params
completionHandler:^(NSError * _Nullable err) {
NSLog(@"Move up color temperature command Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_CC_6_2_000004_MoveColorTemperature
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Stop Color Temperature command"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
__auto_type * params = [[CHIPColorControlClusterMoveColorTemperatureParams alloc] init];
params.moveMode = [NSNumber numberWithUnsignedChar:0];
params.rate = [NSNumber numberWithUnsignedShort:10U];
params.colorTemperatureMinimum = [NSNumber numberWithUnsignedShort:1U];
params.colorTemperatureMaximum = [NSNumber numberWithUnsignedShort:255U];
params.optionsMask = [NSNumber numberWithUnsignedChar:0];
params.optionsOverride = [NSNumber numberWithUnsignedChar:0];
[cluster moveColorTemperatureWithParams:params
completionHandler:^(NSError * _Nullable err) {
NSLog(@"Stop Color Temperature command Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_CC_6_2_000005_MoveColorTemperature
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Move down color temperature command"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
__auto_type * params = [[CHIPColorControlClusterMoveColorTemperatureParams alloc] init];
params.moveMode = [NSNumber numberWithUnsignedChar:3];
params.rate = [NSNumber numberWithUnsignedShort:20U];
params.colorTemperatureMinimum = [NSNumber numberWithUnsignedShort:1U];
params.colorTemperatureMaximum = [NSNumber numberWithUnsignedShort:255U];
params.optionsMask = [NSNumber numberWithUnsignedChar:0];
params.optionsOverride = [NSNumber numberWithUnsignedChar:0];
[cluster moveColorTemperatureWithParams:params
completionHandler:^(NSError * _Nullable err) {
NSLog(@"Move down color temperature command Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_CC_6_2_000006_Off
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Turn off light that we turned on"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster offWithCompletionHandler:^(NSError * _Nullable err) {
NSLog(@"Turn off light that we turned on Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_CC_6_2_000007_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Check on/off attribute value is false after off command"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeOnOffWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"Check on/off attribute value is false after off command Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertEqual([actualValue boolValue], 0);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_CC_6_3_000000_WaitForCommissionee
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"];
dispatch_queue_t queue = dispatch_get_main_queue();
WaitForCommissionee(expectation, queue);
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_CC_6_3_000001_On
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Turn on light for color control tests"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster onWithCompletionHandler:^(NSError * _Nullable err) {
NSLog(@"Turn on light for color control tests Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_CC_6_3_000002_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Check on/off attribute value is true after on command"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeOnOffWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"Check on/off attribute value is true after on command Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertEqual([actualValue boolValue], 1);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_CC_6_3_000003_StepColorTemperature
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Step up color temperature command"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
__auto_type * params = [[CHIPColorControlClusterStepColorTemperatureParams alloc] init];
params.stepMode = [NSNumber numberWithUnsignedChar:1];
params.stepSize = [NSNumber numberWithUnsignedShort:5U];
params.transitionTime = [NSNumber numberWithUnsignedShort:50U];
params.colorTemperatureMinimum = [NSNumber numberWithUnsignedShort:5U];
params.colorTemperatureMaximum = [NSNumber numberWithUnsignedShort:100U];
params.optionsMask = [NSNumber numberWithUnsignedChar:0];
params.optionsOverride = [NSNumber numberWithUnsignedChar:0];
[cluster stepColorTemperatureWithParams:params
completionHandler:^(NSError * _Nullable err) {
NSLog(@"Step up color temperature command Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_CC_6_3_000004_StepColorTemperature
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Step down color temperature command"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
__auto_type * params = [[CHIPColorControlClusterStepColorTemperatureParams alloc] init];
params.stepMode = [NSNumber numberWithUnsignedChar:3];
params.stepSize = [NSNumber numberWithUnsignedShort:5U];
params.transitionTime = [NSNumber numberWithUnsignedShort:50U];
params.colorTemperatureMinimum = [NSNumber numberWithUnsignedShort:5U];
params.colorTemperatureMaximum = [NSNumber numberWithUnsignedShort:100U];
params.optionsMask = [NSNumber numberWithUnsignedChar:0];
params.optionsOverride = [NSNumber numberWithUnsignedChar:0];
[cluster stepColorTemperatureWithParams:params
completionHandler:^(NSError * _Nullable err) {
NSLog(@"Step down color temperature command Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_CC_6_3_000005_Off
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Turn off light that we turned on"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster offWithCompletionHandler:^(NSError * _Nullable err) {
NSLog(@"Turn off light that we turned on Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_CC_6_3_000006_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Check on/off attribute value is false after off command"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeOnOffWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"Check on/off attribute value is false after off command Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertEqual([actualValue boolValue], 0);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_CC_7_1_000000_WaitForCommissionee
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"];
dispatch_queue_t queue = dispatch_get_main_queue();
WaitForCommissionee(expectation, queue);
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_CC_7_1_000001_On
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Turn on light for color control tests"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster onWithCompletionHandler:^(NSError * _Nullable err) {
NSLog(@"Turn on light for color control tests Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_CC_7_1_000002_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Check on/off attribute value is true after on command"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeOnOffWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"Check on/off attribute value is true after on command Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertEqual([actualValue boolValue], 1);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_CC_7_1_000003_EnhancedMoveToHue
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Enhanced Move To Hue command"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
__auto_type * params = [[CHIPColorControlClusterEnhancedMoveToHueParams alloc] init];
params.enhancedHue = [NSNumber numberWithUnsignedShort:1025U];
params.direction = [NSNumber numberWithUnsignedChar:0];
params.transitionTime = [NSNumber numberWithUnsignedShort:1U];
params.optionsMask = [NSNumber numberWithUnsignedChar:0];
params.optionsOverride = [NSNumber numberWithUnsignedChar:0];
[cluster enhancedMoveToHueWithParams:params
completionHandler:^(NSError * _Nullable err) {
NSLog(@"Enhanced Move To Hue command Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_CC_7_1_000004_ReadAttribute
{
XCTestExpectation * expectation =
[self expectationWithDescription:@"Check Remaining time attribute value matched the value sent by the last command"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeRemainingTimeWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"Check Remaining time attribute value matched the value sent by the last command Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertEqual([actualValue unsignedShortValue], 1U);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_CC_7_1_000005_Off
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Turn off light that we turned on"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster offWithCompletionHandler:^(NSError * _Nullable err) {
NSLog(@"Turn off light that we turned on Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_CC_7_1_000006_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Check on/off attribute value is false after off command"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeOnOffWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"Check on/off attribute value is false after off command Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertEqual([actualValue boolValue], 0);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_CC_7_2_000000_WaitForCommissionee
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"];
dispatch_queue_t queue = dispatch_get_main_queue();
WaitForCommissionee(expectation, queue);
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_CC_7_2_000001_On
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Turn on light for color control tests"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster onWithCompletionHandler:^(NSError * _Nullable err) {
NSLog(@"Turn on light for color control tests Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_CC_7_2_000002_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Check on/off attribute value is true after on command"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeOnOffWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"Check on/off attribute value is true after on command Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertEqual([actualValue boolValue], 1);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_CC_7_2_000003_EnhancedMoveHue
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Enhanced Move Hue Down command "];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
__auto_type * params = [[CHIPColorControlClusterEnhancedMoveHueParams alloc] init];
params.moveMode = [NSNumber numberWithUnsignedChar:3];
params.rate = [NSNumber numberWithUnsignedShort:5U];
params.optionsMask = [NSNumber numberWithUnsignedChar:0];
params.optionsOverride = [NSNumber numberWithUnsignedChar:0];
[cluster enhancedMoveHueWithParams:params
completionHandler:^(NSError * _Nullable err) {
NSLog(@"Enhanced Move Hue Down command Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_CC_7_2_000004_EnhancedMoveHue
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Enhanced Move Hue Stop command"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
__auto_type * params = [[CHIPColorControlClusterEnhancedMoveHueParams alloc] init];
params.moveMode = [NSNumber numberWithUnsignedChar:0];
params.rate = [NSNumber numberWithUnsignedShort:0U];
params.optionsMask = [NSNumber numberWithUnsignedChar:0];
params.optionsOverride = [NSNumber numberWithUnsignedChar:0];
[cluster enhancedMoveHueWithParams:params
completionHandler:^(NSError * _Nullable err) {
NSLog(@"Enhanced Move Hue Stop command Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_CC_7_2_000005_EnhancedMoveHue
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Enhanced Move Hue Up command"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
__auto_type * params = [[CHIPColorControlClusterEnhancedMoveHueParams alloc] init];
params.moveMode = [NSNumber numberWithUnsignedChar:1];
params.rate = [NSNumber numberWithUnsignedShort:50U];
params.optionsMask = [NSNumber numberWithUnsignedChar:0];
params.optionsOverride = [NSNumber numberWithUnsignedChar:0];
[cluster enhancedMoveHueWithParams:params
completionHandler:^(NSError * _Nullable err) {
NSLog(@"Enhanced Move Hue Up command Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_CC_7_2_000006_EnhancedMoveHue
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Enhanced Move Hue Stop command"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
__auto_type * params = [[CHIPColorControlClusterEnhancedMoveHueParams alloc] init];
params.moveMode = [NSNumber numberWithUnsignedChar:0];
params.rate = [NSNumber numberWithUnsignedShort:0U];
params.optionsMask = [NSNumber numberWithUnsignedChar:0];
params.optionsOverride = [NSNumber numberWithUnsignedChar:0];
[cluster enhancedMoveHueWithParams:params
completionHandler:^(NSError * _Nullable err) {
NSLog(@"Enhanced Move Hue Stop command Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_CC_7_2_000007_Off
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Turn off light that we turned on"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster offWithCompletionHandler:^(NSError * _Nullable err) {
NSLog(@"Turn off light that we turned on Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_CC_7_2_000008_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Check on/off attribute value is false after off command"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeOnOffWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"Check on/off attribute value is false after off command Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertEqual([actualValue boolValue], 0);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_CC_7_3_000000_WaitForCommissionee
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"];
dispatch_queue_t queue = dispatch_get_main_queue();
WaitForCommissionee(expectation, queue);
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_CC_7_3_000001_On
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Turn on light for color control tests"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster onWithCompletionHandler:^(NSError * _Nullable err) {
NSLog(@"Turn on light for color control tests Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_CC_7_3_000002_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Check on/off attribute value is true after on command"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeOnOffWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"Check on/off attribute value is true after on command Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertEqual([actualValue boolValue], 1);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_CC_7_3_000003_EnhancedStepHue
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Enhanced Step Hue Up command"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
__auto_type * params = [[CHIPColorControlClusterEnhancedStepHueParams alloc] init];
params.stepMode = [NSNumber numberWithUnsignedChar:0];
params.stepSize = [NSNumber numberWithUnsignedShort:50U];
params.transitionTime = [NSNumber numberWithUnsignedShort:1U];
params.optionsMask = [NSNumber numberWithUnsignedChar:0];
params.optionsOverride = [NSNumber numberWithUnsignedChar:0];
[cluster enhancedStepHueWithParams:params
completionHandler:^(NSError * _Nullable err) {
NSLog(@"Enhanced Step Hue Up command Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_CC_7_3_000004_EnhancedStepHue
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Enhanced Step Hue Down command"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
__auto_type * params = [[CHIPColorControlClusterEnhancedStepHueParams alloc] init];
params.stepMode = [NSNumber numberWithUnsignedChar:1];
params.stepSize = [NSNumber numberWithUnsignedShort:75U];
params.transitionTime = [NSNumber numberWithUnsignedShort:1U];
params.optionsMask = [NSNumber numberWithUnsignedChar:0];
params.optionsOverride = [NSNumber numberWithUnsignedChar:0];
[cluster enhancedStepHueWithParams:params
completionHandler:^(NSError * _Nullable err) {
NSLog(@"Enhanced Step Hue Down command Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_CC_7_3_000005_Off
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Turn off light that we turned on"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster offWithCompletionHandler:^(NSError * _Nullable err) {
NSLog(@"Turn off light that we turned on Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_CC_7_3_000006_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Check on/off attribute value is false after off command"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeOnOffWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"Check on/off attribute value is false after off command Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertEqual([actualValue boolValue], 0);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_CC_7_4_000000_WaitForCommissionee
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"];
dispatch_queue_t queue = dispatch_get_main_queue();
WaitForCommissionee(expectation, queue);
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_CC_7_4_000001_On
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Turn on light for color control tests"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster onWithCompletionHandler:^(NSError * _Nullable err) {
NSLog(@"Turn on light for color control tests Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_CC_7_4_000002_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Check on/off attribute value is true after on command"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeOnOffWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"Check on/off attribute value is true after on command Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertEqual([actualValue boolValue], 1);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_CC_7_4_000003_EnhancedMoveToHueAndSaturation
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Enhanced move to hue and saturation command"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
__auto_type * params = [[CHIPColorControlClusterEnhancedMoveToHueAndSaturationParams alloc] init];
params.enhancedHue = [NSNumber numberWithUnsignedShort:1200U];
params.saturation = [NSNumber numberWithUnsignedChar:90];
params.transitionTime = [NSNumber numberWithUnsignedShort:10U];
params.optionsMask = [NSNumber numberWithUnsignedChar:0];
params.optionsOverride = [NSNumber numberWithUnsignedChar:0];
[cluster enhancedMoveToHueAndSaturationWithParams:params
completionHandler:^(NSError * _Nullable err) {
NSLog(@"Enhanced move to hue and saturation command Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_CC_7_4_000004_Off
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Turn off light that we turned on"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster offWithCompletionHandler:^(NSError * _Nullable err) {
NSLog(@"Turn off light that we turned on Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_CC_7_4_000005_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Check on/off attribute value is false after off command"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeOnOffWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"Check on/off attribute value is false after off command Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertEqual([actualValue boolValue], 0);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_CC_8_1_000000_WaitForCommissionee
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"];
dispatch_queue_t queue = dispatch_get_main_queue();
WaitForCommissionee(expectation, queue);
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_CC_8_1_000001_On
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Turn on light for color control tests"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster onWithCompletionHandler:^(NSError * _Nullable err) {
NSLog(@"Turn on light for color control tests Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_CC_8_1_000002_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Check on/off attribute value is true after on command"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeOnOffWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"Check on/off attribute value is true after on command Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertEqual([actualValue boolValue], 1);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_CC_8_1_000003_ColorLoopSet
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Color Loop Set Command - Set all Attributs"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
__auto_type * params = [[CHIPColorControlClusterColorLoopSetParams alloc] init];
params.updateFlags = [NSNumber numberWithUnsignedChar:14];
params.action = [NSNumber numberWithUnsignedChar:0];
params.direction = [NSNumber numberWithUnsignedChar:1];
params.time = [NSNumber numberWithUnsignedShort:100U];
params.startHue = [NSNumber numberWithUnsignedShort:500U];
params.optionsMask = [NSNumber numberWithUnsignedChar:0];
params.optionsOverride = [NSNumber numberWithUnsignedChar:0];
[cluster colorLoopSetWithParams:params
completionHandler:^(NSError * _Nullable err) {
NSLog(@"Color Loop Set Command - Set all Attributs Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_CC_8_1_000004_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Check ColorLoopDirection Value"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeColorLoopDirectionWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"Check ColorLoopDirection Value Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertEqual([actualValue unsignedCharValue], 1);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_CC_8_1_000005_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Check ColorLoopTime Value"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeColorLoopTimeWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"Check ColorLoopTime Value Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertEqual([actualValue unsignedShortValue], 100U);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_CC_8_1_000006_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Check ColorLoopStartEnhancedHue Value"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeColorLoopStartEnhancedHueWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"Check ColorLoopStartEnhancedHue Value Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertEqual([actualValue unsignedShortValue], 500U);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_CC_8_1_000007_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Check ColorLoopActive Value"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeColorLoopActiveWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"Check ColorLoopActive Value Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertEqual([actualValue unsignedCharValue], 0);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_CC_8_1_000008_ColorLoopSet
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Color Loop Set Command - Start Color Loop"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
__auto_type * params = [[CHIPColorControlClusterColorLoopSetParams alloc] init];
params.updateFlags = [NSNumber numberWithUnsignedChar:1];
params.action = [NSNumber numberWithUnsignedChar:1];
params.direction = [NSNumber numberWithUnsignedChar:0];
params.time = [NSNumber numberWithUnsignedShort:0U];
params.startHue = [NSNumber numberWithUnsignedShort:0U];
params.optionsMask = [NSNumber numberWithUnsignedChar:0];
params.optionsOverride = [NSNumber numberWithUnsignedChar:0];
[cluster colorLoopSetWithParams:params
completionHandler:^(NSError * _Nullable err) {
NSLog(@"Color Loop Set Command - Start Color Loop Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_CC_8_1_000009_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Check ColorLoopActive Value"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeColorLoopActiveWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"Check ColorLoopActive Value Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertEqual([actualValue unsignedCharValue], 1);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_CC_8_1_000010_ColorLoopSet
{
XCTestExpectation * expectation =
[self expectationWithDescription:@"Color Loop Set Command - Set direction and time while running"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
__auto_type * params = [[CHIPColorControlClusterColorLoopSetParams alloc] init];
params.updateFlags = [NSNumber numberWithUnsignedChar:6];
params.action = [NSNumber numberWithUnsignedChar:0];
params.direction = [NSNumber numberWithUnsignedChar:0];
params.time = [NSNumber numberWithUnsignedShort:3500U];
params.startHue = [NSNumber numberWithUnsignedShort:0U];
params.optionsMask = [NSNumber numberWithUnsignedChar:0];
params.optionsOverride = [NSNumber numberWithUnsignedChar:0];
[cluster colorLoopSetWithParams:params
completionHandler:^(NSError * _Nullable err) {
NSLog(@"Color Loop Set Command - Set direction and time while running Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_CC_8_1_000011_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Check ColorLoopDirection Value"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeColorLoopDirectionWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"Check ColorLoopDirection Value Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertEqual([actualValue unsignedCharValue], 0);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_CC_8_1_000012_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Check ColorLoopTime Value"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeColorLoopTimeWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"Check ColorLoopTime Value Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertEqual([actualValue unsignedShortValue], 3500U);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_CC_8_1_000013_ColorLoopSet
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Color Loop Set Command - Set direction while running"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
__auto_type * params = [[CHIPColorControlClusterColorLoopSetParams alloc] init];
params.updateFlags = [NSNumber numberWithUnsignedChar:2];
params.action = [NSNumber numberWithUnsignedChar:0];
params.direction = [NSNumber numberWithUnsignedChar:1];
params.time = [NSNumber numberWithUnsignedShort:0U];
params.startHue = [NSNumber numberWithUnsignedShort:0U];
params.optionsMask = [NSNumber numberWithUnsignedChar:0];
params.optionsOverride = [NSNumber numberWithUnsignedChar:0];
[cluster colorLoopSetWithParams:params
completionHandler:^(NSError * _Nullable err) {
NSLog(@"Color Loop Set Command - Set direction while running Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_CC_8_1_000014_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Check ColorLoopDirection Value"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeColorLoopDirectionWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"Check ColorLoopDirection Value Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertEqual([actualValue unsignedCharValue], 1);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_CC_8_1_000015_Off
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Turn off light that we turned on"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster offWithCompletionHandler:^(NSError * _Nullable err) {
NSLog(@"Turn off light that we turned on Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_CC_8_1_000016_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Check on/off attribute value is false after off command"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeOnOffWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"Check on/off attribute value is false after off command Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertEqual([actualValue boolValue], 0);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_CC_9_1_000000_WaitForCommissionee
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"];
dispatch_queue_t queue = dispatch_get_main_queue();
WaitForCommissionee(expectation, queue);
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_CC_9_1_000001_On
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Precondition : Turn on light for color control tests"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster onWithCompletionHandler:^(NSError * _Nullable err) {
NSLog(@"Precondition : Turn on light for color control tests Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_CC_9_1_000002_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Check on/off attribute value is true after on command"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeOnOffWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"Check on/off attribute value is true after on command Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertEqual([actualValue boolValue], 1);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_CC_9_1_000003_ColorLoopSet
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Sends ColorLoopSet Command - Set all Attributes"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
__auto_type * params = [[CHIPColorControlClusterColorLoopSetParams alloc] init];
params.updateFlags = [NSNumber numberWithUnsignedChar:1];
params.action = [NSNumber numberWithUnsignedChar:0];
params.direction = [NSNumber numberWithUnsignedChar:0];
params.time = [NSNumber numberWithUnsignedShort:0U];
params.startHue = [NSNumber numberWithUnsignedShort:0U];
params.optionsMask = [NSNumber numberWithUnsignedChar:0];
params.optionsOverride = [NSNumber numberWithUnsignedChar:0];
[cluster colorLoopSetWithParams:params
completionHandler:^(NSError * _Nullable err) {
NSLog(@"Sends ColorLoopSet Command - Set all Attributes Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_CC_9_1_000004_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Read ColorLoopActive attribute from DUT"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeColorLoopActiveWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"Read ColorLoopActive attribute from DUT Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertEqual([actualValue unsignedCharValue], 0);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_CC_9_1_000005_ColorLoopSet
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Sends ColorLoopSet Command - Set all Attributes"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
__auto_type * params = [[CHIPColorControlClusterColorLoopSetParams alloc] init];
params.updateFlags = [NSNumber numberWithUnsignedChar:2];
params.action = [NSNumber numberWithUnsignedChar:0];
params.direction = [NSNumber numberWithUnsignedChar:0];
params.time = [NSNumber numberWithUnsignedShort:0U];
params.startHue = [NSNumber numberWithUnsignedShort:0U];
params.optionsMask = [NSNumber numberWithUnsignedChar:0];
params.optionsOverride = [NSNumber numberWithUnsignedChar:0];
[cluster colorLoopSetWithParams:params
completionHandler:^(NSError * _Nullable err) {
NSLog(@"Sends ColorLoopSet Command - Set all Attributes Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_CC_9_1_000006_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Read ColorLoopDirection attribute from DUT"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeColorLoopDirectionWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"Read ColorLoopDirection attribute from DUT Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertEqual([actualValue unsignedCharValue], 0);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_CC_9_1_000007_ColorLoopSet
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Sends ColorLoopSet Command - Set all Attributes"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
__auto_type * params = [[CHIPColorControlClusterColorLoopSetParams alloc] init];
params.updateFlags = [NSNumber numberWithUnsignedChar:4];
params.action = [NSNumber numberWithUnsignedChar:0];
params.direction = [NSNumber numberWithUnsignedChar:0];
params.time = [NSNumber numberWithUnsignedShort:30U];
params.startHue = [NSNumber numberWithUnsignedShort:0U];
params.optionsMask = [NSNumber numberWithUnsignedChar:0];
params.optionsOverride = [NSNumber numberWithUnsignedChar:0];
[cluster colorLoopSetWithParams:params
completionHandler:^(NSError * _Nullable err) {
NSLog(@"Sends ColorLoopSet Command - Set all Attributes Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_CC_9_1_000008_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Read ColorLoopTime attribute from DUT"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeColorLoopTimeWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"Read ColorLoopTime attribute from DUT Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertEqual([actualValue unsignedShortValue], 30U);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_CC_9_1_000009_ColorLoopSet
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Sends ColorLoopSet Command - Set all Attributes"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
__auto_type * params = [[CHIPColorControlClusterColorLoopSetParams alloc] init];
params.updateFlags = [NSNumber numberWithUnsignedChar:8];
params.action = [NSNumber numberWithUnsignedChar:0];
params.direction = [NSNumber numberWithUnsignedChar:0];
params.time = [NSNumber numberWithUnsignedShort:0U];
params.startHue = [NSNumber numberWithUnsignedShort:160U];
params.optionsMask = [NSNumber numberWithUnsignedChar:0];
params.optionsOverride = [NSNumber numberWithUnsignedChar:0];
[cluster colorLoopSetWithParams:params
completionHandler:^(NSError * _Nullable err) {
NSLog(@"Sends ColorLoopSet Command - Set all Attributes Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_CC_9_1_000010_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Read ColorLoopStartEnhancedHue attribute from DUT"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeColorLoopStartEnhancedHueWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"Read ColorLoopStartEnhancedHue attribute from DUT Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertEqual([actualValue unsignedShortValue], 160U);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_CC_9_1_000011_ColorLoopSet
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Sends ColorLoopSet Command - Set all Attributes"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
__auto_type * params = [[CHIPColorControlClusterColorLoopSetParams alloc] init];
params.updateFlags = [NSNumber numberWithUnsignedChar:1];
params.action = [NSNumber numberWithUnsignedChar:1];
params.direction = [NSNumber numberWithUnsignedChar:0];
params.time = [NSNumber numberWithUnsignedShort:0U];
params.startHue = [NSNumber numberWithUnsignedShort:0U];
params.optionsMask = [NSNumber numberWithUnsignedChar:0];
params.optionsOverride = [NSNumber numberWithUnsignedChar:0];
[cluster colorLoopSetWithParams:params
completionHandler:^(NSError * _Nullable err) {
NSLog(@"Sends ColorLoopSet Command - Set all Attributes Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_CC_9_1_000012_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Read ColorLoopActive attribute from DUT"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeColorLoopActiveWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"Read ColorLoopActive attribute from DUT Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertEqual([actualValue unsignedCharValue], 1);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_CC_9_1_000013_ColorLoopSet
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Sends ColorLoopSet Command - Set all Attributes"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
__auto_type * params = [[CHIPColorControlClusterColorLoopSetParams alloc] init];
params.updateFlags = [NSNumber numberWithUnsignedChar:1];
params.action = [NSNumber numberWithUnsignedChar:0];
params.direction = [NSNumber numberWithUnsignedChar:0];
params.time = [NSNumber numberWithUnsignedShort:0U];
params.startHue = [NSNumber numberWithUnsignedShort:0U];
params.optionsMask = [NSNumber numberWithUnsignedChar:0];
params.optionsOverride = [NSNumber numberWithUnsignedChar:0];
[cluster colorLoopSetWithParams:params
completionHandler:^(NSError * _Nullable err) {
NSLog(@"Sends ColorLoopSet Command - Set all Attributes Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_CC_9_1_000014_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Read ColorLoopActive attribute from DUT"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeColorLoopActiveWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"Read ColorLoopActive attribute from DUT Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertEqual([actualValue unsignedCharValue], 0);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_CC_9_1_000015_ColorLoopSet
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Sends ColorLoopSet Command - Set all Attributes"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
__auto_type * params = [[CHIPColorControlClusterColorLoopSetParams alloc] init];
params.updateFlags = [NSNumber numberWithUnsignedChar:2];
params.action = [NSNumber numberWithUnsignedChar:0];
params.direction = [NSNumber numberWithUnsignedChar:1];
params.time = [NSNumber numberWithUnsignedShort:0U];
params.startHue = [NSNumber numberWithUnsignedShort:0U];
params.optionsMask = [NSNumber numberWithUnsignedChar:0];
params.optionsOverride = [NSNumber numberWithUnsignedChar:0];
[cluster colorLoopSetWithParams:params
completionHandler:^(NSError * _Nullable err) {
NSLog(@"Sends ColorLoopSet Command - Set all Attributes Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_CC_9_1_000016_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Read ColorLoopDirection attribute from DUT"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeColorLoopDirectionWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"Read ColorLoopDirection attribute from DUT Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertEqual([actualValue unsignedCharValue], 1);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_CC_9_1_000017_ColorLoopSet
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Sends ColorLoopSet Command - Set all Attributes"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
__auto_type * params = [[CHIPColorControlClusterColorLoopSetParams alloc] init];
params.updateFlags = [NSNumber numberWithUnsignedChar:1];
params.action = [NSNumber numberWithUnsignedChar:1];
params.direction = [NSNumber numberWithUnsignedChar:0];
params.time = [NSNumber numberWithUnsignedShort:0U];
params.startHue = [NSNumber numberWithUnsignedShort:0U];
params.optionsMask = [NSNumber numberWithUnsignedChar:0];
params.optionsOverride = [NSNumber numberWithUnsignedChar:0];
[cluster colorLoopSetWithParams:params
completionHandler:^(NSError * _Nullable err) {
NSLog(@"Sends ColorLoopSet Command - Set all Attributes Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_CC_9_1_000018_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Read ColorLoopActive attribute from DUT"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeColorLoopActiveWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"Read ColorLoopActive attribute from DUT Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertEqual([actualValue unsignedCharValue], 1);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_CC_9_1_000019_ColorLoopSet
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Sends ColorLoopSet Command - Set all Attributes"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
__auto_type * params = [[CHIPColorControlClusterColorLoopSetParams alloc] init];
params.updateFlags = [NSNumber numberWithUnsignedChar:1];
params.action = [NSNumber numberWithUnsignedChar:0];
params.direction = [NSNumber numberWithUnsignedChar:0];
params.time = [NSNumber numberWithUnsignedShort:0U];
params.startHue = [NSNumber numberWithUnsignedShort:0U];
params.optionsMask = [NSNumber numberWithUnsignedChar:0];
params.optionsOverride = [NSNumber numberWithUnsignedChar:0];
[cluster colorLoopSetWithParams:params
completionHandler:^(NSError * _Nullable err) {
NSLog(@"Sends ColorLoopSet Command - Set all Attributes Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_CC_9_1_000020_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Read ColorLoopActive attribute from DUT"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeColorLoopActiveWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"Read ColorLoopActive attribute from DUT Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertEqual([actualValue unsignedCharValue], 0);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_CC_9_1_000021_EnhancedMoveToHue
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Enhanced Move To Hue command 10"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
__auto_type * params = [[CHIPColorControlClusterEnhancedMoveToHueParams alloc] init];
params.enhancedHue = [NSNumber numberWithUnsignedShort:40960U];
params.direction = [NSNumber numberWithUnsignedChar:0];
params.transitionTime = [NSNumber numberWithUnsignedShort:0U];
params.optionsMask = [NSNumber numberWithUnsignedChar:0];
params.optionsOverride = [NSNumber numberWithUnsignedChar:0];
[cluster enhancedMoveToHueWithParams:params
completionHandler:^(NSError * _Nullable err) {
NSLog(@"Enhanced Move To Hue command 10 Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_CC_9_1_000022_WaitForMs
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Wait 2000ms"];
dispatch_queue_t queue = dispatch_get_main_queue();
WaitForMs(expectation, queue, 2000);
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_CC_9_1_000023_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Read EnhancedCurrentHue attribute from DUT"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeEnhancedCurrentHueWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"Read EnhancedCurrentHue attribute from DUT Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertEqual([actualValue unsignedShortValue], 40960U);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_CC_9_1_000024_ColorLoopSet
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Sends ColorLoopSet Command - Set all Attributes"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
__auto_type * params = [[CHIPColorControlClusterColorLoopSetParams alloc] init];
params.updateFlags = [NSNumber numberWithUnsignedChar:2];
params.action = [NSNumber numberWithUnsignedChar:0];
params.direction = [NSNumber numberWithUnsignedChar:0];
params.time = [NSNumber numberWithUnsignedShort:0U];
params.startHue = [NSNumber numberWithUnsignedShort:0U];
params.optionsMask = [NSNumber numberWithUnsignedChar:0];
params.optionsOverride = [NSNumber numberWithUnsignedChar:0];
[cluster colorLoopSetWithParams:params
completionHandler:^(NSError * _Nullable err) {
NSLog(@"Sends ColorLoopSet Command - Set all Attributes Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_CC_9_1_000025_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Read ColorLoopDirection attribute from DUT"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeColorLoopDirectionWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"Read ColorLoopDirection attribute from DUT Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertEqual([actualValue unsignedCharValue], 0);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_CC_9_1_000026_ColorLoopSet
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Sends ColorLoopSet Command - Set all Attributes"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
__auto_type * params = [[CHIPColorControlClusterColorLoopSetParams alloc] init];
params.updateFlags = [NSNumber numberWithUnsignedChar:1];
params.action = [NSNumber numberWithUnsignedChar:2];
params.direction = [NSNumber numberWithUnsignedChar:0];
params.time = [NSNumber numberWithUnsignedShort:0U];
params.startHue = [NSNumber numberWithUnsignedShort:0U];
params.optionsMask = [NSNumber numberWithUnsignedChar:0];
params.optionsOverride = [NSNumber numberWithUnsignedChar:0];
[cluster colorLoopSetWithParams:params
completionHandler:^(NSError * _Nullable err) {
NSLog(@"Sends ColorLoopSet Command - Set all Attributes Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_CC_9_1_000027_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Read ColorLoopActive attribute from DUT"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeColorLoopActiveWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"Read ColorLoopActive attribute from DUT Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertEqual([actualValue unsignedCharValue], 1);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_CC_9_1_000028_ColorLoopSet
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Sends ColorLoopSet Command - Set all Attributes"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
__auto_type * params = [[CHIPColorControlClusterColorLoopSetParams alloc] init];
params.updateFlags = [NSNumber numberWithUnsignedChar:1];
params.action = [NSNumber numberWithUnsignedChar:0];
params.direction = [NSNumber numberWithUnsignedChar:0];
params.time = [NSNumber numberWithUnsignedShort:0U];
params.startHue = [NSNumber numberWithUnsignedShort:0U];
params.optionsMask = [NSNumber numberWithUnsignedChar:0];
params.optionsOverride = [NSNumber numberWithUnsignedChar:0];
[cluster colorLoopSetWithParams:params
completionHandler:^(NSError * _Nullable err) {
NSLog(@"Sends ColorLoopSet Command - Set all Attributes Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_CC_9_1_000029_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Read ColorLoopActive attribute from DUT"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeColorLoopActiveWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"Read ColorLoopActive attribute from DUT Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertEqual([actualValue unsignedCharValue], 0);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_CC_9_1_000030_ColorLoopSet
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Sends ColorLoopSet Command - Set all Attributes"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
__auto_type * params = [[CHIPColorControlClusterColorLoopSetParams alloc] init];
params.updateFlags = [NSNumber numberWithUnsignedChar:2];
params.action = [NSNumber numberWithUnsignedChar:0];
params.direction = [NSNumber numberWithUnsignedChar:1];
params.time = [NSNumber numberWithUnsignedShort:0U];
params.startHue = [NSNumber numberWithUnsignedShort:0U];
params.optionsMask = [NSNumber numberWithUnsignedChar:0];
params.optionsOverride = [NSNumber numberWithUnsignedChar:0];
[cluster colorLoopSetWithParams:params
completionHandler:^(NSError * _Nullable err) {
NSLog(@"Sends ColorLoopSet Command - Set all Attributes Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_CC_9_1_000031_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Read ColorLoopDirection attribute from DUT"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeColorLoopDirectionWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"Read ColorLoopDirection attribute from DUT Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertEqual([actualValue unsignedCharValue], 1);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_CC_9_1_000032_ColorLoopSet
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Sends ColorLoopSet Command - Set all Attributes"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
__auto_type * params = [[CHIPColorControlClusterColorLoopSetParams alloc] init];
params.updateFlags = [NSNumber numberWithUnsignedChar:1];
params.action = [NSNumber numberWithUnsignedChar:2];
params.direction = [NSNumber numberWithUnsignedChar:0];
params.time = [NSNumber numberWithUnsignedShort:0U];
params.startHue = [NSNumber numberWithUnsignedShort:0U];
params.optionsMask = [NSNumber numberWithUnsignedChar:0];
params.optionsOverride = [NSNumber numberWithUnsignedChar:0];
[cluster colorLoopSetWithParams:params
completionHandler:^(NSError * _Nullable err) {
NSLog(@"Sends ColorLoopSet Command - Set all Attributes Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_CC_9_1_000033_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Read ColorLoopActive attribute from DUT"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeColorLoopActiveWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"Read ColorLoopActive attribute from DUT Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertEqual([actualValue unsignedCharValue], 1);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_CC_9_1_000034_ColorLoopSet
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Sends ColorLoopSet Command - Set all Attributes"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
__auto_type * params = [[CHIPColorControlClusterColorLoopSetParams alloc] init];
params.updateFlags = [NSNumber numberWithUnsignedChar:1];
params.action = [NSNumber numberWithUnsignedChar:0];
params.direction = [NSNumber numberWithUnsignedChar:0];
params.time = [NSNumber numberWithUnsignedShort:0U];
params.startHue = [NSNumber numberWithUnsignedShort:0U];
params.optionsMask = [NSNumber numberWithUnsignedChar:0];
params.optionsOverride = [NSNumber numberWithUnsignedChar:0];
[cluster colorLoopSetWithParams:params
completionHandler:^(NSError * _Nullable err) {
NSLog(@"Sends ColorLoopSet Command - Set all Attributes Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_CC_9_1_000035_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Read ColorLoopActive attribute from DUT"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeColorLoopActiveWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"Read ColorLoopActive attribute from DUT Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertEqual([actualValue unsignedCharValue], 0);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_CC_9_1_000036_Off
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Turn Off light for color control tests"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster offWithCompletionHandler:^(NSError * _Nullable err) {
NSLog(@"Turn Off light for color control tests Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_CC_9_2_000000_WaitForCommissionee
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"];
dispatch_queue_t queue = dispatch_get_main_queue();
WaitForCommissionee(expectation, queue);
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_CC_9_2_000001_On
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Precondition: Turn on light for color control tests"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster onWithCompletionHandler:^(NSError * _Nullable err) {
NSLog(@"Precondition: Turn on light for color control tests Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_CC_9_2_000002_ReadAttribute
{
XCTestExpectation * expectation =
[self expectationWithDescription:@"Precondition: Check on/off attribute value is true after on command"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeOnOffWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"Precondition: Check on/off attribute value is true after on command Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertEqual([actualValue boolValue], 1);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_CC_9_2_000003_ColorLoopSet
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Sends ColorLoopSet Command - Set all Attributes"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
__auto_type * params = [[CHIPColorControlClusterColorLoopSetParams alloc] init];
params.updateFlags = [NSNumber numberWithUnsignedChar:15];
params.action = [NSNumber numberWithUnsignedChar:0];
params.direction = [NSNumber numberWithUnsignedChar:0];
params.time = [NSNumber numberWithUnsignedShort:30U];
params.startHue = [NSNumber numberWithUnsignedShort:160U];
params.optionsMask = [NSNumber numberWithUnsignedChar:0];
params.optionsOverride = [NSNumber numberWithUnsignedChar:0];
[cluster colorLoopSetWithParams:params
completionHandler:^(NSError * _Nullable err) {
NSLog(@"Sends ColorLoopSet Command - Set all Attributes Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_CC_9_2_000004_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Read ColorLoopActive attribute from DUT"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeColorLoopActiveWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"Read ColorLoopActive attribute from DUT Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertEqual([actualValue unsignedCharValue], 0);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_CC_9_2_000005_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Read ColorLoopDirection attribute from DUT."];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeColorLoopDirectionWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"Read ColorLoopDirection attribute from DUT. Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertEqual([actualValue unsignedCharValue], 0);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_CC_9_2_000006_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Read ColorLoopTime attribute from DUT."];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeColorLoopTimeWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"Read ColorLoopTime attribute from DUT. Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertEqual([actualValue unsignedShortValue], 30U);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_CC_9_2_000007_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Read ColorLoopStartEnhancedHue attribute from DUT."];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeColorLoopStartEnhancedHueWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"Read ColorLoopStartEnhancedHue attribute from DUT. Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertEqual([actualValue unsignedShortValue], 160U);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_CC_9_2_000008_ColorLoopSet
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Color Loop Set Command - Set all Attributes"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
__auto_type * params = [[CHIPColorControlClusterColorLoopSetParams alloc] init];
params.updateFlags = [NSNumber numberWithUnsignedChar:1];
params.action = [NSNumber numberWithUnsignedChar:1];
params.direction = [NSNumber numberWithUnsignedChar:0];
params.time = [NSNumber numberWithUnsignedShort:0U];
params.startHue = [NSNumber numberWithUnsignedShort:0U];
params.optionsMask = [NSNumber numberWithUnsignedChar:0];
params.optionsOverride = [NSNumber numberWithUnsignedChar:0];
[cluster colorLoopSetWithParams:params
completionHandler:^(NSError * _Nullable err) {
NSLog(@"Color Loop Set Command - Set all Attributes Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_CC_9_2_000009_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Read ColorLoopActive attribute from DUT."];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeColorLoopActiveWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"Read ColorLoopActive attribute from DUT. Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertEqual([actualValue unsignedCharValue], 1);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_CC_9_2_000010_ColorLoopSet
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Color Loop Set Command - Start Color Loop"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
__auto_type * params = [[CHIPColorControlClusterColorLoopSetParams alloc] init];
params.updateFlags = [NSNumber numberWithUnsignedChar:2];
params.action = [NSNumber numberWithUnsignedChar:0];
params.direction = [NSNumber numberWithUnsignedChar:1];
params.time = [NSNumber numberWithUnsignedShort:0U];
params.startHue = [NSNumber numberWithUnsignedShort:0U];
params.optionsMask = [NSNumber numberWithUnsignedChar:0];
params.optionsOverride = [NSNumber numberWithUnsignedChar:0];
[cluster colorLoopSetWithParams:params
completionHandler:^(NSError * _Nullable err) {
NSLog(@"Color Loop Set Command - Start Color Loop Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_CC_9_2_000011_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Read ColorLoopDirection attribute from DUT."];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeColorLoopDirectionWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"Read ColorLoopDirection attribute from DUT. Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertEqual([actualValue unsignedCharValue], 1);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_CC_9_2_000012_ColorLoopSet
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Color Loop Set Command - Start Color Loop"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
__auto_type * params = [[CHIPColorControlClusterColorLoopSetParams alloc] init];
params.updateFlags = [NSNumber numberWithUnsignedChar:1];
params.action = [NSNumber numberWithUnsignedChar:0];
params.direction = [NSNumber numberWithUnsignedChar:0];
params.time = [NSNumber numberWithUnsignedShort:0U];
params.startHue = [NSNumber numberWithUnsignedShort:0U];
params.optionsMask = [NSNumber numberWithUnsignedChar:0];
params.optionsOverride = [NSNumber numberWithUnsignedChar:0];
[cluster colorLoopSetWithParams:params
completionHandler:^(NSError * _Nullable err) {
NSLog(@"Color Loop Set Command - Start Color Loop Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_CC_9_2_000013_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Read ColorLoopActive attribute from DUT"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeColorLoopActiveWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"Read ColorLoopActive attribute from DUT Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertEqual([actualValue unsignedCharValue], 0);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_CC_9_2_000014_Off
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Turn off light for color control tests"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster offWithCompletionHandler:^(NSError * _Nullable err) {
NSLog(@"Turn off light for color control tests Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_CC_9_3_000000_WaitForCommissionee
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"];
dispatch_queue_t queue = dispatch_get_main_queue();
WaitForCommissionee(expectation, queue);
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_CC_9_3_000001_On
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Precondition: Turn on light for color control tests"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster onWithCompletionHandler:^(NSError * _Nullable err) {
NSLog(@"Precondition: Turn on light for color control tests Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_CC_9_3_000002_ReadAttribute
{
XCTestExpectation * expectation =
[self expectationWithDescription:@"Precondition: Check on/off attribute value is true after on command"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeOnOffWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"Precondition: Check on/off attribute value is true after on command Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertEqual([actualValue boolValue], 1);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_CC_9_3_000003_ColorLoopSet
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Sends ColorLoopSet Command - Set all Attributes"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
__auto_type * params = [[CHIPColorControlClusterColorLoopSetParams alloc] init];
params.updateFlags = [NSNumber numberWithUnsignedChar:15];
params.action = [NSNumber numberWithUnsignedChar:0];
params.direction = [NSNumber numberWithUnsignedChar:0];
params.time = [NSNumber numberWithUnsignedShort:30U];
params.startHue = [NSNumber numberWithUnsignedShort:160U];
params.optionsMask = [NSNumber numberWithUnsignedChar:0];
params.optionsOverride = [NSNumber numberWithUnsignedChar:0];
[cluster colorLoopSetWithParams:params
completionHandler:^(NSError * _Nullable err) {
NSLog(@"Sends ColorLoopSet Command - Set all Attributes Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_CC_9_3_000004_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Read ColorLoopActive attribute from DUT"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeColorLoopActiveWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"Read ColorLoopActive attribute from DUT Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertEqual([actualValue unsignedCharValue], 0);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_CC_9_3_000005_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Read ColorLoopDirection attribute from DUT."];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeColorLoopDirectionWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"Read ColorLoopDirection attribute from DUT. Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertEqual([actualValue unsignedCharValue], 0);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_CC_9_3_000006_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Read ColorLoopTime attribute from DUT."];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeColorLoopTimeWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"Read ColorLoopTime attribute from DUT. Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertEqual([actualValue unsignedShortValue], 30U);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_CC_9_3_000007_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Read ColorLoopStartEnhancedHue attribute from DUT."];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeColorLoopStartEnhancedHueWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"Read ColorLoopStartEnhancedHue attribute from DUT. Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertEqual([actualValue unsignedShortValue], 160U);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_CC_9_3_000008_ColorLoopSet
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Color Loop Set Command - Set all Attributes"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
__auto_type * params = [[CHIPColorControlClusterColorLoopSetParams alloc] init];
params.updateFlags = [NSNumber numberWithUnsignedChar:1];
params.action = [NSNumber numberWithUnsignedChar:1];
params.direction = [NSNumber numberWithUnsignedChar:0];
params.time = [NSNumber numberWithUnsignedShort:0U];
params.startHue = [NSNumber numberWithUnsignedShort:0U];
params.optionsMask = [NSNumber numberWithUnsignedChar:0];
params.optionsOverride = [NSNumber numberWithUnsignedChar:0];
[cluster colorLoopSetWithParams:params
completionHandler:^(NSError * _Nullable err) {
NSLog(@"Color Loop Set Command - Set all Attributes Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_CC_9_3_000009_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Read ColorLoopActive attribute from DUT."];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeColorLoopActiveWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"Read ColorLoopActive attribute from DUT. Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertEqual([actualValue unsignedCharValue], 1);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_CC_9_3_000010_ColorLoopSet
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Color Loop Set Command - Start Color Loop"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
__auto_type * params = [[CHIPColorControlClusterColorLoopSetParams alloc] init];
params.updateFlags = [NSNumber numberWithUnsignedChar:4];
params.action = [NSNumber numberWithUnsignedChar:0];
params.direction = [NSNumber numberWithUnsignedChar:0];
params.time = [NSNumber numberWithUnsignedShort:60U];
params.startHue = [NSNumber numberWithUnsignedShort:0U];
params.optionsMask = [NSNumber numberWithUnsignedChar:0];
params.optionsOverride = [NSNumber numberWithUnsignedChar:0];
[cluster colorLoopSetWithParams:params
completionHandler:^(NSError * _Nullable err) {
NSLog(@"Color Loop Set Command - Start Color Loop Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_CC_9_3_000011_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Read ColorLoopTime attribute from DUT."];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeColorLoopTimeWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"Read ColorLoopTime attribute from DUT. Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertEqual([actualValue unsignedShortValue], 60U);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_CC_9_3_000012_ColorLoopSet
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Color Loop Set Command - Start Color Loop"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
__auto_type * params = [[CHIPColorControlClusterColorLoopSetParams alloc] init];
params.updateFlags = [NSNumber numberWithUnsignedChar:1];
params.action = [NSNumber numberWithUnsignedChar:0];
params.direction = [NSNumber numberWithUnsignedChar:0];
params.time = [NSNumber numberWithUnsignedShort:0U];
params.startHue = [NSNumber numberWithUnsignedShort:0U];
params.optionsMask = [NSNumber numberWithUnsignedChar:0];
params.optionsOverride = [NSNumber numberWithUnsignedChar:0];
[cluster colorLoopSetWithParams:params
completionHandler:^(NSError * _Nullable err) {
NSLog(@"Color Loop Set Command - Start Color Loop Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_CC_9_3_000013_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Read ColorLoopActive attribute from DUT"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeColorLoopActiveWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"Read ColorLoopActive attribute from DUT Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertEqual([actualValue unsignedCharValue], 0);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_CC_9_3_000014_Off
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Turn off light for color control tests"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster offWithCompletionHandler:^(NSError * _Nullable err) {
NSLog(@"Turn off light for color control tests Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_DM_1_1_000000_WaitForCommissionee
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"];
dispatch_queue_t queue = dispatch_get_main_queue();
WaitForCommissionee(expectation, queue);
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_DM_1_1_000001_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Query Interaction Model Version"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestBasic * cluster = [[CHIPTestBasic alloc] initWithDevice:device endpoint:0 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeInteractionModelVersionWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"Query Interaction Model Version Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_DM_1_1_000002_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Query Vendor Name"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestBasic * cluster = [[CHIPTestBasic alloc] initWithDevice:device endpoint:0 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeVendorNameWithCompletionHandler:^(NSString * _Nullable value, NSError * _Nullable err) {
NSLog(@"Query Vendor Name Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertLessThanOrEqual([actualValue length], 32);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_DM_1_1_000003_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Query VendorID"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestBasic * cluster = [[CHIPTestBasic alloc] initWithDevice:device endpoint:0 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeVendorIDWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"Query VendorID Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_DM_1_1_000004_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Query Product Name"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestBasic * cluster = [[CHIPTestBasic alloc] initWithDevice:device endpoint:0 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeProductNameWithCompletionHandler:^(NSString * _Nullable value, NSError * _Nullable err) {
NSLog(@"Query Product Name Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertLessThanOrEqual([actualValue length], 32);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_DM_1_1_000005_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Query ProductID"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestBasic * cluster = [[CHIPTestBasic alloc] initWithDevice:device endpoint:0 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeProductIDWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"Query ProductID Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_DM_1_1_000006_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Query Node Label"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestBasic * cluster = [[CHIPTestBasic alloc] initWithDevice:device endpoint:0 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeNodeLabelWithCompletionHandler:^(NSString * _Nullable value, NSError * _Nullable err) {
NSLog(@"Query Node Label Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertLessThanOrEqual([actualValue length], 32);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_DM_1_1_000007_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Query User Location"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestBasic * cluster = [[CHIPTestBasic alloc] initWithDevice:device endpoint:0 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeLocationWithCompletionHandler:^(NSString * _Nullable value, NSError * _Nullable err) {
NSLog(@"Query User Location Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertLessThanOrEqual([actualValue length], 2);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_DM_1_1_000008_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Query HardwareVersion"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestBasic * cluster = [[CHIPTestBasic alloc] initWithDevice:device endpoint:0 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeHardwareVersionWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"Query HardwareVersion Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_DM_1_1_000009_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Query HardwareVersionString"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestBasic * cluster = [[CHIPTestBasic alloc] initWithDevice:device endpoint:0 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeHardwareVersionStringWithCompletionHandler:^(NSString * _Nullable value, NSError * _Nullable err) {
NSLog(@"Query HardwareVersionString Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertGreaterThanOrEqual([actualValue length], 1);
}
{
id actualValue = value;
XCTAssertLessThanOrEqual([actualValue length], 64);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_DM_1_1_000010_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Query SoftwareVersion"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestBasic * cluster = [[CHIPTestBasic alloc] initWithDevice:device endpoint:0 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeSoftwareVersionWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"Query SoftwareVersion Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_DM_1_1_000011_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Query SoftwareVersionString"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestBasic * cluster = [[CHIPTestBasic alloc] initWithDevice:device endpoint:0 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeSoftwareVersionStringWithCompletionHandler:^(NSString * _Nullable value, NSError * _Nullable err) {
NSLog(@"Query SoftwareVersionString Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertGreaterThanOrEqual([actualValue length], 1);
}
{
id actualValue = value;
XCTAssertLessThanOrEqual([actualValue length], 64);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_DM_1_1_000012_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Query ManufacturingDate"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestBasic * cluster = [[CHIPTestBasic alloc] initWithDevice:device endpoint:0 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeManufacturingDateWithCompletionHandler:^(NSString * _Nullable value, NSError * _Nullable err) {
NSLog(@"Query ManufacturingDate Error: %@", err);
if (err.code == CHIPErrorCodeUnsupportedAttribute) {
[expectation fulfill];
return;
}
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertGreaterThanOrEqual([actualValue length], 8);
}
{
id actualValue = value;
XCTAssertLessThanOrEqual([actualValue length], 16);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_DM_1_1_000013_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Query PartNumber"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestBasic * cluster = [[CHIPTestBasic alloc] initWithDevice:device endpoint:0 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributePartNumberWithCompletionHandler:^(NSString * _Nullable value, NSError * _Nullable err) {
NSLog(@"Query PartNumber Error: %@", err);
if (err.code == CHIPErrorCodeUnsupportedAttribute) {
[expectation fulfill];
return;
}
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertLessThanOrEqual([actualValue length], 32);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_DM_1_1_000014_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Query ProductURL"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestBasic * cluster = [[CHIPTestBasic alloc] initWithDevice:device endpoint:0 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeProductURLWithCompletionHandler:^(NSString * _Nullable value, NSError * _Nullable err) {
NSLog(@"Query ProductURL Error: %@", err);
if (err.code == CHIPErrorCodeUnsupportedAttribute) {
[expectation fulfill];
return;
}
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertLessThanOrEqual([actualValue length], 256);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_DM_1_1_000015_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Query ProductLabel"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestBasic * cluster = [[CHIPTestBasic alloc] initWithDevice:device endpoint:0 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeProductLabelWithCompletionHandler:^(NSString * _Nullable value, NSError * _Nullable err) {
NSLog(@"Query ProductLabel Error: %@", err);
if (err.code == CHIPErrorCodeUnsupportedAttribute) {
[expectation fulfill];
return;
}
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertLessThanOrEqual([actualValue length], 64);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_DM_1_1_000016_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Query SerialNumber"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestBasic * cluster = [[CHIPTestBasic alloc] initWithDevice:device endpoint:0 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeSerialNumberWithCompletionHandler:^(NSString * _Nullable value, NSError * _Nullable err) {
NSLog(@"Query SerialNumber Error: %@", err);
if (err.code == CHIPErrorCodeUnsupportedAttribute) {
[expectation fulfill];
return;
}
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertLessThanOrEqual([actualValue length], 32);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_DM_1_1_000017_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Query LocalConfigDisabled"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestBasic * cluster = [[CHIPTestBasic alloc] initWithDevice:device endpoint:0 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeLocalConfigDisabledWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"Query LocalConfigDisabled Error: %@", err);
if (err.code == CHIPErrorCodeUnsupportedAttribute) {
[expectation fulfill];
return;
}
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_DM_1_1_000018_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Query Reachable"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestBasic * cluster = [[CHIPTestBasic alloc] initWithDevice:device endpoint:0 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeReachableWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"Query Reachable Error: %@", err);
if (err.code == CHIPErrorCodeUnsupportedAttribute) {
[expectation fulfill];
return;
}
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_DM_1_1_000019_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Query UniqueID"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestBasic * cluster = [[CHIPTestBasic alloc] initWithDevice:device endpoint:0 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeUniqueIDWithCompletionHandler:^(NSString * _Nullable value, NSError * _Nullable err) {
NSLog(@"Query UniqueID Error: %@", err);
if (err.code == CHIPErrorCodeUnsupportedAttribute) {
[expectation fulfill];
return;
}
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertLessThanOrEqual([actualValue length], 32);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_DM_3_1_000000_WaitForCommissionee
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"];
dispatch_queue_t queue = dispatch_get_main_queue();
WaitForCommissionee(expectation, queue);
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_EMR_1_1_000000_WaitForCommissionee
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"];
dispatch_queue_t queue = dispatch_get_main_queue();
WaitForCommissionee(expectation, queue);
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_EMR_1_1_000001_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"read the global attribute: ClusterRevision"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestElectricalMeasurement * cluster = [[CHIPTestElectricalMeasurement alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeClusterRevisionWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"read the global attribute: ClusterRevision Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertEqual([actualValue unsignedShortValue], 3U);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_EMR_1_1_000002_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Read the global attribute constraints: ClusterRevision"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestElectricalMeasurement * cluster = [[CHIPTestElectricalMeasurement alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeClusterRevisionWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"Read the global attribute constraints: ClusterRevision Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_EMR_1_1_000003_WriteAttribute
{
XCTestExpectation * expectation =
[self expectationWithDescription:@"write the default values to mandatory global attribute: ClusterRevision"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestElectricalMeasurement * cluster = [[CHIPTestElectricalMeasurement alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
id clusterRevisionArgument;
clusterRevisionArgument = [NSNumber numberWithUnsignedShort:1U];
[cluster
writeAttributeClusterRevisionWithValue:clusterRevisionArgument
completionHandler:^(NSError * _Nullable err) {
NSLog(@"write the default values to mandatory global attribute: ClusterRevision Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], EMBER_ZCL_STATUS_UNSUPPORTED_WRITE);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_EMR_1_1_000004_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"reads back global attribute: ClusterRevision"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestElectricalMeasurement * cluster = [[CHIPTestElectricalMeasurement alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeClusterRevisionWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"reads back global attribute: ClusterRevision Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertEqual([actualValue unsignedShortValue], 3U);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_FLW_1_1_000000_WaitForCommissionee
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"];
dispatch_queue_t queue = dispatch_get_main_queue();
WaitForCommissionee(expectation, queue);
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_FLW_1_1_000001_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Read the global attribute constraints: ClusterRevision"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestFlowMeasurement * cluster = [[CHIPTestFlowMeasurement alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeClusterRevisionWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"Read the global attribute constraints: ClusterRevision Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_FLW_1_1_000002_WriteAttribute
{
XCTestExpectation * expectation =
[self expectationWithDescription:@"write the default values to mandatory global attribute: ClusterRevision"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestFlowMeasurement * cluster = [[CHIPTestFlowMeasurement alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
id clusterRevisionArgument;
clusterRevisionArgument = [NSNumber numberWithUnsignedShort:2U];
[cluster
writeAttributeClusterRevisionWithValue:clusterRevisionArgument
completionHandler:^(NSError * _Nullable err) {
NSLog(@"write the default values to mandatory global attribute: ClusterRevision Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], EMBER_ZCL_STATUS_UNSUPPORTED_WRITE);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_FLW_2_1_000000_WaitForCommissionee
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"];
dispatch_queue_t queue = dispatch_get_main_queue();
WaitForCommissionee(expectation, queue);
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_FLW_2_1_000001_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"read the mandatory attribute: MeasuredValue"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestFlowMeasurement * cluster = [[CHIPTestFlowMeasurement alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeMeasuredValueWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"read the mandatory attribute: MeasuredValue Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_FLW_2_1_000002_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"read the mandatory attribute: MinMeasuredValue"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestFlowMeasurement * cluster = [[CHIPTestFlowMeasurement alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeMinMeasuredValueWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"read the mandatory attribute: MinMeasuredValue Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_FLW_2_1_000003_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"read the mandatory attribute: MaxMeasuredValue"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestFlowMeasurement * cluster = [[CHIPTestFlowMeasurement alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeMaxMeasuredValueWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"read the mandatory attribute: MaxMeasuredValue Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_FLW_2_1_000004_WriteAttribute
{
XCTestExpectation * expectation =
[self expectationWithDescription:@"write the default value to optional attribute: MinMeasuredValue"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestFlowMeasurement * cluster = [[CHIPTestFlowMeasurement alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
id minMeasuredValueArgument;
minMeasuredValueArgument = [NSNumber numberWithShort:0];
[cluster
writeAttributeMinMeasuredValueWithValue:minMeasuredValueArgument
completionHandler:^(NSError * _Nullable err) {
NSLog(@"write the default value to optional attribute: MinMeasuredValue Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], EMBER_ZCL_STATUS_UNSUPPORTED_WRITE);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_FLW_2_1_000005_WriteAttribute
{
XCTestExpectation * expectation =
[self expectationWithDescription:@"write the default value to optional attribute: MaxMeasuredValue"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestFlowMeasurement * cluster = [[CHIPTestFlowMeasurement alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
id maxMeasuredValueArgument;
maxMeasuredValueArgument = [NSNumber numberWithShort:0];
[cluster
writeAttributeMaxMeasuredValueWithValue:maxMeasuredValueArgument
completionHandler:^(NSError * _Nullable err) {
NSLog(@"write the default value to optional attribute: MaxMeasuredValue Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], EMBER_ZCL_STATUS_UNSUPPORTED_WRITE);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_FLW_2_1_000006_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"read the mandatory attribute: MeasuredValue"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestFlowMeasurement * cluster = [[CHIPTestFlowMeasurement alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeMeasuredValueWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"read the mandatory attribute: MeasuredValue Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_FLW_2_1_000007_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"read the mandatory attribute: MinMeasuredValue"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestFlowMeasurement * cluster = [[CHIPTestFlowMeasurement alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeMinMeasuredValueWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"read the mandatory attribute: MinMeasuredValue Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_FLW_2_1_000008_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"read the mandatory attribute: MaxMeasuredValue"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestFlowMeasurement * cluster = [[CHIPTestFlowMeasurement alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeMaxMeasuredValueWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"read the mandatory attribute: MaxMeasuredValue Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_FLW_2_2_000000_WaitForCommissionee
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"];
dispatch_queue_t queue = dispatch_get_main_queue();
WaitForCommissionee(expectation, queue);
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_FLW_2_2_000001_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"read the mandatory attribute: MeasuredValue"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestFlowMeasurement * cluster = [[CHIPTestFlowMeasurement alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeMeasuredValueWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"read the mandatory attribute: MeasuredValue Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_FLW_2_2_000002_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"read the mandatory attribute: MeasuredValue"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestFlowMeasurement * cluster = [[CHIPTestFlowMeasurement alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeMeasuredValueWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"read the mandatory attribute: MeasuredValue Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_ILL_1_1_000000_WaitForCommissionee
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"];
dispatch_queue_t queue = dispatch_get_main_queue();
WaitForCommissionee(expectation, queue);
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_ILL_1_1_000001_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"read the global attribute: ClusterRevision"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestIlluminanceMeasurement * cluster = [[CHIPTestIlluminanceMeasurement alloc] initWithDevice:device
endpoint:1
queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeClusterRevisionWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"read the global attribute: ClusterRevision Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertEqual([actualValue unsignedShortValue], 2U);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_ILL_1_1_000002_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Read the global attribute constraints: ClusterRevision"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestIlluminanceMeasurement * cluster = [[CHIPTestIlluminanceMeasurement alloc] initWithDevice:device
endpoint:1
queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeClusterRevisionWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"Read the global attribute constraints: ClusterRevision Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_ILL_1_1_000003_WriteAttribute
{
XCTestExpectation * expectation =
[self expectationWithDescription:@"write the default values to mandatory global attribute: ClusterRevision"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestIlluminanceMeasurement * cluster = [[CHIPTestIlluminanceMeasurement alloc] initWithDevice:device
endpoint:1
queue:queue];
XCTAssertNotNil(cluster);
id clusterRevisionArgument;
clusterRevisionArgument = [NSNumber numberWithUnsignedShort:1U];
[cluster
writeAttributeClusterRevisionWithValue:clusterRevisionArgument
completionHandler:^(NSError * _Nullable err) {
NSLog(@"write the default values to mandatory global attribute: ClusterRevision Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], EMBER_ZCL_STATUS_UNSUPPORTED_WRITE);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_ILL_1_1_000004_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"reads back global attribute: ClusterRevision"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestIlluminanceMeasurement * cluster = [[CHIPTestIlluminanceMeasurement alloc] initWithDevice:device
endpoint:1
queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeClusterRevisionWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"reads back global attribute: ClusterRevision Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertEqual([actualValue unsignedShortValue], 2U);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_LVL_1_1_000000_WaitForCommissionee
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"];
dispatch_queue_t queue = dispatch_get_main_queue();
WaitForCommissionee(expectation, queue);
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_LVL_1_1_000001_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Read the global attribute constraints: ClusterRevision"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestLevelControl * cluster = [[CHIPTestLevelControl alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeClusterRevisionWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"Read the global attribute constraints: ClusterRevision Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_LVL_1_1_000002_WriteAttribute
{
XCTestExpectation * expectation =
[self expectationWithDescription:@"write the default values to mandatory global attribute: ClusterRevision"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestLevelControl * cluster = [[CHIPTestLevelControl alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
id clusterRevisionArgument;
clusterRevisionArgument = [NSNumber numberWithUnsignedShort:4U];
[cluster
writeAttributeClusterRevisionWithValue:clusterRevisionArgument
completionHandler:^(NSError * _Nullable err) {
NSLog(@"write the default values to mandatory global attribute: ClusterRevision Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], EMBER_ZCL_STATUS_UNSUPPORTED_WRITE);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_LVL_2_1_000000_WaitForCommissionee
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"];
dispatch_queue_t queue = dispatch_get_main_queue();
WaitForCommissionee(expectation, queue);
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_LVL_2_1_000001_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"reads current Level attribute from DUT"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestLevelControl * cluster = [[CHIPTestLevelControl alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeCurrentLevelWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"reads current Level attribute from DUT Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertEqual([actualValue unsignedCharValue], 0);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_LVL_2_1_000002_MoveToLevel
{
XCTestExpectation * expectation = [self expectationWithDescription:@"sends a Move to level command"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestLevelControl * cluster = [[CHIPTestLevelControl alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
__auto_type * params = [[CHIPLevelControlClusterMoveToLevelParams alloc] init];
params.level = [NSNumber numberWithUnsignedChar:64];
params.transitionTime = [NSNumber numberWithUnsignedShort:0U];
params.optionMask = [NSNumber numberWithUnsignedChar:1];
params.optionOverride = [NSNumber numberWithUnsignedChar:1];
[cluster moveToLevelWithParams:params
completionHandler:^(NSError * _Nullable err) {
NSLog(@"sends a Move to level command Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_LVL_2_1_000003_WaitForMs
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Wait 100ms"];
dispatch_queue_t queue = dispatch_get_main_queue();
WaitForMs(expectation, queue, 100);
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_LVL_2_1_000004_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"reads current Level attribute from DUT"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestLevelControl * cluster = [[CHIPTestLevelControl alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeCurrentLevelWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"reads current Level attribute from DUT Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertEqual([actualValue unsignedCharValue], 64);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_LVL_2_1_000005_MoveToLevel
{
XCTestExpectation * expectation = [self expectationWithDescription:@"sends a Move to level command"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestLevelControl * cluster = [[CHIPTestLevelControl alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
__auto_type * params = [[CHIPLevelControlClusterMoveToLevelParams alloc] init];
params.level = [NSNumber numberWithUnsignedChar:128];
params.transitionTime = [NSNumber numberWithUnsignedShort:1U];
params.optionMask = [NSNumber numberWithUnsignedChar:1];
params.optionOverride = [NSNumber numberWithUnsignedChar:1];
[cluster moveToLevelWithParams:params
completionHandler:^(NSError * _Nullable err) {
NSLog(@"sends a Move to level command Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_LVL_2_1_000006_WaitForMs
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Wait 200ms"];
dispatch_queue_t queue = dispatch_get_main_queue();
WaitForMs(expectation, queue, 200);
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_LVL_2_1_000007_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"reads current Level attribute from DUT"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestLevelControl * cluster = [[CHIPTestLevelControl alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeCurrentLevelWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"reads current Level attribute from DUT Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertEqual([actualValue unsignedCharValue], 128);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_LVL_2_1_000008_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"reads On Off Transition Time attribute from DUT"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestLevelControl * cluster = [[CHIPTestLevelControl alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeOnOffTransitionTimeWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"reads On Off Transition Time attribute from DUT Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertEqual([actualValue unsignedShortValue], 0U);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_LVL_2_1_000009_MoveToLevel
{
XCTestExpectation * expectation = [self expectationWithDescription:@"sends a Move to level command"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestLevelControl * cluster = [[CHIPTestLevelControl alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
__auto_type * params = [[CHIPLevelControlClusterMoveToLevelParams alloc] init];
params.level = [NSNumber numberWithUnsignedChar:254];
params.transitionTime = [NSNumber numberWithUnsignedShort:65535U];
params.optionMask = [NSNumber numberWithUnsignedChar:1];
params.optionOverride = [NSNumber numberWithUnsignedChar:1];
[cluster moveToLevelWithParams:params
completionHandler:^(NSError * _Nullable err) {
NSLog(@"sends a Move to level command Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_LVL_2_1_000010_WaitForMs
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Wait 10ms"];
dispatch_queue_t queue = dispatch_get_main_queue();
WaitForMs(expectation, queue, 10);
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_LVL_2_1_000011_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"reads current Level attribute from DUT"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestLevelControl * cluster = [[CHIPTestLevelControl alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeCurrentLevelWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"reads current Level attribute from DUT Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertEqual([actualValue unsignedCharValue], 254);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_LVL_2_1_000012_MoveToLevel
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Reset level to 0"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestLevelControl * cluster = [[CHIPTestLevelControl alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
__auto_type * params = [[CHIPLevelControlClusterMoveToLevelParams alloc] init];
params.level = [NSNumber numberWithUnsignedChar:0];
params.transitionTime = [NSNumber numberWithUnsignedShort:0U];
params.optionMask = [NSNumber numberWithUnsignedChar:1];
params.optionOverride = [NSNumber numberWithUnsignedChar:1];
[cluster moveToLevelWithParams:params
completionHandler:^(NSError * _Nullable err) {
NSLog(@"Reset level to 0 Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_LVL_2_1_000013_WaitForMs
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Wait 100ms"];
dispatch_queue_t queue = dispatch_get_main_queue();
WaitForMs(expectation, queue, 100);
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_LVL_3_1_000000_WaitForCommissionee
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"];
dispatch_queue_t queue = dispatch_get_main_queue();
WaitForCommissionee(expectation, queue);
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_LVL_3_1_000001_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"reads current level attribute from DUT"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestLevelControl * cluster = [[CHIPTestLevelControl alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeCurrentLevelWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"reads current level attribute from DUT Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertEqual([actualValue unsignedCharValue], 0);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_LVL_3_1_000002_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"reads max level attribute from DUT"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestLevelControl * cluster = [[CHIPTestLevelControl alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeMaxLevelWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"reads max level attribute from DUT Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertEqual([actualValue unsignedCharValue], 255);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_LVL_3_1_000003_Move
{
XCTestExpectation * expectation = [self expectationWithDescription:@"sends a Move up command"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestLevelControl * cluster = [[CHIPTestLevelControl alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
__auto_type * params = [[CHIPLevelControlClusterMoveParams alloc] init];
params.moveMode = [NSNumber numberWithUnsignedChar:0];
params.rate = [NSNumber numberWithUnsignedChar:200];
params.optionMask = [NSNumber numberWithUnsignedChar:1];
params.optionOverride = [NSNumber numberWithUnsignedChar:1];
[cluster moveWithParams:params
completionHandler:^(NSError * _Nullable err) {
NSLog(@"sends a Move up command Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_LVL_3_1_000004_WaitForMs
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Wait 3000ms"];
dispatch_queue_t queue = dispatch_get_main_queue();
WaitForMs(expectation, queue, 3000);
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_LVL_3_1_000005_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"reads current level attribute from DUT"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestLevelControl * cluster = [[CHIPTestLevelControl alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeCurrentLevelWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"reads current level attribute from DUT Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertEqual([actualValue unsignedCharValue], 255);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_LVL_3_1_000006_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"reads min level attribute from DUT"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestLevelControl * cluster = [[CHIPTestLevelControl alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeMinLevelWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"reads min level attribute from DUT Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertEqual([actualValue unsignedCharValue], 0);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_LVL_3_1_000007_Move
{
XCTestExpectation * expectation = [self expectationWithDescription:@"sends a Move down command"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestLevelControl * cluster = [[CHIPTestLevelControl alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
__auto_type * params = [[CHIPLevelControlClusterMoveParams alloc] init];
params.moveMode = [NSNumber numberWithUnsignedChar:1];
params.rate = [NSNumber numberWithUnsignedChar:250];
params.optionMask = [NSNumber numberWithUnsignedChar:1];
params.optionOverride = [NSNumber numberWithUnsignedChar:1];
[cluster moveWithParams:params
completionHandler:^(NSError * _Nullable err) {
NSLog(@"sends a Move down command Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_LVL_3_1_000008_WaitForMs
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Wait 3000ms"];
dispatch_queue_t queue = dispatch_get_main_queue();
WaitForMs(expectation, queue, 3000);
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_LVL_3_1_000009_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"reads current level attribute from DUT"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestLevelControl * cluster = [[CHIPTestLevelControl alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeCurrentLevelWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"reads current level attribute from DUT Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertEqual([actualValue unsignedCharValue], 0);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_LVL_3_1_000010_WriteAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Write default move rate attribute from DUT"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestLevelControl * cluster = [[CHIPTestLevelControl alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
id defaultMoveRateArgument;
defaultMoveRateArgument = [NSNumber numberWithUnsignedChar:20];
[cluster writeAttributeDefaultMoveRateWithValue:defaultMoveRateArgument
completionHandler:^(NSError * _Nullable err) {
NSLog(@"Write default move rate attribute from DUT Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_LVL_3_1_000011_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"reads default move rate attribute from DUT"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestLevelControl * cluster = [[CHIPTestLevelControl alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeDefaultMoveRateWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"reads default move rate attribute from DUT Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertFalse(actualValue == nil);
XCTAssertEqual([actualValue unsignedCharValue], 20);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_LVL_3_1_000012_Move
{
XCTestExpectation * expectation = [self expectationWithDescription:@"sends a Move up command at default move rate"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestLevelControl * cluster = [[CHIPTestLevelControl alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
__auto_type * params = [[CHIPLevelControlClusterMoveParams alloc] init];
params.moveMode = [NSNumber numberWithUnsignedChar:1];
params.rate = [NSNumber numberWithUnsignedChar:255];
params.optionMask = [NSNumber numberWithUnsignedChar:1];
params.optionOverride = [NSNumber numberWithUnsignedChar:1];
[cluster moveWithParams:params
completionHandler:^(NSError * _Nullable err) {
NSLog(@"sends a Move up command at default move rate Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_LVL_3_1_000013_WaitForMs
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Wait 100ms"];
dispatch_queue_t queue = dispatch_get_main_queue();
WaitForMs(expectation, queue, 100);
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_LVL_3_1_000014_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"reads current level attribute from DUT"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestLevelControl * cluster = [[CHIPTestLevelControl alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeCurrentLevelWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"reads current level attribute from DUT Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertNotEqual([actualValue unsignedCharValue], 255);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_LVL_4_1_000000_WaitForCommissionee
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"];
dispatch_queue_t queue = dispatch_get_main_queue();
WaitForCommissionee(expectation, queue);
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_LVL_4_1_000001_On
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Sending on command"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster onWithCompletionHandler:^(NSError * _Nullable err) {
NSLog(@"Sending on command Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_LVL_4_1_000002_Step
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Precondition: DUT level is set to 0x80"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestLevelControl * cluster = [[CHIPTestLevelControl alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
__auto_type * params = [[CHIPLevelControlClusterStepParams alloc] init];
params.stepMode = [NSNumber numberWithUnsignedChar:0];
params.stepSize = [NSNumber numberWithUnsignedChar:128];
params.transitionTime = [NSNumber numberWithUnsignedShort:20U];
params.optionMask = [NSNumber numberWithUnsignedChar:0];
params.optionOverride = [NSNumber numberWithUnsignedChar:0];
[cluster stepWithParams:params
completionHandler:^(NSError * _Nullable err) {
NSLog(@"Precondition: DUT level is set to 0x80 Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_LVL_4_1_000003_WaitForMs
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Wait 3000ms"];
dispatch_queue_t queue = dispatch_get_main_queue();
WaitForMs(expectation, queue, 3000);
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_LVL_4_1_000004_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Reads current level attribute from DUT"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestLevelControl * cluster = [[CHIPTestLevelControl alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeCurrentLevelWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"Reads current level attribute from DUT Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertEqual([actualValue unsignedCharValue], 128);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_LVL_4_1_000005_Step
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Sends step down command to DUT"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestLevelControl * cluster = [[CHIPTestLevelControl alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
__auto_type * params = [[CHIPLevelControlClusterStepParams alloc] init];
params.stepMode = [NSNumber numberWithUnsignedChar:1];
params.stepSize = [NSNumber numberWithUnsignedChar:64];
params.transitionTime = [NSNumber numberWithUnsignedShort:20U];
params.optionMask = [NSNumber numberWithUnsignedChar:0];
params.optionOverride = [NSNumber numberWithUnsignedChar:0];
[cluster stepWithParams:params
completionHandler:^(NSError * _Nullable err) {
NSLog(@"Sends step down command to DUT Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_LVL_4_1_000006_WaitForMs
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Wait 3000ms"];
dispatch_queue_t queue = dispatch_get_main_queue();
WaitForMs(expectation, queue, 3000);
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_LVL_4_1_000007_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Reads current level attribute from DUT"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestLevelControl * cluster = [[CHIPTestLevelControl alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeCurrentLevelWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"Reads current level attribute from DUT Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertEqual([actualValue unsignedCharValue], 64);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_LVL_4_1_000008_Step
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Sends a Step up command"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestLevelControl * cluster = [[CHIPTestLevelControl alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
__auto_type * params = [[CHIPLevelControlClusterStepParams alloc] init];
params.stepMode = [NSNumber numberWithUnsignedChar:0];
params.stepSize = [NSNumber numberWithUnsignedChar:64];
params.transitionTime = [NSNumber numberWithUnsignedShort:20U];
params.optionMask = [NSNumber numberWithUnsignedChar:0];
params.optionOverride = [NSNumber numberWithUnsignedChar:0];
[cluster stepWithParams:params
completionHandler:^(NSError * _Nullable err) {
NSLog(@"Sends a Step up command Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_LVL_4_1_000009_WaitForMs
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Wait 3000ms"];
dispatch_queue_t queue = dispatch_get_main_queue();
WaitForMs(expectation, queue, 3000);
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_LVL_4_1_000010_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Reads current level attribute from DUT"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestLevelControl * cluster = [[CHIPTestLevelControl alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeCurrentLevelWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"Reads current level attribute from DUT Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertEqual([actualValue unsignedCharValue], 128);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_LVL_4_1_000011_Off
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Sending off command"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster offWithCompletionHandler:^(NSError * _Nullable err) {
NSLog(@"Sending off command Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_LVL_5_1_000000_WaitForCommissionee
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"];
dispatch_queue_t queue = dispatch_get_main_queue();
WaitForCommissionee(expectation, queue);
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_LVL_5_1_000001_On
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Sending on command"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster onWithCompletionHandler:^(NSError * _Nullable err) {
NSLog(@"Sending on command Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_LVL_5_1_000002_Step
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Precondition: DUT level is set to 0x80"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestLevelControl * cluster = [[CHIPTestLevelControl alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
__auto_type * params = [[CHIPLevelControlClusterStepParams alloc] init];
params.stepMode = [NSNumber numberWithUnsignedChar:0];
params.stepSize = [NSNumber numberWithUnsignedChar:128];
params.transitionTime = [NSNumber numberWithUnsignedShort:20U];
params.optionMask = [NSNumber numberWithUnsignedChar:0];
params.optionOverride = [NSNumber numberWithUnsignedChar:0];
[cluster stepWithParams:params
completionHandler:^(NSError * _Nullable err) {
NSLog(@"Precondition: DUT level is set to 0x80 Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_LVL_5_1_000003_WaitForMs
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Wait 3000ms"];
dispatch_queue_t queue = dispatch_get_main_queue();
WaitForMs(expectation, queue, 3000);
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_LVL_5_1_000004_Move
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Sends a move up command to DUT"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestLevelControl * cluster = [[CHIPTestLevelControl alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
__auto_type * params = [[CHIPLevelControlClusterMoveParams alloc] init];
params.moveMode = [NSNumber numberWithUnsignedChar:0];
params.rate = [NSNumber numberWithUnsignedChar:1];
params.optionMask = [NSNumber numberWithUnsignedChar:1];
params.optionOverride = [NSNumber numberWithUnsignedChar:1];
[cluster moveWithParams:params
completionHandler:^(NSError * _Nullable err) {
NSLog(@"Sends a move up command to DUT Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_LVL_5_1_000005_WaitForMs
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Wait 3000ms"];
dispatch_queue_t queue = dispatch_get_main_queue();
WaitForMs(expectation, queue, 3000);
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_LVL_5_1_000006_Stop
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Sends stop command to DUT"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestLevelControl * cluster = [[CHIPTestLevelControl alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
__auto_type * params = [[CHIPLevelControlClusterStopParams alloc] init];
params.optionMask = [NSNumber numberWithUnsignedChar:0];
params.optionOverride = [NSNumber numberWithUnsignedChar:0];
[cluster stopWithParams:params
completionHandler:^(NSError * _Nullable err) {
NSLog(@"Sends stop command to DUT Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_LVL_5_1_000007_Off
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Sending off command"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster offWithCompletionHandler:^(NSError * _Nullable err) {
NSLog(@"Sending off command Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_MC_1_1_000000_WaitForCommissionee
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"];
dispatch_queue_t queue = dispatch_get_main_queue();
WaitForCommissionee(expectation, queue);
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_MC_1_1_000001_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Read the global attribute constraints: ClusterRevision"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestMediaInput * cluster = [[CHIPTestMediaInput alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeClusterRevisionWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"Read the global attribute constraints: ClusterRevision Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_MC_1_1_000002_WriteAttribute
{
XCTestExpectation * expectation =
[self expectationWithDescription:@"write the default values to mandatory global attribute: ClusterRevision"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestMediaInput * cluster = [[CHIPTestMediaInput alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
id clusterRevisionArgument;
clusterRevisionArgument = [NSNumber numberWithUnsignedShort:1U];
[cluster
writeAttributeClusterRevisionWithValue:clusterRevisionArgument
completionHandler:^(NSError * _Nullable err) {
NSLog(@"write the default values to mandatory global attribute: ClusterRevision Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], EMBER_ZCL_STATUS_UNSUPPORTED_WRITE);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_MC_2_1_000000_WaitForCommissionee
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"];
dispatch_queue_t queue = dispatch_get_main_queue();
WaitForCommissionee(expectation, queue);
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_MC_2_1_000001_Sleep
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Put the device into low power mode"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestLowPower * cluster = [[CHIPTestLowPower alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster sleepWithCompletionHandler:^(NSError * _Nullable err) {
NSLog(@"Put the device into low power mode Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_MC_3_1_000000_WaitForCommissionee
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"];
dispatch_queue_t queue = dispatch_get_main_queue();
WaitForCommissionee(expectation, queue);
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_MC_3_2_000000_WaitForCommissionee
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"];
dispatch_queue_t queue = dispatch_get_main_queue();
WaitForCommissionee(expectation, queue);
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_MC_3_3_000000_WaitForCommissionee
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"];
dispatch_queue_t queue = dispatch_get_main_queue();
WaitForCommissionee(expectation, queue);
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_MC_3_4_000000_WaitForCommissionee
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"];
dispatch_queue_t queue = dispatch_get_main_queue();
WaitForCommissionee(expectation, queue);
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_MC_3_5_000000_WaitForCommissionee
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"];
dispatch_queue_t queue = dispatch_get_main_queue();
WaitForCommissionee(expectation, queue);
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_MC_3_6_000000_WaitForCommissionee
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"];
dispatch_queue_t queue = dispatch_get_main_queue();
WaitForCommissionee(expectation, queue);
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_MC_3_7_000000_WaitForCommissionee
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"];
dispatch_queue_t queue = dispatch_get_main_queue();
WaitForCommissionee(expectation, queue);
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_MC_3_8_000000_WaitForCommissionee
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"];
dispatch_queue_t queue = dispatch_get_main_queue();
WaitForCommissionee(expectation, queue);
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_MC_3_9_000000_WaitForCommissionee
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"];
dispatch_queue_t queue = dispatch_get_main_queue();
WaitForCommissionee(expectation, queue);
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_MC_3_10_000000_WaitForCommissionee
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"];
dispatch_queue_t queue = dispatch_get_main_queue();
WaitForCommissionee(expectation, queue);
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_MC_3_11_000000_WaitForCommissionee
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"];
dispatch_queue_t queue = dispatch_get_main_queue();
WaitForCommissionee(expectation, queue);
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_OCC_1_1_000000_WaitForCommissionee
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"];
dispatch_queue_t queue = dispatch_get_main_queue();
WaitForCommissionee(expectation, queue);
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_OCC_1_1_000001_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"read the global attribute: ClusterRevision"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestOccupancySensing * cluster = [[CHIPTestOccupancySensing alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeClusterRevisionWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"read the global attribute: ClusterRevision Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertEqual([actualValue unsignedShortValue], 2U);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_OCC_1_1_000002_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Read the global attribute constraints: ClusterRevision"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestOccupancySensing * cluster = [[CHIPTestOccupancySensing alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeClusterRevisionWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"Read the global attribute constraints: ClusterRevision Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_OCC_1_1_000003_WriteAttribute
{
XCTestExpectation * expectation =
[self expectationWithDescription:@"write the default values to mandatory global attribute: ClusterRevision"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestOccupancySensing * cluster = [[CHIPTestOccupancySensing alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
id clusterRevisionArgument;
clusterRevisionArgument = [NSNumber numberWithUnsignedShort:2U];
[cluster
writeAttributeClusterRevisionWithValue:clusterRevisionArgument
completionHandler:^(NSError * _Nullable err) {
NSLog(@"write the default values to mandatory global attribute: ClusterRevision Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], EMBER_ZCL_STATUS_UNSUPPORTED_WRITE);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_OCC_2_1_000000_WaitForCommissionee
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"];
dispatch_queue_t queue = dispatch_get_main_queue();
WaitForCommissionee(expectation, queue);
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_OCC_2_1_000001_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Reads mandatory attribute constrains: Occupancy"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestOccupancySensing * cluster = [[CHIPTestOccupancySensing alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeOccupancyWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"Reads mandatory attribute constrains: Occupancy Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertLessThanOrEqual([actualValue unsignedCharValue], 1);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_OCC_2_1_000002_WriteAttribute
{
XCTestExpectation * expectation =
[self expectationWithDescription:@"Writes the respective default value to mandatory attribute: Occupancy"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestOccupancySensing * cluster = [[CHIPTestOccupancySensing alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
id occupancyArgument;
occupancyArgument = [NSNumber numberWithUnsignedChar:0];
[cluster writeAttributeOccupancyWithValue:occupancyArgument
completionHandler:^(NSError * _Nullable err) {
NSLog(@"Writes the respective default value to mandatory attribute: Occupancy Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], EMBER_ZCL_STATUS_UNSUPPORTED_WRITE);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_OCC_2_1_000003_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Reads back mandatory attribute: Occupancy"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestOccupancySensing * cluster = [[CHIPTestOccupancySensing alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeOccupancyWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"Reads back mandatory attribute: Occupancy Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertEqual([actualValue unsignedCharValue], 0);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_OCC_2_1_000004_ReadAttribute
{
XCTestExpectation * expectation =
[self expectationWithDescription:@"Reads mandatory attribute constrains: OccupancySensorType"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestOccupancySensing * cluster = [[CHIPTestOccupancySensing alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeOccupancySensorTypeWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"Reads mandatory attribute constrains: OccupancySensorType Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertLessThanOrEqual([actualValue unsignedCharValue], 3);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_OCC_2_1_000005_WriteAttribute
{
XCTestExpectation * expectation =
[self expectationWithDescription:@"Writes the respective default value to mandatory attribute: OccupancySensorType"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestOccupancySensing * cluster = [[CHIPTestOccupancySensing alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
id occupancySensorTypeArgument;
occupancySensorTypeArgument = [NSNumber numberWithUnsignedChar:0];
[cluster writeAttributeOccupancySensorTypeWithValue:occupancySensorTypeArgument
completionHandler:^(NSError * _Nullable err) {
NSLog(@"Writes the respective default value to mandatory attribute: OccupancySensorType "
@"Error: %@",
err);
XCTAssertEqual(
[CHIPErrorTestUtils errorToZCLErrorCode:err], EMBER_ZCL_STATUS_UNSUPPORTED_WRITE);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_OCC_2_1_000006_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Reads back mandatory attribute: OccupancySensorType"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestOccupancySensing * cluster = [[CHIPTestOccupancySensing alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeOccupancySensorTypeWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"Reads back mandatory attribute: OccupancySensorType Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertEqual([actualValue unsignedCharValue], 0);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_OCC_2_1_000007_ReadAttribute
{
XCTestExpectation * expectation =
[self expectationWithDescription:@"Reads mandatory attribute constrains: OccupancySensorTypeBitmap"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestOccupancySensing * cluster = [[CHIPTestOccupancySensing alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeOccupancySensorTypeBitmapWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"Reads mandatory attribute constrains: OccupancySensorTypeBitmap Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertGreaterThanOrEqual([actualValue unsignedCharValue], 1);
}
{
id actualValue = value;
XCTAssertLessThanOrEqual([actualValue unsignedCharValue], 7);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_OCC_2_1_000008_WriteAttribute
{
XCTestExpectation * expectation =
[self expectationWithDescription:@"Writes the respective default value to mandatory attribute: OccupancySensorTypeBitmap"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestOccupancySensing * cluster = [[CHIPTestOccupancySensing alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
id occupancySensorTypeBitmapArgument;
occupancySensorTypeBitmapArgument = [NSNumber numberWithUnsignedChar:1];
[cluster writeAttributeOccupancySensorTypeBitmapWithValue:occupancySensorTypeBitmapArgument
completionHandler:^(NSError * _Nullable err) {
NSLog(@"Writes the respective default value to mandatory attribute: "
@"OccupancySensorTypeBitmap Error: %@",
err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err],
EMBER_ZCL_STATUS_UNSUPPORTED_WRITE);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_OCC_2_1_000009_ReadAttribute
{
XCTestExpectation * expectation =
[self expectationWithDescription:@"Reads back mandatory attribute: OccupancySensorTypeBitmap"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestOccupancySensing * cluster = [[CHIPTestOccupancySensing alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeOccupancySensorTypeBitmapWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"Reads back mandatory attribute: OccupancySensorTypeBitmap Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertEqual([actualValue unsignedCharValue], 1);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_OCC_2_2_000000_WaitForCommissionee
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"];
dispatch_queue_t queue = dispatch_get_main_queue();
WaitForCommissionee(expectation, queue);
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_OCC_2_2_000001_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Reads Occupancy attribute from DUT"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestOccupancySensing * cluster = [[CHIPTestOccupancySensing alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeOccupancyWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"Reads Occupancy attribute from DUT Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_OCC_2_2_000002_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Reads Occupancy attribute from DUT"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestOccupancySensing * cluster = [[CHIPTestOccupancySensing alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeOccupancyWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"Reads Occupancy attribute from DUT Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_OO_1_1_000000_WaitForCommissionee
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"];
dispatch_queue_t queue = dispatch_get_main_queue();
WaitForCommissionee(expectation, queue);
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_OO_1_1_000001_WaitForCommissionee
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"];
dispatch_queue_t queue = dispatch_get_main_queue();
WaitForCommissionee(expectation, queue);
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_OO_1_1_000002_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"read the global attribute: ClusterRevision"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeClusterRevisionWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"read the global attribute: ClusterRevision Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertEqual([actualValue unsignedShortValue], 4U);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_OO_1_1_000003_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Read the global attribute constraints: ClusterRevision"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeClusterRevisionWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"Read the global attribute constraints: ClusterRevision Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_OO_1_1_000004_WriteAttribute
{
XCTestExpectation * expectation =
[self expectationWithDescription:@"write the default values to mandatory global attribute: ClusterRevision"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
id clusterRevisionArgument;
clusterRevisionArgument = [NSNumber numberWithUnsignedShort:3U];
[cluster
writeAttributeClusterRevisionWithValue:clusterRevisionArgument
completionHandler:^(NSError * _Nullable err) {
NSLog(@"write the default values to mandatory global attribute: ClusterRevision Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], EMBER_ZCL_STATUS_UNSUPPORTED_WRITE);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_OO_1_1_000005_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"reads back global attribute: ClusterRevision"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeClusterRevisionWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"reads back global attribute: ClusterRevision Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertEqual([actualValue unsignedShortValue], 4U);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_OO_1_1_000006_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"read the optional global attribute: FeatureMap"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeFeatureMapWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"read the optional global attribute: FeatureMap Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertEqual([actualValue unsignedIntValue], 0UL);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_OO_1_1_000007_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Read the optional global attribute : FeatureMap"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeFeatureMapWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"Read the optional global attribute : FeatureMap Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_OO_1_1_000008_WriteAttribute
{
XCTestExpectation * expectation =
[self expectationWithDescription:@"write the default values to optional global attribute: FeatureMap"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
id featureMapArgument;
featureMapArgument = [NSNumber numberWithUnsignedInt:0UL];
[cluster writeAttributeFeatureMapWithValue:featureMapArgument
completionHandler:^(NSError * _Nullable err) {
NSLog(@"write the default values to optional global attribute: FeatureMap Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], EMBER_ZCL_STATUS_UNSUPPORTED_WRITE);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_OO_1_1_000009_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"reads back optional global attribute: FeatureMap"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeFeatureMapWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"reads back optional global attribute: FeatureMap Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertEqual([actualValue unsignedIntValue], 0UL);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_OO_2_1_000000_WaitForCommissionee
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"];
dispatch_queue_t queue = dispatch_get_main_queue();
WaitForCommissionee(expectation, queue);
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_OO_2_1_000001_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"read the mandatory attribute: OnOff"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeOnOffWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"read the mandatory attribute: OnOff Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertEqual([actualValue boolValue], 0);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_OO_2_1_000002_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"reads back mandatory attribute: OnOff"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeOnOffWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"reads back mandatory attribute: OnOff Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertEqual([actualValue boolValue], 0);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_OO_2_1_000003_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"read LT attribute: GlobalSceneControl"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeGlobalSceneControlWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"read LT attribute: GlobalSceneControl Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertEqual([actualValue boolValue], 1);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_OO_2_1_000004_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"read LT attribute: OnTime"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeOnTimeWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"read LT attribute: OnTime Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertEqual([actualValue unsignedShortValue], 0U);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_OO_2_1_000005_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"read LT attribute: OffWaitTime"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeOffWaitTimeWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"read LT attribute: OffWaitTime Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertEqual([actualValue unsignedShortValue], 0U);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_OO_2_1_000006_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"read LT attribute: StartUpOnOff"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeStartUpOnOffWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"read LT attribute: StartUpOnOff Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertEqual([actualValue unsignedCharValue], 0);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_OO_2_1_000007_WriteAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"write the default value to LT attribute: OnTime"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
id onTimeArgument;
onTimeArgument = [NSNumber numberWithUnsignedShort:0U];
[cluster writeAttributeOnTimeWithValue:onTimeArgument
completionHandler:^(NSError * _Nullable err) {
NSLog(@"write the default value to LT attribute: OnTime Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_OO_2_1_000008_WriteAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"write the default value to LT attribute: OffWaitTime"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
id offWaitTimeArgument;
offWaitTimeArgument = [NSNumber numberWithUnsignedShort:0U];
[cluster writeAttributeOffWaitTimeWithValue:offWaitTimeArgument
completionHandler:^(NSError * _Nullable err) {
NSLog(@"write the default value to LT attribute: OffWaitTime Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_OO_2_1_000009_WriteAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"write the default value to LT attribute: StartUpOnOff"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
id startUpOnOffArgument;
startUpOnOffArgument = [NSNumber numberWithUnsignedChar:0];
[cluster writeAttributeStartUpOnOffWithValue:startUpOnOffArgument
completionHandler:^(NSError * _Nullable err) {
NSLog(@"write the default value to LT attribute: StartUpOnOff Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_OO_2_1_000010_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"reads back LT attribute: OnTime"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeOnTimeWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"reads back LT attribute: OnTime Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertEqual([actualValue unsignedShortValue], 0U);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_OO_2_1_000011_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"reads back LT attribute: OffWaitTime"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeOffWaitTimeWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"reads back LT attribute: OffWaitTime Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertEqual([actualValue unsignedShortValue], 0U);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_OO_2_1_000012_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"reads back LT attribute: StartUpOnOff"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeStartUpOnOffWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"reads back LT attribute: StartUpOnOff Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertEqual([actualValue unsignedCharValue], 0);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_OO_2_2_000000_WaitForCommissionee
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"];
dispatch_queue_t queue = dispatch_get_main_queue();
WaitForCommissionee(expectation, queue);
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_OO_2_2_000001_Off
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Send Off Command"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster offWithCompletionHandler:^(NSError * _Nullable err) {
NSLog(@"Send Off Command Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_OO_2_2_000002_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Check on/off attribute value is false after off command"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeOnOffWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"Check on/off attribute value is false after off command Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertEqual([actualValue boolValue], 0);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_OO_2_2_000003_On
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Send On Command"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster onWithCompletionHandler:^(NSError * _Nullable err) {
NSLog(@"Send On Command Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_OO_2_2_000004_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Check on/off attribute value is true after on command"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeOnOffWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"Check on/off attribute value is true after on command Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertEqual([actualValue boolValue], 1);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_OO_2_2_000005_Off
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Send Off Command"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster offWithCompletionHandler:^(NSError * _Nullable err) {
NSLog(@"Send Off Command Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_OO_2_2_000006_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Check on/off attribute value is false after off command"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeOnOffWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"Check on/off attribute value is false after off command Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertEqual([actualValue boolValue], 0);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_OO_2_2_000007_Toggle
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Send Toggle Command"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster toggleWithCompletionHandler:^(NSError * _Nullable err) {
NSLog(@"Send Toggle Command Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_OO_2_2_000008_ReadAttribute
{
XCTestExpectation * expectation =
[self expectationWithDescription:@"Check on/off attribute value is true after toggle command"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeOnOffWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"Check on/off attribute value is true after toggle command Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertEqual([actualValue boolValue], 1);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_OO_2_2_000009_Toggle
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Send Toggle Command"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster toggleWithCompletionHandler:^(NSError * _Nullable err) {
NSLog(@"Send Toggle Command Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_OO_2_2_000010_ReadAttribute
{
XCTestExpectation * expectation =
[self expectationWithDescription:@"Check on/off attribute value is false after toggle command"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeOnOffWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"Check on/off attribute value is false after toggle command Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertEqual([actualValue boolValue], 0);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_OO_2_2_000011_On
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Send On Command"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster onWithCompletionHandler:^(NSError * _Nullable err) {
NSLog(@"Send On Command Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_OO_2_2_000012_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Check on/off attribute value is true after on command"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeOnOffWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"Check on/off attribute value is true after on command Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertEqual([actualValue boolValue], 1);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_OO_2_2_000013_Off
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Send Off Command"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster offWithCompletionHandler:^(NSError * _Nullable err) {
NSLog(@"Send Off Command Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_OO_2_2_000014_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Check on/off attribute value is false after off command"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeOnOffWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"Check on/off attribute value is false after off command Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertEqual([actualValue boolValue], 0);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_OO_2_3_000000_WaitForCommissionee
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"];
dispatch_queue_t queue = dispatch_get_main_queue();
WaitForCommissionee(expectation, queue);
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_OO_2_3_000001_On
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Send On Command"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster onWithCompletionHandler:^(NSError * _Nullable err) {
NSLog(@"Send On Command Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_OO_2_3_000002_WaitForMs
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Wait 1000ms"];
dispatch_queue_t queue = dispatch_get_main_queue();
WaitForMs(expectation, queue, 1000);
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_OO_2_3_000003_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Reads OnOff attribute from DUT"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeOnOffWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"Reads OnOff attribute from DUT Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertEqual([actualValue boolValue], 1);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_OO_2_3_000004_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Reads GlobalSceneControl attribute from DUT"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeGlobalSceneControlWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"Reads GlobalSceneControl attribute from DUT Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertEqual([actualValue boolValue], 1);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_OO_2_3_000005_On
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Send On Command"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster onWithCompletionHandler:^(NSError * _Nullable err) {
NSLog(@"Send On Command Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_OO_2_3_000006_WaitForMs
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Wait 1000ms"];
dispatch_queue_t queue = dispatch_get_main_queue();
WaitForMs(expectation, queue, 1000);
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_OO_2_3_000007_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Reads OnOff attribute from DUT"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeOnOffWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"Reads OnOff attribute from DUT Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertEqual([actualValue boolValue], 1);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_OO_2_3_000008_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Reads GlobalSceneControl attribute from DUT"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeGlobalSceneControlWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"Reads GlobalSceneControl attribute from DUT Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertEqual([actualValue boolValue], 1);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_OO_2_3_000009_On
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Send On Command"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster onWithCompletionHandler:^(NSError * _Nullable err) {
NSLog(@"Send On Command Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_OO_2_3_000010_WaitForMs
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Wait 1000ms"];
dispatch_queue_t queue = dispatch_get_main_queue();
WaitForMs(expectation, queue, 1000);
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_OO_2_3_000011_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Reads OnOff attribute from DUT"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeOnOffWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"Reads OnOff attribute from DUT Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertEqual([actualValue boolValue], 1);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_OO_2_3_000012_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Reads GlobalSceneControl attribute from DUT"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeGlobalSceneControlWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"Reads GlobalSceneControl attribute from DUT Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertEqual([actualValue boolValue], 1);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_OO_2_3_000013_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Reads OnTime attribute from DUT"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeOnTimeWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"Reads OnTime attribute from DUT Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertEqual([actualValue unsignedShortValue], 0U);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_OO_2_3_000014_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Reads OffWaitTime attribute from DUT"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeOffWaitTimeWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"Reads OffWaitTime attribute from DUT Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertEqual([actualValue unsignedShortValue], 0U);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_OO_2_3_000015_On
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Send On Command"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster onWithCompletionHandler:^(NSError * _Nullable err) {
NSLog(@"Send On Command Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_OO_2_3_000016_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Reads OnOff attribute from DUT"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeOnOffWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"Reads OnOff attribute from DUT Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertEqual([actualValue boolValue], 1);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_OO_2_3_000017_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Reads OnTime attribute from DUT"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeOnTimeWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"Reads OnTime attribute from DUT Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertEqual([actualValue unsignedShortValue], 0U);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_OO_2_3_000018_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Reads OffWaitTime attribute from DUT"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeOffWaitTimeWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"Reads OffWaitTime attribute from DUT Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertEqual([actualValue unsignedShortValue], 0U);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_OO_2_3_000019_Off
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Send Off Command"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster offWithCompletionHandler:^(NSError * _Nullable err) {
NSLog(@"Send Off Command Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_OO_2_3_000020_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Reads OnOff attribute from DUT"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeOnOffWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"Reads OnOff attribute from DUT Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertEqual([actualValue boolValue], 0);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_OO_2_3_000021_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Reads OnTime attribute from DUT"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeOnTimeWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"Reads OnTime attribute from DUT Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertEqual([actualValue unsignedShortValue], 0U);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_OO_2_3_000022_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Reads OnOff attribute from DUT"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeOnOffWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"Reads OnOff attribute from DUT Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertEqual([actualValue boolValue], 0);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_OO_2_3_000023_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Reads OnTime attribute from DUT"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeOnTimeWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"Reads OnTime attribute from DUT Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertEqual([actualValue unsignedShortValue], 0U);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_OO_2_3_000024_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Reads OffWaitTime attribute from DUT"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeOffWaitTimeWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"Reads OffWaitTime attribute from DUT Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertEqual([actualValue unsignedShortValue], 0U);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_OO_2_3_000025_On
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Send On Command"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster onWithCompletionHandler:^(NSError * _Nullable err) {
NSLog(@"Send On Command Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_OO_2_3_000026_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Reads OnTime attribute from DUT"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeOnTimeWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"Reads OnTime attribute from DUT Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertEqual([actualValue unsignedShortValue], 0U);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_OO_2_3_000027_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Reads OffWaitTime attribute from DUT"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeOffWaitTimeWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"Reads OffWaitTime attribute from DUT Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertEqual([actualValue unsignedShortValue], 0U);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_OO_2_3_000028_Off
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Send Off Command"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster offWithCompletionHandler:^(NSError * _Nullable err) {
NSLog(@"Send Off Command Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_OO_2_3_000029_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Reads OnOff attribute from DUT"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeOnOffWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"Reads OnOff attribute from DUT Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertEqual([actualValue boolValue], 0);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_OO_2_3_000030_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Reads OnTime attribute from DUT"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeOnTimeWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"Reads OnTime attribute from DUT Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertEqual([actualValue unsignedShortValue], 0U);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_OO_2_3_000031_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Reads OnOff attribute from DUT"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeOnOffWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"Reads OnOff attribute from DUT Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertEqual([actualValue boolValue], 0);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_OO_2_3_000032_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Reads OnTime attribute from DUT"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeOnTimeWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"Reads OnTime attribute from DUT Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertEqual([actualValue unsignedShortValue], 0U);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_OO_2_3_000033_On
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Send On Command"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster onWithCompletionHandler:^(NSError * _Nullable err) {
NSLog(@"Send On Command Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_OO_2_3_000034_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Reads OnOff attribute from DUT"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeOnOffWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"Reads OnOff attribute from DUT Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertEqual([actualValue boolValue], 1);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_OO_2_3_000035_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Reads OnTime attribute from DUT"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeOnTimeWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"Reads OnTime attribute from DUT Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertEqual([actualValue unsignedShortValue], 0U);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_OO_2_3_000036_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Reads OffWaitTime attribute from DUT"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeOffWaitTimeWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"Reads OffWaitTime attribute from DUT Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertEqual([actualValue unsignedShortValue], 0U);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_OO_2_3_000037_Off
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Send Off Command"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster offWithCompletionHandler:^(NSError * _Nullable err) {
NSLog(@"Send Off Command Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_OO_2_3_000038_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Reads OnOff attribute from DUT"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeOnOffWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"Reads OnOff attribute from DUT Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertEqual([actualValue boolValue], 0);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_OO_2_3_000039_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Reads OnTime attribute from DUT"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeOnTimeWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"Reads OnTime attribute from DUT Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertEqual([actualValue unsignedShortValue], 0U);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_OO_2_3_000040_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Reads OnOff attribute from DUT"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeOnOffWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"Reads OnOff attribute from DUT Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertEqual([actualValue boolValue], 0);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_OO_2_3_000041_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Reads OnTime attribute from DUT"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeOnTimeWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"Reads OnTime attribute from DUT Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertEqual([actualValue unsignedShortValue], 0U);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_OO_2_3_000042_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Reads OffWaitTime attribute from DUT"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeOffWaitTimeWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"Reads OffWaitTime attribute from DUT Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertEqual([actualValue unsignedShortValue], 0U);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_OO_2_3_000043_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Reads OnOff attribute from DUT"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeOnOffWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"Reads OnOff attribute from DUT Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertEqual([actualValue boolValue], 0);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_OO_2_3_000044_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Reads OnTime attribute from DUT"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeOnTimeWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"Reads OnTime attribute from DUT Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertEqual([actualValue unsignedShortValue], 0U);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_OO_2_3_000045_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Reads OffWaitTime attribute from DUT"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeOffWaitTimeWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"Reads OffWaitTime attribute from DUT Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertEqual([actualValue unsignedShortValue], 0U);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_OO_2_3_000046_Off
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Send Off Command"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster offWithCompletionHandler:^(NSError * _Nullable err) {
NSLog(@"Send Off Command Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_PRS_1_1_000000_WaitForCommissionee
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"];
dispatch_queue_t queue = dispatch_get_main_queue();
WaitForCommissionee(expectation, queue);
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_PRS_1_1_000001_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Read the global attribute constraints: ClusterRevision"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestPressureMeasurement * cluster = [[CHIPTestPressureMeasurement alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeClusterRevisionWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"Read the global attribute constraints: ClusterRevision Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_PRS_1_1_000002_WriteAttribute
{
XCTestExpectation * expectation =
[self expectationWithDescription:@"Write the default values to mandatory global attribute: ClusterRevision"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestPressureMeasurement * cluster = [[CHIPTestPressureMeasurement alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
id clusterRevisionArgument;
clusterRevisionArgument = [NSNumber numberWithUnsignedShort:3U];
[cluster
writeAttributeClusterRevisionWithValue:clusterRevisionArgument
completionHandler:^(NSError * _Nullable err) {
NSLog(@"Write the default values to mandatory global attribute: ClusterRevision Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], EMBER_ZCL_STATUS_UNSUPPORTED_WRITE);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_PRS_2_1_000000_WaitForCommissionee
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"];
dispatch_queue_t queue = dispatch_get_main_queue();
WaitForCommissionee(expectation, queue);
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_PRS_2_1_000001_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Read the mandatory attribute constraints: MeasuredValue"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestPressureMeasurement * cluster = [[CHIPTestPressureMeasurement alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeMeasuredValueWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"Read the mandatory attribute constraints: MeasuredValue Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_PRS_2_1_000002_WriteAttribute
{
XCTestExpectation * expectation =
[self expectationWithDescription:@"Write the default values to mandatory attribute: MeasuredValue"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestPressureMeasurement * cluster = [[CHIPTestPressureMeasurement alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
id measuredValueArgument;
measuredValueArgument = [NSNumber numberWithShort:0];
[cluster
writeAttributeMeasuredValueWithValue:measuredValueArgument
completionHandler:^(NSError * _Nullable err) {
NSLog(@"Write the default values to mandatory attribute: MeasuredValue Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], EMBER_ZCL_STATUS_UNSUPPORTED_WRITE);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_PRS_2_1_000003_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Reads back mandatory attribute: MeasuredValue"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestPressureMeasurement * cluster = [[CHIPTestPressureMeasurement alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeMeasuredValueWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"Reads back mandatory attribute: MeasuredValue Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertEqual([actualValue shortValue], 0);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_PRS_2_1_000004_ReadAttribute
{
XCTestExpectation * expectation =
[self expectationWithDescription:@"Read the mandatory attribute constraints: MinMeasuredValue"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestPressureMeasurement * cluster = [[CHIPTestPressureMeasurement alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeMinMeasuredValueWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"Read the mandatory attribute constraints: MinMeasuredValue Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_PRS_2_1_000005_WriteAttribute
{
XCTestExpectation * expectation =
[self expectationWithDescription:@"Write the default values to mandatory attribute: MinMeasuredValue"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestPressureMeasurement * cluster = [[CHIPTestPressureMeasurement alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
id minMeasuredValueArgument;
minMeasuredValueArgument = [NSNumber numberWithShort:0];
[cluster
writeAttributeMinMeasuredValueWithValue:minMeasuredValueArgument
completionHandler:^(NSError * _Nullable err) {
NSLog(@"Write the default values to mandatory attribute: MinMeasuredValue Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], EMBER_ZCL_STATUS_UNSUPPORTED_WRITE);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_PRS_2_1_000006_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Reads back mandatory attribute: MinMeasuredValue"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestPressureMeasurement * cluster = [[CHIPTestPressureMeasurement alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeMinMeasuredValueWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"Reads back mandatory attribute: MinMeasuredValue Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertEqual([actualValue shortValue], 0);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_PRS_2_1_000007_ReadAttribute
{
XCTestExpectation * expectation =
[self expectationWithDescription:@"Read the mandatory attribute constraints: MaxMeasuredValue"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestPressureMeasurement * cluster = [[CHIPTestPressureMeasurement alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeMaxMeasuredValueWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"Read the mandatory attribute constraints: MaxMeasuredValue Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_PRS_2_1_000008_WriteAttribute
{
XCTestExpectation * expectation =
[self expectationWithDescription:@"Write the default values to mandatory attribute: MaxMeasuredValue"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestPressureMeasurement * cluster = [[CHIPTestPressureMeasurement alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
id maxMeasuredValueArgument;
maxMeasuredValueArgument = [NSNumber numberWithShort:0];
[cluster
writeAttributeMaxMeasuredValueWithValue:maxMeasuredValueArgument
completionHandler:^(NSError * _Nullable err) {
NSLog(@"Write the default values to mandatory attribute: MaxMeasuredValue Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], EMBER_ZCL_STATUS_UNSUPPORTED_WRITE);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_PRS_2_1_000009_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Reads back mandatory attribute: MaxMeasuredValue"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestPressureMeasurement * cluster = [[CHIPTestPressureMeasurement alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeMaxMeasuredValueWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"Reads back mandatory attribute: MaxMeasuredValue Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertEqual([actualValue shortValue], 0);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_PCC_1_1_000000_WaitForCommissionee
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"];
dispatch_queue_t queue = dispatch_get_main_queue();
WaitForCommissionee(expectation, queue);
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_PCC_1_1_000001_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Read the global attribute constraints: ClusterRevision"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestPumpConfigurationAndControl * cluster = [[CHIPTestPumpConfigurationAndControl alloc] initWithDevice:device
endpoint:1
queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeClusterRevisionWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"Read the global attribute constraints: ClusterRevision Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_PCC_1_1_000002_WriteAttribute
{
XCTestExpectation * expectation =
[self expectationWithDescription:@"write the default values to mandatory global attribute: ClusterRevision"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestPumpConfigurationAndControl * cluster = [[CHIPTestPumpConfigurationAndControl alloc] initWithDevice:device
endpoint:1
queue:queue];
XCTAssertNotNil(cluster);
id clusterRevisionArgument;
clusterRevisionArgument = [NSNumber numberWithUnsignedShort:3U];
[cluster
writeAttributeClusterRevisionWithValue:clusterRevisionArgument
completionHandler:^(NSError * _Nullable err) {
NSLog(@"write the default values to mandatory global attribute: ClusterRevision Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], EMBER_ZCL_STATUS_UNSUPPORTED_WRITE);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_PCC_1_1_000003_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"read the optional global attribute: FeatureMap"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestPumpConfigurationAndControl * cluster = [[CHIPTestPumpConfigurationAndControl alloc] initWithDevice:device
endpoint:1
queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeFeatureMapWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"read the optional global attribute: FeatureMap Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_PCC_2_1_000000_WaitForCommissionee
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"];
dispatch_queue_t queue = dispatch_get_main_queue();
WaitForCommissionee(expectation, queue);
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_PCC_2_1_000001_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"read the mandatory attribute: MaxPressure"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestPumpConfigurationAndControl * cluster = [[CHIPTestPumpConfigurationAndControl alloc] initWithDevice:device
endpoint:1
queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeMaxPressureWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"read the mandatory attribute: MaxPressure Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_PCC_2_1_000002_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"read the mandatory attribute: EffectiveOperationMode"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestPumpConfigurationAndControl * cluster = [[CHIPTestPumpConfigurationAndControl alloc] initWithDevice:device
endpoint:1
queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeEffectiveOperationModeWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"read the mandatory attribute: EffectiveOperationMode Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_PCC_2_1_000003_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"read the mandatory attribute: EffectiveControlMode"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestPumpConfigurationAndControl * cluster = [[CHIPTestPumpConfigurationAndControl alloc] initWithDevice:device
endpoint:1
queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeEffectiveControlModeWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"read the mandatory attribute: EffectiveControlMode Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_PCC_2_1_000004_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"read the mandatory attribute: Capacity"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestPumpConfigurationAndControl * cluster = [[CHIPTestPumpConfigurationAndControl alloc] initWithDevice:device
endpoint:1
queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeCapacityWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"read the mandatory attribute: Capacity Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_PCC_2_1_000005_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"read the mandatory attribute: MaxPressure"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestPumpConfigurationAndControl * cluster = [[CHIPTestPumpConfigurationAndControl alloc] initWithDevice:device
endpoint:1
queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeMaxPressureWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"read the mandatory attribute: MaxPressure Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_PCC_2_1_000006_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"read the mandatory attribute: EffectiveOperationMode"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestPumpConfigurationAndControl * cluster = [[CHIPTestPumpConfigurationAndControl alloc] initWithDevice:device
endpoint:1
queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeEffectiveOperationModeWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"read the mandatory attribute: EffectiveOperationMode Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_PCC_2_1_000007_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"read the mandatory attribute: EffectiveControlMode"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestPumpConfigurationAndControl * cluster = [[CHIPTestPumpConfigurationAndControl alloc] initWithDevice:device
endpoint:1
queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeEffectiveControlModeWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"read the mandatory attribute: EffectiveControlMode Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_PCC_2_1_000008_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"read the mandatory attribute: Capacity"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestPumpConfigurationAndControl * cluster = [[CHIPTestPumpConfigurationAndControl alloc] initWithDevice:device
endpoint:1
queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeCapacityWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"read the mandatory attribute: Capacity Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_PCC_2_2_000000_WaitForCommissionee
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"];
dispatch_queue_t queue = dispatch_get_main_queue();
WaitForCommissionee(expectation, queue);
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_PCC_2_2_000001_WriteAttribute
{
XCTestExpectation * expectation =
[self expectationWithDescription:@"Write 1 to the OperationMode attribute to DUT: OperationMode"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestPumpConfigurationAndControl * cluster = [[CHIPTestPumpConfigurationAndControl alloc] initWithDevice:device
endpoint:1
queue:queue];
XCTAssertNotNil(cluster);
id operationModeArgument;
operationModeArgument = [NSNumber numberWithUnsignedChar:1];
[cluster writeAttributeOperationModeWithValue:operationModeArgument
completionHandler:^(NSError * _Nullable err) {
NSLog(@"Write 1 to the OperationMode attribute to DUT: OperationMode Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_PCC_2_2_000002_WriteAttribute
{
XCTestExpectation * expectation =
[self expectationWithDescription:@"Write 2 to the OperationMode attribute to DUT: OperationMode"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestPumpConfigurationAndControl * cluster = [[CHIPTestPumpConfigurationAndControl alloc] initWithDevice:device
endpoint:1
queue:queue];
XCTAssertNotNil(cluster);
id operationModeArgument;
operationModeArgument = [NSNumber numberWithUnsignedChar:2];
[cluster writeAttributeOperationModeWithValue:operationModeArgument
completionHandler:^(NSError * _Nullable err) {
NSLog(@"Write 2 to the OperationMode attribute to DUT: OperationMode Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_PCC_2_2_000003_WriteAttribute
{
XCTestExpectation * expectation =
[self expectationWithDescription:@"Write 3 to the OperationMode attribute to DUT: OperationMode"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestPumpConfigurationAndControl * cluster = [[CHIPTestPumpConfigurationAndControl alloc] initWithDevice:device
endpoint:1
queue:queue];
XCTAssertNotNil(cluster);
id operationModeArgument;
operationModeArgument = [NSNumber numberWithUnsignedChar:3];
[cluster writeAttributeOperationModeWithValue:operationModeArgument
completionHandler:^(NSError * _Nullable err) {
NSLog(@"Write 3 to the OperationMode attribute to DUT: OperationMode Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_PCC_2_3_000000_WaitForCommissionee
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"];
dispatch_queue_t queue = dispatch_get_main_queue();
WaitForCommissionee(expectation, queue);
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_PCC_2_3_000001_WriteAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Write 0 to the OperationMode attribute to DUT"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestPumpConfigurationAndControl * cluster = [[CHIPTestPumpConfigurationAndControl alloc] initWithDevice:device
endpoint:1
queue:queue];
XCTAssertNotNil(cluster);
id operationModeArgument;
operationModeArgument = [NSNumber numberWithUnsignedChar:0];
[cluster writeAttributeOperationModeWithValue:operationModeArgument
completionHandler:^(NSError * _Nullable err) {
NSLog(@"Write 0 to the OperationMode attribute to DUT Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_PCC_2_3_000002_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Reads the attribute: EffectiveOperationMode"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestPumpConfigurationAndControl * cluster = [[CHIPTestPumpConfigurationAndControl alloc] initWithDevice:device
endpoint:1
queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeEffectiveOperationModeWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"Reads the attribute: EffectiveOperationMode Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertEqual([actualValue unsignedCharValue], 0);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_RH_1_1_000000_WaitForCommissionee
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"];
dispatch_queue_t queue = dispatch_get_main_queue();
WaitForCommissionee(expectation, queue);
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_RH_1_1_000001_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Read the global attribute constraints: ClusterRevision"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestRelativeHumidityMeasurement * cluster = [[CHIPTestRelativeHumidityMeasurement alloc] initWithDevice:device
endpoint:1
queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeClusterRevisionWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"Read the global attribute constraints: ClusterRevision Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_RH_1_1_000002_WriteAttribute
{
XCTestExpectation * expectation =
[self expectationWithDescription:@"write the default values to mandatory global attribute: ClusterRevision"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestRelativeHumidityMeasurement * cluster = [[CHIPTestRelativeHumidityMeasurement alloc] initWithDevice:device
endpoint:1
queue:queue];
XCTAssertNotNil(cluster);
id clusterRevisionArgument;
clusterRevisionArgument = [NSNumber numberWithUnsignedShort:1U];
[cluster
writeAttributeClusterRevisionWithValue:clusterRevisionArgument
completionHandler:^(NSError * _Nullable err) {
NSLog(@"write the default values to mandatory global attribute: ClusterRevision Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], EMBER_ZCL_STATUS_UNSUPPORTED_WRITE);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_RH_2_1_000000_WaitForCommissionee
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"];
dispatch_queue_t queue = dispatch_get_main_queue();
WaitForCommissionee(expectation, queue);
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_RH_2_1_000001_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Reads constraints of attribute: MeasuredValue"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestRelativeHumidityMeasurement * cluster = [[CHIPTestRelativeHumidityMeasurement alloc] initWithDevice:device
endpoint:1
queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeMeasuredValueWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"Reads constraints of attribute: MeasuredValue Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_RH_2_1_000002_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Reads constraints of attribute: MinMeasuredValue"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestRelativeHumidityMeasurement * cluster = [[CHIPTestRelativeHumidityMeasurement alloc] initWithDevice:device
endpoint:1
queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeMinMeasuredValueWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"Reads constraints of attribute: MinMeasuredValue Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertLessThanOrEqual([actualValue unsignedShortValue], 9999);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_RH_2_2_000000_WaitForCommissionee
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"];
dispatch_queue_t queue = dispatch_get_main_queue();
WaitForCommissionee(expectation, queue);
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_RH_2_2_000001_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Reads MeasuredValue attribute from DUT"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestRelativeHumidityMeasurement * cluster = [[CHIPTestRelativeHumidityMeasurement alloc] initWithDevice:device
endpoint:1
queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeMeasuredValueWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"Reads MeasuredValue attribute from DUT Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_RH_2_2_000002_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Read the mandatory attribute: MeasuredValue"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestRelativeHumidityMeasurement * cluster = [[CHIPTestRelativeHumidityMeasurement alloc] initWithDevice:device
endpoint:1
queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeMeasuredValueWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"Read the mandatory attribute: MeasuredValue Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_TM_1_1_000000_WaitForCommissionee
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"];
dispatch_queue_t queue = dispatch_get_main_queue();
WaitForCommissionee(expectation, queue);
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_TM_1_1_000001_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"read the global attribute: ClusterRevision"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestTemperatureMeasurement * cluster = [[CHIPTestTemperatureMeasurement alloc] initWithDevice:device
endpoint:1
queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeClusterRevisionWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"read the global attribute: ClusterRevision Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertEqual([actualValue unsignedShortValue], 3U);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_TM_1_1_000002_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Read the global attribute constraints: ClusterRevision"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestTemperatureMeasurement * cluster = [[CHIPTestTemperatureMeasurement alloc] initWithDevice:device
endpoint:1
queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeClusterRevisionWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"Read the global attribute constraints: ClusterRevision Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_TM_1_1_000003_WriteAttribute
{
XCTestExpectation * expectation =
[self expectationWithDescription:@"write the default values to mandatory global attribute: ClusterRevision"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestTemperatureMeasurement * cluster = [[CHIPTestTemperatureMeasurement alloc] initWithDevice:device
endpoint:1
queue:queue];
XCTAssertNotNil(cluster);
id clusterRevisionArgument;
clusterRevisionArgument = [NSNumber numberWithUnsignedShort:3U];
[cluster
writeAttributeClusterRevisionWithValue:clusterRevisionArgument
completionHandler:^(NSError * _Nullable err) {
NSLog(@"write the default values to mandatory global attribute: ClusterRevision Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], EMBER_ZCL_STATUS_UNSUPPORTED_WRITE);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_TM_1_1_000004_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"reads back global attribute: ClusterRevision"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestTemperatureMeasurement * cluster = [[CHIPTestTemperatureMeasurement alloc] initWithDevice:device
endpoint:1
queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeClusterRevisionWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"reads back global attribute: ClusterRevision Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertEqual([actualValue unsignedShortValue], 3U);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_TM_2_1_000000_WaitForCommissionee
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"];
dispatch_queue_t queue = dispatch_get_main_queue();
WaitForCommissionee(expectation, queue);
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_TM_2_1_000001_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"read the mandatory attribute: MeasuredValue"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestTemperatureMeasurement * cluster = [[CHIPTestTemperatureMeasurement alloc] initWithDevice:device
endpoint:1
queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeMeasuredValueWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"read the mandatory attribute: MeasuredValue Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_TM_2_2_000000_WaitForCommissionee
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"];
dispatch_queue_t queue = dispatch_get_main_queue();
WaitForCommissionee(expectation, queue);
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_TM_2_2_000001_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Reads MeasuredValue attribute from DUT"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestTemperatureMeasurement * cluster = [[CHIPTestTemperatureMeasurement alloc] initWithDevice:device
endpoint:1
queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeMeasuredValueWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"Reads MeasuredValue attribute from DUT Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_TM_2_2_000002_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Read the mandatory attribute: MeasuredValue"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestTemperatureMeasurement * cluster = [[CHIPTestTemperatureMeasurement alloc] initWithDevice:device
endpoint:1
queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeMeasuredValueWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"Read the mandatory attribute: MeasuredValue Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_TSTAT_1_1_000000_WaitForCommissionee
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"];
dispatch_queue_t queue = dispatch_get_main_queue();
WaitForCommissionee(expectation, queue);
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_TSTAT_1_1_000001_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Read the global attribute constraints: ClusterRevision"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestThermostat * cluster = [[CHIPTestThermostat alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeClusterRevisionWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"Read the global attribute constraints: ClusterRevision Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_TSTAT_1_1_000002_WriteAttribute
{
XCTestExpectation * expectation =
[self expectationWithDescription:@"write the default values to mandatory global attribute: ClusterRevision"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestThermostat * cluster = [[CHIPTestThermostat alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
id clusterRevisionArgument;
clusterRevisionArgument = [NSNumber numberWithUnsignedShort:5U];
[cluster
writeAttributeClusterRevisionWithValue:clusterRevisionArgument
completionHandler:^(NSError * _Nullable err) {
NSLog(@"write the default values to mandatory global attribute: ClusterRevision Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], EMBER_ZCL_STATUS_UNSUPPORTED_WRITE);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_TSTAT_1_1_000003_ReadAttribute
{
XCTestExpectation * expectation =
[self expectationWithDescription:@"Read the optional global attribute constraints: FeatureMap"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestThermostat * cluster = [[CHIPTestThermostat alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeFeatureMapWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"Read the optional global attribute constraints: FeatureMap Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_TSTAT_2_1_000000_WaitForCommissionee
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"];
dispatch_queue_t queue = dispatch_get_main_queue();
WaitForCommissionee(expectation, queue);
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_TSTAT_2_1_000001_ReadAttribute
{
XCTestExpectation * expectation =
[self expectationWithDescription:@"Reads constraints of mandatory attributes from DUT: LocalTemperature"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestThermostat * cluster = [[CHIPTestThermostat alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeLocalTemperatureWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"Reads constraints of mandatory attributes from DUT: LocalTemperature Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_TSTAT_2_1_000002_ReadAttribute
{
XCTestExpectation * expectation =
[self expectationWithDescription:@"Reads mandatory attributes from DUT: AbsMinHeatSetpointLimit"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestThermostat * cluster = [[CHIPTestThermostat alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeAbsMinHeatSetpointLimitWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"Reads mandatory attributes from DUT: AbsMinHeatSetpointLimit Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertEqual([actualValue shortValue], 700);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_TSTAT_2_1_000003_ReadAttribute
{
XCTestExpectation * expectation =
[self expectationWithDescription:@"Reads constraints of mandatory attributes from DUT: AbsMinHeatSetpointLimit"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestThermostat * cluster = [[CHIPTestThermostat alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeAbsMinHeatSetpointLimitWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"Reads constraints of mandatory attributes from DUT: AbsMinHeatSetpointLimit Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertGreaterThanOrEqual([actualValue shortValue], 700);
}
{
id actualValue = value;
XCTAssertLessThanOrEqual([actualValue shortValue], 3000);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_TSTAT_2_1_000004_WriteAttribute
{
XCTestExpectation * expectation = [self
expectationWithDescription:@"Writes the respective default value to mandatory attributes to DUT: AbsMinHeatSetpointLimit"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestThermostat * cluster = [[CHIPTestThermostat alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
id absMinHeatSetpointLimitArgument;
absMinHeatSetpointLimitArgument = [NSNumber numberWithShort:700];
[cluster writeAttributeAbsMinHeatSetpointLimitWithValue:absMinHeatSetpointLimitArgument
completionHandler:^(NSError * _Nullable err) {
NSLog(@"Writes the respective default value to mandatory attributes to DUT: "
@"AbsMinHeatSetpointLimit Error: %@",
err);
XCTAssertEqual(
[CHIPErrorTestUtils errorToZCLErrorCode:err], EMBER_ZCL_STATUS_UNSUPPORTED_WRITE);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_TSTAT_2_1_000005_ReadAttribute
{
XCTestExpectation * expectation =
[self expectationWithDescription:@"Read back mandatory attributes from DUT: AbsMinHeatSetpointLimit"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestThermostat * cluster = [[CHIPTestThermostat alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeAbsMinHeatSetpointLimitWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"Read back mandatory attributes from DUT: AbsMinHeatSetpointLimit Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertEqual([actualValue shortValue], 700);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_TSTAT_2_1_000006_ReadAttribute
{
XCTestExpectation * expectation =
[self expectationWithDescription:@"Reads mandatory attributes from DUT: AbsMaxHeatSetpointLimit"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestThermostat * cluster = [[CHIPTestThermostat alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeAbsMaxHeatSetpointLimitWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"Reads mandatory attributes from DUT: AbsMaxHeatSetpointLimit Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertEqual([actualValue shortValue], 3000);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_TSTAT_2_1_000007_ReadAttribute
{
XCTestExpectation * expectation =
[self expectationWithDescription:@"Reads constraints of mandatory attributes from DUT: AbsMaxHeatSetpointLimit"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestThermostat * cluster = [[CHIPTestThermostat alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeAbsMaxHeatSetpointLimitWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"Reads constraints of mandatory attributes from DUT: AbsMaxHeatSetpointLimit Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertGreaterThanOrEqual([actualValue shortValue], 700);
}
{
id actualValue = value;
XCTAssertLessThanOrEqual([actualValue shortValue], 3000);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_TSTAT_2_1_000008_WriteAttribute
{
XCTestExpectation * expectation = [self
expectationWithDescription:@"Writes the respective default value to mandatory attributes to DUT: AbsMaxHeatSetpointLimit"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestThermostat * cluster = [[CHIPTestThermostat alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
id absMaxHeatSetpointLimitArgument;
absMaxHeatSetpointLimitArgument = [NSNumber numberWithShort:3000];
[cluster writeAttributeAbsMaxHeatSetpointLimitWithValue:absMaxHeatSetpointLimitArgument
completionHandler:^(NSError * _Nullable err) {
NSLog(@"Writes the respective default value to mandatory attributes to DUT: "
@"AbsMaxHeatSetpointLimit Error: %@",
err);
XCTAssertEqual(
[CHIPErrorTestUtils errorToZCLErrorCode:err], EMBER_ZCL_STATUS_UNSUPPORTED_WRITE);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_TSTAT_2_1_000009_ReadAttribute
{
XCTestExpectation * expectation =
[self expectationWithDescription:@"Read back mandatory attributes from DUT: AbsMaxHeatSetpointLimit"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestThermostat * cluster = [[CHIPTestThermostat alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeAbsMaxHeatSetpointLimitWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"Read back mandatory attributes from DUT: AbsMaxHeatSetpointLimit Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertEqual([actualValue shortValue], 3000);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_TSTAT_2_1_000010_ReadAttribute
{
XCTestExpectation * expectation =
[self expectationWithDescription:@"Reads mandatory attributes from DUT: AbsMinCoolSetpointLimit"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestThermostat * cluster = [[CHIPTestThermostat alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeAbsMinCoolSetpointLimitWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"Reads mandatory attributes from DUT: AbsMinCoolSetpointLimit Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertEqual([actualValue shortValue], 1600);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_TSTAT_2_1_000011_ReadAttribute
{
XCTestExpectation * expectation =
[self expectationWithDescription:@"Reads constraints of mandatory attributes from DUT: AbsMinCoolSetpointLimit"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestThermostat * cluster = [[CHIPTestThermostat alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeAbsMinCoolSetpointLimitWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"Reads constraints of mandatory attributes from DUT: AbsMinCoolSetpointLimit Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertGreaterThanOrEqual([actualValue shortValue], 1600);
}
{
id actualValue = value;
XCTAssertLessThanOrEqual([actualValue shortValue], 3200);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_TSTAT_2_1_000012_WriteAttribute
{
XCTestExpectation * expectation = [self
expectationWithDescription:@"Writes the respective default value to mandatory attributes to DUT: AbsMinCoolSetpointLimit"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestThermostat * cluster = [[CHIPTestThermostat alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
id absMinCoolSetpointLimitArgument;
absMinCoolSetpointLimitArgument = [NSNumber numberWithShort:1600];
[cluster writeAttributeAbsMinCoolSetpointLimitWithValue:absMinCoolSetpointLimitArgument
completionHandler:^(NSError * _Nullable err) {
NSLog(@"Writes the respective default value to mandatory attributes to DUT: "
@"AbsMinCoolSetpointLimit Error: %@",
err);
XCTAssertEqual(
[CHIPErrorTestUtils errorToZCLErrorCode:err], EMBER_ZCL_STATUS_UNSUPPORTED_WRITE);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_TSTAT_2_1_000013_ReadAttribute
{
XCTestExpectation * expectation =
[self expectationWithDescription:@"Read back mandatory attributes from DUT: AbsMinCoolSetpointLimit"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestThermostat * cluster = [[CHIPTestThermostat alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeAbsMinCoolSetpointLimitWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"Read back mandatory attributes from DUT: AbsMinCoolSetpointLimit Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertEqual([actualValue shortValue], 1600);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_TSTAT_2_1_000014_ReadAttribute
{
XCTestExpectation * expectation =
[self expectationWithDescription:@"Reads mandatory attributes from DUT: AbsMaxCoolSetpointLimit"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestThermostat * cluster = [[CHIPTestThermostat alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeAbsMaxCoolSetpointLimitWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"Reads mandatory attributes from DUT: AbsMaxCoolSetpointLimit Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertEqual([actualValue shortValue], 3200);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_TSTAT_2_1_000015_ReadAttribute
{
XCTestExpectation * expectation =
[self expectationWithDescription:@"Reads constraints of mandatory attributes from DUT: AbsMaxCoolSetpointLimit"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestThermostat * cluster = [[CHIPTestThermostat alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeAbsMaxCoolSetpointLimitWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"Reads constraints of mandatory attributes from DUT: AbsMaxCoolSetpointLimit Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertGreaterThanOrEqual([actualValue shortValue], 1600);
}
{
id actualValue = value;
XCTAssertLessThanOrEqual([actualValue shortValue], 3200);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_TSTAT_2_1_000016_WriteAttribute
{
XCTestExpectation * expectation = [self
expectationWithDescription:@"Writes the respective default value to mandatory attributes to DUT: AbsMaxCoolSetpointLimit"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestThermostat * cluster = [[CHIPTestThermostat alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
id absMaxCoolSetpointLimitArgument;
absMaxCoolSetpointLimitArgument = [NSNumber numberWithShort:3200];
[cluster writeAttributeAbsMaxCoolSetpointLimitWithValue:absMaxCoolSetpointLimitArgument
completionHandler:^(NSError * _Nullable err) {
NSLog(@"Writes the respective default value to mandatory attributes to DUT: "
@"AbsMaxCoolSetpointLimit Error: %@",
err);
XCTAssertEqual(
[CHIPErrorTestUtils errorToZCLErrorCode:err], EMBER_ZCL_STATUS_UNSUPPORTED_WRITE);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_TSTAT_2_1_000017_ReadAttribute
{
XCTestExpectation * expectation =
[self expectationWithDescription:@"Read back mandatory attributes from DUT: AbsMaxCoolSetpointLimit"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestThermostat * cluster = [[CHIPTestThermostat alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeAbsMaxCoolSetpointLimitWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"Read back mandatory attributes from DUT: AbsMaxCoolSetpointLimit Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertEqual([actualValue shortValue], 3200);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_TSTAT_2_1_000018_ReadAttribute
{
XCTestExpectation * expectation =
[self expectationWithDescription:@"Reads mandatory attributes from DUT: OccupiedCoolingSetpoint"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestThermostat * cluster = [[CHIPTestThermostat alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeOccupiedCoolingSetpointWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"Reads mandatory attributes from DUT: OccupiedCoolingSetpoint Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertEqual([actualValue shortValue], 2600);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_TSTAT_2_1_000019_ReadAttribute
{
XCTestExpectation * expectation =
[self expectationWithDescription:@"Reads constraints of mandatory attributes from DUT: OccupiedCoolingSetpoint"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestThermostat * cluster = [[CHIPTestThermostat alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeOccupiedCoolingSetpointWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"Reads constraints of mandatory attributes from DUT: OccupiedCoolingSetpoint Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertGreaterThanOrEqual([actualValue shortValue], 1600);
}
{
id actualValue = value;
XCTAssertLessThanOrEqual([actualValue shortValue], 2600);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_TSTAT_2_1_000020_WriteAttribute
{
XCTestExpectation * expectation = [self
expectationWithDescription:@"Writes the respective default value to mandatory attributes to DUT: OccupiedCoolingSetpoint"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestThermostat * cluster = [[CHIPTestThermostat alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
id occupiedCoolingSetpointArgument;
occupiedCoolingSetpointArgument = [NSNumber numberWithShort:2600];
[cluster writeAttributeOccupiedCoolingSetpointWithValue:occupiedCoolingSetpointArgument
completionHandler:^(NSError * _Nullable err) {
NSLog(@"Writes the respective default value to mandatory attributes to DUT: "
@"OccupiedCoolingSetpoint Error: %@",
err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_TSTAT_2_1_000021_ReadAttribute
{
XCTestExpectation * expectation =
[self expectationWithDescription:@"Read back mandatory attributes from DUT: OccupiedCoolingSetpoint"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestThermostat * cluster = [[CHIPTestThermostat alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeOccupiedCoolingSetpointWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"Read back mandatory attributes from DUT: OccupiedCoolingSetpoint Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertEqual([actualValue shortValue], 2600);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_TSTAT_2_1_000022_ReadAttribute
{
XCTestExpectation * expectation =
[self expectationWithDescription:@"Reads mandatory attributes from DUT: OccupiedHeatingSetpoint"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestThermostat * cluster = [[CHIPTestThermostat alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeOccupiedHeatingSetpointWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"Reads mandatory attributes from DUT: OccupiedHeatingSetpoint Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertEqual([actualValue shortValue], 2000);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_TSTAT_2_1_000023_ReadAttribute
{
XCTestExpectation * expectation =
[self expectationWithDescription:@"Reads constraints of mandatory attributes from DUT: OccupiedHeatingSetpoint"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestThermostat * cluster = [[CHIPTestThermostat alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeOccupiedHeatingSetpointWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"Reads constraints of mandatory attributes from DUT: OccupiedHeatingSetpoint Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertGreaterThanOrEqual([actualValue shortValue], 700);
}
{
id actualValue = value;
XCTAssertLessThanOrEqual([actualValue shortValue], 2600);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_TSTAT_2_1_000024_WriteAttribute
{
XCTestExpectation * expectation = [self
expectationWithDescription:@"Writes the respective default value to mandatory attributes to DUT: OccupiedHeatingSetpoint"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestThermostat * cluster = [[CHIPTestThermostat alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
id occupiedHeatingSetpointArgument;
occupiedHeatingSetpointArgument = [NSNumber numberWithShort:2000];
[cluster writeAttributeOccupiedHeatingSetpointWithValue:occupiedHeatingSetpointArgument
completionHandler:^(NSError * _Nullable err) {
NSLog(@"Writes the respective default value to mandatory attributes to DUT: "
@"OccupiedHeatingSetpoint Error: %@",
err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_TSTAT_2_1_000025_ReadAttribute
{
XCTestExpectation * expectation =
[self expectationWithDescription:@"Read back mandatory attributes from DUT: OccupiedHeatingSetpoint"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestThermostat * cluster = [[CHIPTestThermostat alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeOccupiedHeatingSetpointWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"Read back mandatory attributes from DUT: OccupiedHeatingSetpoint Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertEqual([actualValue shortValue], 2000);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_TSTAT_2_1_000026_ReadAttribute
{
XCTestExpectation * expectation =
[self expectationWithDescription:@"Reads mandatory attributes from DUT: MinHeatSetpointLimit"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestThermostat * cluster = [[CHIPTestThermostat alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeMinHeatSetpointLimitWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"Reads mandatory attributes from DUT: MinHeatSetpointLimit Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertEqual([actualValue shortValue], 700);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_TSTAT_2_1_000027_ReadAttribute
{
XCTestExpectation * expectation =
[self expectationWithDescription:@"Reads constraints of mandatory attributes from DUT: MinHeatSetpointLimit"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestThermostat * cluster = [[CHIPTestThermostat alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeMinHeatSetpointLimitWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"Reads constraints of mandatory attributes from DUT: MinHeatSetpointLimit Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertGreaterThanOrEqual([actualValue shortValue], 700);
}
{
id actualValue = value;
XCTAssertLessThanOrEqual([actualValue shortValue], 3000);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_TSTAT_2_1_000028_WriteAttribute
{
XCTestExpectation * expectation = [self
expectationWithDescription:@"Writes the respective default value to mandatory attributes to DUT: MinHeatSetpointLimit"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestThermostat * cluster = [[CHIPTestThermostat alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
id minHeatSetpointLimitArgument;
minHeatSetpointLimitArgument = [NSNumber numberWithShort:700];
[cluster writeAttributeMinHeatSetpointLimitWithValue:minHeatSetpointLimitArgument
completionHandler:^(NSError * _Nullable err) {
NSLog(@"Writes the respective default value to mandatory attributes to DUT: "
@"MinHeatSetpointLimit Error: %@",
err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_TSTAT_2_1_000029_ReadAttribute
{
XCTestExpectation * expectation =
[self expectationWithDescription:@"Read back mandatory attributes from DUT: MinHeatSetpointLimit"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestThermostat * cluster = [[CHIPTestThermostat alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeMinHeatSetpointLimitWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"Read back mandatory attributes from DUT: MinHeatSetpointLimit Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertEqual([actualValue shortValue], 700);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_TSTAT_2_1_000030_ReadAttribute
{
XCTestExpectation * expectation =
[self expectationWithDescription:@"Reads mandatory attributes from DUT: MaxHeatSetpointLimit"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestThermostat * cluster = [[CHIPTestThermostat alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeMaxHeatSetpointLimitWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"Reads mandatory attributes from DUT: MaxHeatSetpointLimit Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertEqual([actualValue shortValue], 3000);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_TSTAT_2_1_000031_ReadAttribute
{
XCTestExpectation * expectation =
[self expectationWithDescription:@"Reads constraints of mandatory attributes from DUT: MaxHeatSetpointLimit"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestThermostat * cluster = [[CHIPTestThermostat alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeMaxHeatSetpointLimitWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"Reads constraints of mandatory attributes from DUT: MaxHeatSetpointLimit Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertGreaterThanOrEqual([actualValue shortValue], 700);
}
{
id actualValue = value;
XCTAssertLessThanOrEqual([actualValue shortValue], 3000);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_TSTAT_2_1_000032_WriteAttribute
{
XCTestExpectation * expectation = [self
expectationWithDescription:@"Writes the respective default value to mandatory attributes to DUT: MaxHeatSetpointLimit"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestThermostat * cluster = [[CHIPTestThermostat alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
id maxHeatSetpointLimitArgument;
maxHeatSetpointLimitArgument = [NSNumber numberWithShort:3000];
[cluster writeAttributeMaxHeatSetpointLimitWithValue:maxHeatSetpointLimitArgument
completionHandler:^(NSError * _Nullable err) {
NSLog(@"Writes the respective default value to mandatory attributes to DUT: "
@"MaxHeatSetpointLimit Error: %@",
err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_TSTAT_2_1_000033_ReadAttribute
{
XCTestExpectation * expectation =
[self expectationWithDescription:@"Read back mandatory attributes from DUT: MaxHeatSetpointLimit"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestThermostat * cluster = [[CHIPTestThermostat alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeMaxHeatSetpointLimitWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"Read back mandatory attributes from DUT: MaxHeatSetpointLimit Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertEqual([actualValue shortValue], 3000);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_TSTAT_2_1_000034_ReadAttribute
{
XCTestExpectation * expectation =
[self expectationWithDescription:@"Reads mandatory attributes from DUT: MinCoolSetpointLimit"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestThermostat * cluster = [[CHIPTestThermostat alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeMinCoolSetpointLimitWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"Reads mandatory attributes from DUT: MinCoolSetpointLimit Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertEqual([actualValue shortValue], 1600);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_TSTAT_2_1_000035_ReadAttribute
{
XCTestExpectation * expectation =
[self expectationWithDescription:@"Reads constraints of mandatory attributes from DUT: MinCoolSetpointLimit"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestThermostat * cluster = [[CHIPTestThermostat alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeMinCoolSetpointLimitWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"Reads constraints of mandatory attributes from DUT: MinCoolSetpointLimit Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertGreaterThanOrEqual([actualValue shortValue], 1600);
}
{
id actualValue = value;
XCTAssertLessThanOrEqual([actualValue shortValue], 3200);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_TSTAT_2_1_000036_WriteAttribute
{
XCTestExpectation * expectation = [self
expectationWithDescription:@"Writes the respective default value to mandatory attributes to DUT: MinCoolSetpointLimit"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestThermostat * cluster = [[CHIPTestThermostat alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
id minCoolSetpointLimitArgument;
minCoolSetpointLimitArgument = [NSNumber numberWithShort:1600];
[cluster writeAttributeMinCoolSetpointLimitWithValue:minCoolSetpointLimitArgument
completionHandler:^(NSError * _Nullable err) {
NSLog(@"Writes the respective default value to mandatory attributes to DUT: "
@"MinCoolSetpointLimit Error: %@",
err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_TSTAT_2_1_000037_ReadAttribute
{
XCTestExpectation * expectation =
[self expectationWithDescription:@"Read back mandatory attributes from DUT: MinCoolSetpointLimit"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestThermostat * cluster = [[CHIPTestThermostat alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeMinCoolSetpointLimitWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"Read back mandatory attributes from DUT: MinCoolSetpointLimit Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertEqual([actualValue shortValue], 1600);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_TSTAT_2_1_000038_ReadAttribute
{
XCTestExpectation * expectation =
[self expectationWithDescription:@"Reads mandatory attributes from DUT: MaxCoolSetpointLimit"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestThermostat * cluster = [[CHIPTestThermostat alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeMaxCoolSetpointLimitWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"Reads mandatory attributes from DUT: MaxCoolSetpointLimit Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertEqual([actualValue shortValue], 3200);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_TSTAT_2_1_000039_ReadAttribute
{
XCTestExpectation * expectation =
[self expectationWithDescription:@"Reads constraints of mandatory attributes from DUT: MaxCoolSetpointLimit"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestThermostat * cluster = [[CHIPTestThermostat alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeMaxCoolSetpointLimitWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"Reads constraints of mandatory attributes from DUT: MaxCoolSetpointLimit Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertGreaterThanOrEqual([actualValue shortValue], 1600);
}
{
id actualValue = value;
XCTAssertLessThanOrEqual([actualValue shortValue], 3200);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_TSTAT_2_1_000040_WriteAttribute
{
XCTestExpectation * expectation = [self
expectationWithDescription:@"Writes the respective default value to mandatory attributes to DUT: MaxCoolSetpointLimit"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestThermostat * cluster = [[CHIPTestThermostat alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
id maxCoolSetpointLimitArgument;
maxCoolSetpointLimitArgument = [NSNumber numberWithShort:3200];
[cluster writeAttributeMaxCoolSetpointLimitWithValue:maxCoolSetpointLimitArgument
completionHandler:^(NSError * _Nullable err) {
NSLog(@"Writes the respective default value to mandatory attributes to DUT: "
@"MaxCoolSetpointLimit Error: %@",
err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_TSTAT_2_1_000041_ReadAttribute
{
XCTestExpectation * expectation =
[self expectationWithDescription:@"Read back mandatory attributes from DUT: MaxCoolSetpointLimit"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestThermostat * cluster = [[CHIPTestThermostat alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeMaxCoolSetpointLimitWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"Read back mandatory attributes from DUT: MaxCoolSetpointLimit Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertEqual([actualValue shortValue], 3200);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_TSTAT_2_1_000042_ReadAttribute
{
XCTestExpectation * expectation =
[self expectationWithDescription:@"Reads mandatory attributes from DUT: ControlSequenceOfOperation"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestThermostat * cluster = [[CHIPTestThermostat alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeControlSequenceOfOperationWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"Reads mandatory attributes from DUT: ControlSequenceOfOperation Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertEqual([actualValue unsignedCharValue], 4);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_TSTAT_2_1_000043_ReadAttribute
{
XCTestExpectation * expectation =
[self expectationWithDescription:@"Reads constraints of mandatory attributes from DUT: ControlSequenceOfOperation"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestThermostat * cluster = [[CHIPTestThermostat alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeControlSequenceOfOperationWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"Reads constraints of mandatory attributes from DUT: ControlSequenceOfOperation Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertLessThanOrEqual([actualValue unsignedCharValue], 5);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_TSTAT_2_1_000044_WriteAttribute
{
XCTestExpectation * expectation =
[self expectationWithDescription:
@"Writes the respective default value to mandatory attributes to DUT: ControlSequenceOfOperation"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestThermostat * cluster = [[CHIPTestThermostat alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
id controlSequenceOfOperationArgument;
controlSequenceOfOperationArgument = [NSNumber numberWithUnsignedChar:4];
[cluster writeAttributeControlSequenceOfOperationWithValue:controlSequenceOfOperationArgument
completionHandler:^(NSError * _Nullable err) {
NSLog(@"Writes the respective default value to mandatory attributes to DUT: "
@"ControlSequenceOfOperation Error: %@",
err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_TSTAT_2_1_000045_ReadAttribute
{
XCTestExpectation * expectation =
[self expectationWithDescription:@"Read back mandatory attributes from DUT: ControlSequenceOfOperation"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestThermostat * cluster = [[CHIPTestThermostat alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeControlSequenceOfOperationWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"Read back mandatory attributes from DUT: ControlSequenceOfOperation Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertEqual([actualValue unsignedCharValue], 4);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_TSTAT_2_1_000046_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Reads mandatory attributes from DUT: SystemMode"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestThermostat * cluster = [[CHIPTestThermostat alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeSystemModeWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"Reads mandatory attributes from DUT: SystemMode Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertEqual([actualValue unsignedCharValue], 1);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_TSTAT_2_1_000047_ReadAttribute
{
XCTestExpectation * expectation =
[self expectationWithDescription:@"Reads constraints of mandatory attributes from DUT: SystemMode"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestThermostat * cluster = [[CHIPTestThermostat alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeSystemModeWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"Reads constraints of mandatory attributes from DUT: SystemMode Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertLessThanOrEqual([actualValue unsignedCharValue], 9);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_TSTAT_2_1_000048_WriteAttribute
{
XCTestExpectation * expectation =
[self expectationWithDescription:@"Writes the respective default value to mandatory attributes to DUT: SystemMode"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestThermostat * cluster = [[CHIPTestThermostat alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
id systemModeArgument;
systemModeArgument = [NSNumber numberWithUnsignedChar:1];
[cluster
writeAttributeSystemModeWithValue:systemModeArgument
completionHandler:^(NSError * _Nullable err) {
NSLog(@"Writes the respective default value to mandatory attributes to DUT: SystemMode Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_TSTAT_2_1_000049_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Read back mandatory attributes from DUT: SystemMode"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestThermostat * cluster = [[CHIPTestThermostat alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeSystemModeWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"Read back mandatory attributes from DUT: SystemMode Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertEqual([actualValue unsignedCharValue], 1);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_TSTAT_2_1_000050_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Reads optional attributes from DUT: MinSetpointDeadBand"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestThermostat * cluster = [[CHIPTestThermostat alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeMinSetpointDeadBandWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"Reads optional attributes from DUT: MinSetpointDeadBand Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertEqual([actualValue charValue], 25);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_TSTAT_2_1_000051_ReadAttribute
{
XCTestExpectation * expectation =
[self expectationWithDescription:@"Reads constraints of optional attributes from DUT: MinSetpointDeadBand"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestThermostat * cluster = [[CHIPTestThermostat alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeMinSetpointDeadBandWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"Reads constraints of optional attributes from DUT: MinSetpointDeadBand Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertLessThanOrEqual([actualValue charValue], 25);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_TSTAT_2_1_000052_WriteAttribute
{
XCTestExpectation * expectation =
[self expectationWithDescription:@"Writes the respective default value to optional attributes to DUT: MinSetpointDeadBand"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestThermostat * cluster = [[CHIPTestThermostat alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
id minSetpointDeadBandArgument;
minSetpointDeadBandArgument = [NSNumber numberWithChar:25];
[cluster writeAttributeMinSetpointDeadBandWithValue:minSetpointDeadBandArgument
completionHandler:^(NSError * _Nullable err) {
NSLog(@"Writes the respective default value to optional attributes to DUT: "
@"MinSetpointDeadBand Error: %@",
err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_TSTAT_2_1_000053_ReadAttribute
{
XCTestExpectation * expectation =
[self expectationWithDescription:@"Read back optional attributes from DUT: MinSetpointDeadBand"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestThermostat * cluster = [[CHIPTestThermostat alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeMinSetpointDeadBandWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"Read back optional attributes from DUT: MinSetpointDeadBand Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertEqual([actualValue charValue], 25);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_TSTAT_2_1_000054_ReadAttribute
{
XCTestExpectation * expectation =
[self expectationWithDescription:@"Reads constraints of optional attributes from DUT: StartOfWeek"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestThermostat * cluster = [[CHIPTestThermostat alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeStartOfWeekWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"Reads constraints of optional attributes from DUT: StartOfWeek Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertLessThanOrEqual([actualValue unsignedCharValue], 6);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_TSTAT_2_1_000055_WriteAttribute
{
XCTestExpectation * expectation =
[self expectationWithDescription:@"Writes the respective default value to optional attributes to DUT: StartOfWeek"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestThermostat * cluster = [[CHIPTestThermostat alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
id startOfWeekArgument;
startOfWeekArgument = [NSNumber numberWithUnsignedChar:0];
[cluster writeAttributeStartOfWeekWithValue:startOfWeekArgument
completionHandler:^(NSError * _Nullable err) {
NSLog(@"Writes the respective default value to optional attributes to DUT: StartOfWeek Error: %@",
err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], EMBER_ZCL_STATUS_UNSUPPORTED_WRITE);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_TSTAT_2_1_000056_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Read back optional attributes from DUT: StartOfWeek"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestThermostat * cluster = [[CHIPTestThermostat alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeStartOfWeekWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"Read back optional attributes from DUT: StartOfWeek Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertEqual([actualValue unsignedCharValue], 0);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_TSTAT_2_1_000057_ReadAttribute
{
XCTestExpectation * expectation =
[self expectationWithDescription:@"Reads constraints of optional attributes from DUT: NumberOfWeeklyTransitions"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestThermostat * cluster = [[CHIPTestThermostat alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeNumberOfWeeklyTransitionsWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"Reads constraints of optional attributes from DUT: NumberOfWeeklyTransitions Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_TSTAT_2_1_000058_WriteAttribute
{
XCTestExpectation * expectation = [self
expectationWithDescription:@"Writes the respective default value to optional attributes to DUT: NumberOfWeeklyTransitions"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestThermostat * cluster = [[CHIPTestThermostat alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
id numberOfWeeklyTransitionsArgument;
numberOfWeeklyTransitionsArgument = [NSNumber numberWithUnsignedChar:0];
[cluster writeAttributeNumberOfWeeklyTransitionsWithValue:numberOfWeeklyTransitionsArgument
completionHandler:^(NSError * _Nullable err) {
NSLog(@"Writes the respective default value to optional attributes to DUT: "
@"NumberOfWeeklyTransitions Error: %@",
err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err],
EMBER_ZCL_STATUS_UNSUPPORTED_WRITE);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_TSTAT_2_1_000059_ReadAttribute
{
XCTestExpectation * expectation =
[self expectationWithDescription:@"Reads constraints of optional attributes from DUT: NumberOfDailyTransitions"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestThermostat * cluster = [[CHIPTestThermostat alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeNumberOfDailyTransitionsWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"Reads constraints of optional attributes from DUT: NumberOfDailyTransitions Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_TSTAT_2_1_000060_WriteAttribute
{
XCTestExpectation * expectation = [self
expectationWithDescription:@"Writes the respective default value to optional attributes to DUT: NumberOfDailyTransitions"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestThermostat * cluster = [[CHIPTestThermostat alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
id numberOfDailyTransitionsArgument;
numberOfDailyTransitionsArgument = [NSNumber numberWithUnsignedChar:0];
[cluster writeAttributeNumberOfDailyTransitionsWithValue:numberOfDailyTransitionsArgument
completionHandler:^(NSError * _Nullable err) {
NSLog(@"Writes the respective default value to optional attributes to DUT: "
@"NumberOfDailyTransitions Error: %@",
err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err],
EMBER_ZCL_STATUS_UNSUPPORTED_WRITE);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_TSTAT_2_2_000000_WaitForCommissionee
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"];
dispatch_queue_t queue = dispatch_get_main_queue();
WaitForCommissionee(expectation, queue);
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_TSTAT_2_2_000001_ReadAttribute
{
XCTestExpectation * expectation =
[self expectationWithDescription:
@"Reads OccupiedCoolingSetpoint attribute from Server DUT and verifies that the value is within range"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestThermostat * cluster = [[CHIPTestThermostat alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeOccupiedCoolingSetpointWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(
@"Reads OccupiedCoolingSetpoint attribute from Server DUT and verifies that the value is within range Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertEqual([actualValue shortValue], 2600);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_TSTAT_2_2_000002_WriteAttribute
{
XCTestExpectation * expectation =
[self expectationWithDescription:@"Writes a value back that is different but valid for OccupiedCoolingSetpoint attribute"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestThermostat * cluster = [[CHIPTestThermostat alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
id occupiedCoolingSetpointArgument;
occupiedCoolingSetpointArgument = [NSNumber numberWithShort:2000];
[cluster writeAttributeOccupiedCoolingSetpointWithValue:occupiedCoolingSetpointArgument
completionHandler:^(NSError * _Nullable err) {
NSLog(@"Writes a value back that is different but valid for OccupiedCoolingSetpoint "
@"attribute Error: %@",
err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_TSTAT_2_2_000003_ReadAttribute
{
XCTestExpectation * expectation = [self
expectationWithDescription:@"Reads it back again to confirm the successful write of OccupiedCoolingSetpoint attribute"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestThermostat * cluster = [[CHIPTestThermostat alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeOccupiedCoolingSetpointWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"Reads it back again to confirm the successful write of OccupiedCoolingSetpoint attribute Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertEqual([actualValue shortValue], 2000);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_TSTAT_2_2_000004_WriteAttribute
{
XCTestExpectation * expectation =
[self expectationWithDescription:@"Writes the limit of MinCoolSetpointLimit to OccupiedCoolingSetpoint attribute"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestThermostat * cluster = [[CHIPTestThermostat alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
id occupiedCoolingSetpointArgument;
occupiedCoolingSetpointArgument = [NSNumber numberWithShort:1600];
[cluster writeAttributeOccupiedCoolingSetpointWithValue:occupiedCoolingSetpointArgument
completionHandler:^(NSError * _Nullable err) {
NSLog(@"Writes the limit of MinCoolSetpointLimit to OccupiedCoolingSetpoint "
@"attribute Error: %@",
err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_TSTAT_2_2_000005_WriteAttribute
{
XCTestExpectation * expectation =
[self expectationWithDescription:@"Writes the limit of MaxCoolSetpointLimit to OccupiedCoolingSetpoint attribute"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestThermostat * cluster = [[CHIPTestThermostat alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
id occupiedCoolingSetpointArgument;
occupiedCoolingSetpointArgument = [NSNumber numberWithShort:2600];
[cluster writeAttributeOccupiedCoolingSetpointWithValue:occupiedCoolingSetpointArgument
completionHandler:^(NSError * _Nullable err) {
NSLog(@"Writes the limit of MaxCoolSetpointLimit to OccupiedCoolingSetpoint "
@"attribute Error: %@",
err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_TSTAT_2_2_000006_ReadAttribute
{
XCTestExpectation * expectation =
[self expectationWithDescription:
@"Reads OccupiedHeatingSetpoint attribute from Server DUT and verifies that the value is within range"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestThermostat * cluster = [[CHIPTestThermostat alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeOccupiedHeatingSetpointWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(
@"Reads OccupiedHeatingSetpoint attribute from Server DUT and verifies that the value is within range Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertEqual([actualValue shortValue], 2000);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_TSTAT_2_2_000007_WriteAttribute
{
XCTestExpectation * expectation =
[self expectationWithDescription:@"Writes a value back that is different but valid for OccupiedHeatingSetpoint attribute"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestThermostat * cluster = [[CHIPTestThermostat alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
id occupiedHeatingSetpointArgument;
occupiedHeatingSetpointArgument = [NSNumber numberWithShort:2100];
[cluster writeAttributeOccupiedHeatingSetpointWithValue:occupiedHeatingSetpointArgument
completionHandler:^(NSError * _Nullable err) {
NSLog(@"Writes a value back that is different but valid for OccupiedHeatingSetpoint "
@"attribute Error: %@",
err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_TSTAT_2_2_000008_ReadAttribute
{
XCTestExpectation * expectation = [self
expectationWithDescription:@"Reads it back again to confirm the successful write of OccupiedHeatingSetpoint attribute"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestThermostat * cluster = [[CHIPTestThermostat alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeOccupiedHeatingSetpointWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"Reads it back again to confirm the successful write of OccupiedHeatingSetpoint attribute Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertEqual([actualValue shortValue], 2100);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_TSTAT_2_2_000009_WriteAttribute
{
XCTestExpectation * expectation =
[self expectationWithDescription:@"Writes the limit of MinHeatSetpointLimit to OccupiedHeatingSetpoint attribute"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestThermostat * cluster = [[CHIPTestThermostat alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
id occupiedHeatingSetpointArgument;
occupiedHeatingSetpointArgument = [NSNumber numberWithShort:700];
[cluster writeAttributeOccupiedHeatingSetpointWithValue:occupiedHeatingSetpointArgument
completionHandler:^(NSError * _Nullable err) {
NSLog(@"Writes the limit of MinHeatSetpointLimit to OccupiedHeatingSetpoint "
@"attribute Error: %@",
err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_TSTAT_2_2_000010_WriteAttribute
{
XCTestExpectation * expectation =
[self expectationWithDescription:@"Writes the limit of MaxHeatSetpointLimit to OccupiedHeatingSetpoint attribute"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestThermostat * cluster = [[CHIPTestThermostat alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
id occupiedHeatingSetpointArgument;
occupiedHeatingSetpointArgument = [NSNumber numberWithShort:3000];
[cluster writeAttributeOccupiedHeatingSetpointWithValue:occupiedHeatingSetpointArgument
completionHandler:^(NSError * _Nullable err) {
NSLog(@"Writes the limit of MaxHeatSetpointLimit to OccupiedHeatingSetpoint "
@"attribute Error: %@",
err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_TSTAT_2_2_000011_ReadAttribute
{
XCTestExpectation * expectation =
[self expectationWithDescription:
@"Reads MinHeatSetpointLimit attribute from Server DUT and verifies that the value is within range"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestThermostat * cluster = [[CHIPTestThermostat alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeMinHeatSetpointLimitWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"Reads MinHeatSetpointLimit attribute from Server DUT and verifies that the value is within range Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertEqual([actualValue shortValue], 700);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_TSTAT_2_2_000012_WriteAttribute
{
XCTestExpectation * expectation =
[self expectationWithDescription:@"Writes a value back that is different but valid for MinHeatSetpointLimit attribute"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestThermostat * cluster = [[CHIPTestThermostat alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
id minHeatSetpointLimitArgument;
minHeatSetpointLimitArgument = [NSNumber numberWithShort:2000];
[cluster writeAttributeMinHeatSetpointLimitWithValue:minHeatSetpointLimitArgument
completionHandler:^(NSError * _Nullable err) {
NSLog(@"Writes a value back that is different but valid for MinHeatSetpointLimit "
@"attribute Error: %@",
err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_TSTAT_2_2_000013_ReadAttribute
{
XCTestExpectation * expectation =
[self expectationWithDescription:@"Reads it back again to confirm the successful write of MinHeatSetpointLimit attribute"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestThermostat * cluster = [[CHIPTestThermostat alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeMinHeatSetpointLimitWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"Reads it back again to confirm the successful write of MinHeatSetpointLimit attribute Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertEqual([actualValue shortValue], 2000);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_TSTAT_2_2_000014_WriteAttribute
{
XCTestExpectation * expectation =
[self expectationWithDescription:@"Writes the limit of AbsMinHeatSetpointLimit to MinHeatSetpointLimit attribute"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestThermostat * cluster = [[CHIPTestThermostat alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
id minHeatSetpointLimitArgument;
minHeatSetpointLimitArgument = [NSNumber numberWithShort:700];
[cluster writeAttributeMinHeatSetpointLimitWithValue:minHeatSetpointLimitArgument
completionHandler:^(NSError * _Nullable err) {
NSLog(@"Writes the limit of AbsMinHeatSetpointLimit to MinHeatSetpointLimit attribute "
@"Error: %@",
err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_TSTAT_2_2_000015_WriteAttribute
{
XCTestExpectation * expectation =
[self expectationWithDescription:@"Writes the limit of AbsMaxHeatSetpointLimit to MinHeatSetpointLimit attribute"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestThermostat * cluster = [[CHIPTestThermostat alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
id minHeatSetpointLimitArgument;
minHeatSetpointLimitArgument = [NSNumber numberWithShort:3000];
[cluster writeAttributeMinHeatSetpointLimitWithValue:minHeatSetpointLimitArgument
completionHandler:^(NSError * _Nullable err) {
NSLog(@"Writes the limit of AbsMaxHeatSetpointLimit to MinHeatSetpointLimit attribute "
@"Error: %@",
err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_TSTAT_2_2_000016_ReadAttribute
{
XCTestExpectation * expectation =
[self expectationWithDescription:
@"Reads MaxHeatSetpointLimit attribute from Server DUT and verifies that the value is within range"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestThermostat * cluster = [[CHIPTestThermostat alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeMaxHeatSetpointLimitWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"Reads MaxHeatSetpointLimit attribute from Server DUT and verifies that the value is within range Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertEqual([actualValue shortValue], 3000);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_TSTAT_2_2_000017_WriteAttribute
{
XCTestExpectation * expectation =
[self expectationWithDescription:@"Writes a value back that is different but valid for MaxHeatSetpointLimit attribute"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestThermostat * cluster = [[CHIPTestThermostat alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
id maxHeatSetpointLimitArgument;
maxHeatSetpointLimitArgument = [NSNumber numberWithShort:2000];
[cluster writeAttributeMaxHeatSetpointLimitWithValue:maxHeatSetpointLimitArgument
completionHandler:^(NSError * _Nullable err) {
NSLog(@"Writes a value back that is different but valid for MaxHeatSetpointLimit "
@"attribute Error: %@",
err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_TSTAT_2_2_000018_ReadAttribute
{
XCTestExpectation * expectation =
[self expectationWithDescription:@"Reads it back again to confirm the successful write of MaxHeatSetpointLimit attribute"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestThermostat * cluster = [[CHIPTestThermostat alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeMaxHeatSetpointLimitWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"Reads it back again to confirm the successful write of MaxHeatSetpointLimit attribute Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertEqual([actualValue shortValue], 2000);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_TSTAT_2_2_000019_WriteAttribute
{
XCTestExpectation * expectation =
[self expectationWithDescription:@"Writes the limit of AbsMinHeatSetpointLimit to MaxHeatSetpointLimit attribute"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestThermostat * cluster = [[CHIPTestThermostat alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
id maxHeatSetpointLimitArgument;
maxHeatSetpointLimitArgument = [NSNumber numberWithShort:700];
[cluster writeAttributeMaxHeatSetpointLimitWithValue:maxHeatSetpointLimitArgument
completionHandler:^(NSError * _Nullable err) {
NSLog(@"Writes the limit of AbsMinHeatSetpointLimit to MaxHeatSetpointLimit attribute "
@"Error: %@",
err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_TSTAT_2_2_000020_WriteAttribute
{
XCTestExpectation * expectation =
[self expectationWithDescription:@"Writes the limit of AbsMaxHeatSetpointLimit to MaxHeatSetpointLimit attribute"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestThermostat * cluster = [[CHIPTestThermostat alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
id maxHeatSetpointLimitArgument;
maxHeatSetpointLimitArgument = [NSNumber numberWithShort:3000];
[cluster writeAttributeMaxHeatSetpointLimitWithValue:maxHeatSetpointLimitArgument
completionHandler:^(NSError * _Nullable err) {
NSLog(@"Writes the limit of AbsMaxHeatSetpointLimit to MaxHeatSetpointLimit attribute "
@"Error: %@",
err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_TSTAT_2_2_000021_ReadAttribute
{
XCTestExpectation * expectation =
[self expectationWithDescription:
@"Reads MinCoolSetpointLimit attribute from Server DUT and verifies that the value is within range"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestThermostat * cluster = [[CHIPTestThermostat alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeMinCoolSetpointLimitWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"Reads MinCoolSetpointLimit attribute from Server DUT and verifies that the value is within range Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertEqual([actualValue shortValue], 1600);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_TSTAT_2_2_000022_WriteAttribute
{
XCTestExpectation * expectation =
[self expectationWithDescription:@"Writes a value back that is different but valid for MinCoolSetpointLimit attribute"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestThermostat * cluster = [[CHIPTestThermostat alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
id minCoolSetpointLimitArgument;
minCoolSetpointLimitArgument = [NSNumber numberWithShort:2000];
[cluster writeAttributeMinCoolSetpointLimitWithValue:minCoolSetpointLimitArgument
completionHandler:^(NSError * _Nullable err) {
NSLog(@"Writes a value back that is different but valid for MinCoolSetpointLimit "
@"attribute Error: %@",
err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_TSTAT_2_2_000023_ReadAttribute
{
XCTestExpectation * expectation =
[self expectationWithDescription:@"Reads it back again to confirm the successful write of MinCoolSetpointLimit attribute"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestThermostat * cluster = [[CHIPTestThermostat alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeMinCoolSetpointLimitWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"Reads it back again to confirm the successful write of MinCoolSetpointLimit attribute Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertEqual([actualValue shortValue], 2000);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_TSTAT_2_2_000024_WriteAttribute
{
XCTestExpectation * expectation =
[self expectationWithDescription:@"Writes the limit of AbsMinCoolSetpointLimit to MinCoolSetpointLimit attribute"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestThermostat * cluster = [[CHIPTestThermostat alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
id minCoolSetpointLimitArgument;
minCoolSetpointLimitArgument = [NSNumber numberWithShort:1600];
[cluster writeAttributeMinCoolSetpointLimitWithValue:minCoolSetpointLimitArgument
completionHandler:^(NSError * _Nullable err) {
NSLog(@"Writes the limit of AbsMinCoolSetpointLimit to MinCoolSetpointLimit attribute "
@"Error: %@",
err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_TSTAT_2_2_000025_WriteAttribute
{
XCTestExpectation * expectation =
[self expectationWithDescription:@"Writes the limit of MaxCoolSetpointLimit to MinCoolSetpointLimit attribute"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestThermostat * cluster = [[CHIPTestThermostat alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
id minCoolSetpointLimitArgument;
minCoolSetpointLimitArgument = [NSNumber numberWithShort:3200];
[cluster
writeAttributeMinCoolSetpointLimitWithValue:minCoolSetpointLimitArgument
completionHandler:^(NSError * _Nullable err) {
NSLog(@"Writes the limit of MaxCoolSetpointLimit to MinCoolSetpointLimit attribute Error: %@",
err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_TSTAT_2_2_000026_ReadAttribute
{
XCTestExpectation * expectation =
[self expectationWithDescription:
@"Reads MaxCoolSetpointLimit attribute from Server DUT and verifies that the value is within range"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestThermostat * cluster = [[CHIPTestThermostat alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeMaxCoolSetpointLimitWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"Reads MaxCoolSetpointLimit attribute from Server DUT and verifies that the value is within range Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertEqual([actualValue shortValue], 3200);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_TSTAT_2_2_000027_WriteAttribute
{
XCTestExpectation * expectation =
[self expectationWithDescription:@"Writes a value back that is different but valid for MaxCoolSetpointLimit attribute"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestThermostat * cluster = [[CHIPTestThermostat alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
id maxCoolSetpointLimitArgument;
maxCoolSetpointLimitArgument = [NSNumber numberWithShort:2000];
[cluster writeAttributeMaxCoolSetpointLimitWithValue:maxCoolSetpointLimitArgument
completionHandler:^(NSError * _Nullable err) {
NSLog(@"Writes a value back that is different but valid for MaxCoolSetpointLimit "
@"attribute Error: %@",
err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_TSTAT_2_2_000028_ReadAttribute
{
XCTestExpectation * expectation =
[self expectationWithDescription:@"Reads it back again to confirm the successful write of MaxCoolSetpointLimit attribute"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestThermostat * cluster = [[CHIPTestThermostat alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeMaxCoolSetpointLimitWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"Reads it back again to confirm the successful write of MaxCoolSetpointLimit attribute Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertEqual([actualValue shortValue], 2000);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_TSTAT_2_2_000029_WriteAttribute
{
XCTestExpectation * expectation =
[self expectationWithDescription:@"Writes the limit of AbsMinCoolSetpointLimit to MaxCoolSetpointLimit attribute"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestThermostat * cluster = [[CHIPTestThermostat alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
id maxCoolSetpointLimitArgument;
maxCoolSetpointLimitArgument = [NSNumber numberWithShort:1600];
[cluster writeAttributeMaxCoolSetpointLimitWithValue:maxCoolSetpointLimitArgument
completionHandler:^(NSError * _Nullable err) {
NSLog(@"Writes the limit of AbsMinCoolSetpointLimit to MaxCoolSetpointLimit attribute "
@"Error: %@",
err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_TSTAT_2_2_000030_WriteAttribute
{
XCTestExpectation * expectation =
[self expectationWithDescription:@"Writes the limit of MaxCoolSetpointLimit to MaxCoolSetpointLimit attribute"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestThermostat * cluster = [[CHIPTestThermostat alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
id maxCoolSetpointLimitArgument;
maxCoolSetpointLimitArgument = [NSNumber numberWithShort:3200];
[cluster
writeAttributeMaxCoolSetpointLimitWithValue:maxCoolSetpointLimitArgument
completionHandler:^(NSError * _Nullable err) {
NSLog(@"Writes the limit of MaxCoolSetpointLimit to MaxCoolSetpointLimit attribute Error: %@",
err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_TSTAT_2_2_000031_WriteAttribute
{
XCTestExpectation * expectation =
[self expectationWithDescription:@"Writes (sets back) the limit of MinHeatSetpointLimit to MinHeatSetpointLimit attribute"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestThermostat * cluster = [[CHIPTestThermostat alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
id minHeatSetpointLimitArgument;
minHeatSetpointLimitArgument = [NSNumber numberWithShort:700];
[cluster writeAttributeMinHeatSetpointLimitWithValue:minHeatSetpointLimitArgument
completionHandler:^(NSError * _Nullable err) {
NSLog(@"Writes (sets back) the limit of MinHeatSetpointLimit to MinHeatSetpointLimit "
@"attribute Error: %@",
err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_TSTAT_2_2_000032_WriteAttribute
{
XCTestExpectation * expectation =
[self expectationWithDescription:@"Writes (sets back) the limit of MaxHeatSetpointLimit to MinHeatSetpointLimit attribute"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestThermostat * cluster = [[CHIPTestThermostat alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
id minHeatSetpointLimitArgument;
minHeatSetpointLimitArgument = [NSNumber numberWithShort:3000];
[cluster writeAttributeMinHeatSetpointLimitWithValue:minHeatSetpointLimitArgument
completionHandler:^(NSError * _Nullable err) {
NSLog(@"Writes (sets back) the limit of MaxHeatSetpointLimit to MinHeatSetpointLimit "
@"attribute Error: %@",
err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_TSTAT_2_2_000033_WriteAttribute
{
XCTestExpectation * expectation =
[self expectationWithDescription:@"Writes (sets back) the limit of MinHeatSetpointLimit to MaxHeatSetpointLimit attribute"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestThermostat * cluster = [[CHIPTestThermostat alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
id maxHeatSetpointLimitArgument;
maxHeatSetpointLimitArgument = [NSNumber numberWithShort:700];
[cluster writeAttributeMaxHeatSetpointLimitWithValue:maxHeatSetpointLimitArgument
completionHandler:^(NSError * _Nullable err) {
NSLog(@"Writes (sets back) the limit of MinHeatSetpointLimit to MaxHeatSetpointLimit "
@"attribute Error: %@",
err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_TSTAT_2_2_000034_WriteAttribute
{
XCTestExpectation * expectation =
[self expectationWithDescription:@"Writes (sets back) the limit of MaxHeatSetpointLimit to MaxHeatSetpointLimit attribute"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestThermostat * cluster = [[CHIPTestThermostat alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
id maxHeatSetpointLimitArgument;
maxHeatSetpointLimitArgument = [NSNumber numberWithShort:3000];
[cluster writeAttributeMaxHeatSetpointLimitWithValue:maxHeatSetpointLimitArgument
completionHandler:^(NSError * _Nullable err) {
NSLog(@"Writes (sets back) the limit of MaxHeatSetpointLimit to MaxHeatSetpointLimit "
@"attribute Error: %@",
err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_TSTAT_2_2_000035_WriteAttribute
{
XCTestExpectation * expectation =
[self expectationWithDescription:@"Writes (sets back) the limit of MinCoolSetpointLimit to MinCoolSetpointLimit attribute"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestThermostat * cluster = [[CHIPTestThermostat alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
id minCoolSetpointLimitArgument;
minCoolSetpointLimitArgument = [NSNumber numberWithShort:1600];
[cluster writeAttributeMinCoolSetpointLimitWithValue:minCoolSetpointLimitArgument
completionHandler:^(NSError * _Nullable err) {
NSLog(@"Writes (sets back) the limit of MinCoolSetpointLimit to MinCoolSetpointLimit "
@"attribute Error: %@",
err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_TSTAT_2_2_000036_WriteAttribute
{
XCTestExpectation * expectation =
[self expectationWithDescription:@"Writes (sets back) the limit of MaxCoolSetpointLimit to MinCoolSetpointLimit attribute"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestThermostat * cluster = [[CHIPTestThermostat alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
id minCoolSetpointLimitArgument;
minCoolSetpointLimitArgument = [NSNumber numberWithShort:3200];
[cluster writeAttributeMinCoolSetpointLimitWithValue:minCoolSetpointLimitArgument
completionHandler:^(NSError * _Nullable err) {
NSLog(@"Writes (sets back) the limit of MaxCoolSetpointLimit to MinCoolSetpointLimit "
@"attribute Error: %@",
err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_TSTAT_2_2_000037_WriteAttribute
{
XCTestExpectation * expectation =
[self expectationWithDescription:@"Writes (sets back) the limit of MinCoolSetpointLimit to MaxCoolSetpointLimit attribute"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestThermostat * cluster = [[CHIPTestThermostat alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
id maxCoolSetpointLimitArgument;
maxCoolSetpointLimitArgument = [NSNumber numberWithShort:1600];
[cluster writeAttributeMaxCoolSetpointLimitWithValue:maxCoolSetpointLimitArgument
completionHandler:^(NSError * _Nullable err) {
NSLog(@"Writes (sets back) the limit of MinCoolSetpointLimit to MaxCoolSetpointLimit "
@"attribute Error: %@",
err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_TSTAT_2_2_000038_WriteAttribute
{
XCTestExpectation * expectation =
[self expectationWithDescription:@"Writes (sets back) the limit of MaxCoolSetpointLimit to MaxCoolSetpointLimit attribute"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestThermostat * cluster = [[CHIPTestThermostat alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
id maxCoolSetpointLimitArgument;
maxCoolSetpointLimitArgument = [NSNumber numberWithShort:3200];
[cluster writeAttributeMaxCoolSetpointLimitWithValue:maxCoolSetpointLimitArgument
completionHandler:^(NSError * _Nullable err) {
NSLog(@"Writes (sets back) the limit of MaxCoolSetpointLimit to MaxCoolSetpointLimit "
@"attribute Error: %@",
err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_TSTAT_2_2_000039_ReadAttribute
{
XCTestExpectation * expectation =
[self expectationWithDescription:@"Reads ControlSequenceOfOperation from Server DUT and verifies that the value is valid"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestThermostat * cluster = [[CHIPTestThermostat alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeControlSequenceOfOperationWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"Reads ControlSequenceOfOperation from Server DUT and verifies that the value is valid Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertEqual([actualValue unsignedCharValue], 4);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_TSTAT_2_2_000040_WriteAttribute
{
XCTestExpectation * expectation =
[self expectationWithDescription:@"Write Attribute command for ControlSequenceOfOperation with a new valid value"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestThermostat * cluster = [[CHIPTestThermostat alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
id controlSequenceOfOperationArgument;
controlSequenceOfOperationArgument = [NSNumber numberWithUnsignedChar:2];
[cluster writeAttributeControlSequenceOfOperationWithValue:controlSequenceOfOperationArgument
completionHandler:^(NSError * _Nullable err) {
NSLog(@"Write Attribute command for ControlSequenceOfOperation with a new valid "
@"value Error: %@",
err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_TSTAT_2_2_000041_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Read it back again to confirm the successful write"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestThermostat * cluster = [[CHIPTestThermostat alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeControlSequenceOfOperationWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"Read it back again to confirm the successful write Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertEqual([actualValue unsignedCharValue], 2);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_TSTAT_2_2_000042_WriteAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Sets OccupiedHeatingSetpoint to default value"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestThermostat * cluster = [[CHIPTestThermostat alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
id occupiedHeatingSetpointArgument;
occupiedHeatingSetpointArgument = [NSNumber numberWithShort:2000];
[cluster writeAttributeOccupiedHeatingSetpointWithValue:occupiedHeatingSetpointArgument
completionHandler:^(NSError * _Nullable err) {
NSLog(@"Sets OccupiedHeatingSetpoint to default value Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_TSTAT_2_2_000043_WriteAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Sets OccupiedHeatingSetpoint to default value"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestThermostat * cluster = [[CHIPTestThermostat alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
id occupiedHeatingSetpointArgument;
occupiedHeatingSetpointArgument = [NSNumber numberWithShort:2000];
[cluster writeAttributeOccupiedHeatingSetpointWithValue:occupiedHeatingSetpointArgument
completionHandler:^(NSError * _Nullable err) {
NSLog(@"Sets OccupiedHeatingSetpoint to default value Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_TSTAT_2_2_000044_WriteAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Sets OccupiedCoolingSetpoint to default value"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestThermostat * cluster = [[CHIPTestThermostat alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
id occupiedCoolingSetpointArgument;
occupiedCoolingSetpointArgument = [NSNumber numberWithShort:2600];
[cluster writeAttributeOccupiedCoolingSetpointWithValue:occupiedCoolingSetpointArgument
completionHandler:^(NSError * _Nullable err) {
NSLog(@"Sets OccupiedCoolingSetpoint to default value Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_TSTAT_2_2_000045_WriteAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Sets OccupiedCoolingSetpoint to default value"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestThermostat * cluster = [[CHIPTestThermostat alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
id occupiedCoolingSetpointArgument;
occupiedCoolingSetpointArgument = [NSNumber numberWithShort:2600];
[cluster writeAttributeOccupiedCoolingSetpointWithValue:occupiedCoolingSetpointArgument
completionHandler:^(NSError * _Nullable err) {
NSLog(@"Sets OccupiedCoolingSetpoint to default value Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_TSTAT_2_2_000046_WriteAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Sets OccupiedCoolingSetpoint to default value"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestThermostat * cluster = [[CHIPTestThermostat alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
id occupiedCoolingSetpointArgument;
occupiedCoolingSetpointArgument = [NSNumber numberWithShort:2600];
[cluster writeAttributeOccupiedCoolingSetpointWithValue:occupiedCoolingSetpointArgument
completionHandler:^(NSError * _Nullable err) {
NSLog(@"Sets OccupiedCoolingSetpoint to default value Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_TSTAT_2_2_000047_WriteAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Sets OccupiedHeatingSetpoint to default value"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestThermostat * cluster = [[CHIPTestThermostat alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
id occupiedHeatingSetpointArgument;
occupiedHeatingSetpointArgument = [NSNumber numberWithShort:2000];
[cluster writeAttributeOccupiedHeatingSetpointWithValue:occupiedHeatingSetpointArgument
completionHandler:^(NSError * _Nullable err) {
NSLog(@"Sets OccupiedHeatingSetpoint to default value Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_TSTAT_2_2_000048_WriteAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Sets OccupiedCoolingSetpoint to default value"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestThermostat * cluster = [[CHIPTestThermostat alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
id occupiedCoolingSetpointArgument;
occupiedCoolingSetpointArgument = [NSNumber numberWithShort:2600];
[cluster writeAttributeOccupiedCoolingSetpointWithValue:occupiedCoolingSetpointArgument
completionHandler:^(NSError * _Nullable err) {
NSLog(@"Sets OccupiedCoolingSetpoint to default value Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_TSTAT_2_2_000049_WriteAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Sets OccupiedHeatingSetpoint to default value"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestThermostat * cluster = [[CHIPTestThermostat alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
id occupiedHeatingSetpointArgument;
occupiedHeatingSetpointArgument = [NSNumber numberWithShort:2000];
[cluster writeAttributeOccupiedHeatingSetpointWithValue:occupiedHeatingSetpointArgument
completionHandler:^(NSError * _Nullable err) {
NSLog(@"Sets OccupiedHeatingSetpoint to default value Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_TSUIC_1_1_000000_WaitForCommissionee
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"];
dispatch_queue_t queue = dispatch_get_main_queue();
WaitForCommissionee(expectation, queue);
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_TSUIC_1_1_000001_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Read the global attribute constraints: ClusterRevision"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestThermostatUserInterfaceConfiguration * cluster =
[[CHIPTestThermostatUserInterfaceConfiguration alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeClusterRevisionWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"Read the global attribute constraints: ClusterRevision Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_TSUIC_1_1_000002_WriteAttribute
{
XCTestExpectation * expectation =
[self expectationWithDescription:@"write the default values to mandatory global attribute: ClusterRevision"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestThermostatUserInterfaceConfiguration * cluster =
[[CHIPTestThermostatUserInterfaceConfiguration alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
id clusterRevisionArgument;
clusterRevisionArgument = [NSNumber numberWithUnsignedShort:2U];
[cluster
writeAttributeClusterRevisionWithValue:clusterRevisionArgument
completionHandler:^(NSError * _Nullable err) {
NSLog(@"write the default values to mandatory global attribute: ClusterRevision Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], EMBER_ZCL_STATUS_UNSUPPORTED_WRITE);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_TSUIC_2_1_000000_WaitForCommissionee
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"];
dispatch_queue_t queue = dispatch_get_main_queue();
WaitForCommissionee(expectation, queue);
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_TSUIC_2_1_000001_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"read the mandatory attribute: TemperatureDisplayMode"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestThermostatUserInterfaceConfiguration * cluster =
[[CHIPTestThermostatUserInterfaceConfiguration alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeTemperatureDisplayModeWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"read the mandatory attribute: TemperatureDisplayMode Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertEqual([actualValue unsignedCharValue], 0);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_TSUIC_2_1_000002_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"read the mandatory attribute: TemperatureDisplayMode"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestThermostatUserInterfaceConfiguration * cluster =
[[CHIPTestThermostatUserInterfaceConfiguration alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeTemperatureDisplayModeWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"read the mandatory attribute: TemperatureDisplayMode Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_TSUIC_2_1_000003_WriteAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"write to the mandatory attribute: TemperatureDisplayMode"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestThermostatUserInterfaceConfiguration * cluster =
[[CHIPTestThermostatUserInterfaceConfiguration alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
id temperatureDisplayModeArgument;
temperatureDisplayModeArgument = [NSNumber numberWithUnsignedChar:0];
[cluster writeAttributeTemperatureDisplayModeWithValue:temperatureDisplayModeArgument
completionHandler:^(NSError * _Nullable err) {
NSLog(@"write to the mandatory attribute: TemperatureDisplayMode Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_TSUIC_2_1_000004_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"read the mandatory attribute: TemperatureDisplayMode"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestThermostatUserInterfaceConfiguration * cluster =
[[CHIPTestThermostatUserInterfaceConfiguration alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeTemperatureDisplayModeWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"read the mandatory attribute: TemperatureDisplayMode Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertEqual([actualValue unsignedCharValue], 0);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_TSUIC_2_1_000005_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"read the mandatory attribute: TemperatureDisplayMode"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestThermostatUserInterfaceConfiguration * cluster =
[[CHIPTestThermostatUserInterfaceConfiguration alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeTemperatureDisplayModeWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"read the mandatory attribute: TemperatureDisplayMode Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_TSUIC_2_1_000006_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"read the mandatory attribute: KeypadLockout"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestThermostatUserInterfaceConfiguration * cluster =
[[CHIPTestThermostatUserInterfaceConfiguration alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeKeypadLockoutWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"read the mandatory attribute: KeypadLockout Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertEqual([actualValue unsignedCharValue], 0);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_TSUIC_2_1_000007_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"read the mandatory attribute: KeypadLockout"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestThermostatUserInterfaceConfiguration * cluster =
[[CHIPTestThermostatUserInterfaceConfiguration alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeKeypadLockoutWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"read the mandatory attribute: KeypadLockout Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_TSUIC_2_1_000008_WriteAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"write to the mandatory attribute: KeypadLockout"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestThermostatUserInterfaceConfiguration * cluster =
[[CHIPTestThermostatUserInterfaceConfiguration alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
id keypadLockoutArgument;
keypadLockoutArgument = [NSNumber numberWithUnsignedChar:0];
[cluster writeAttributeKeypadLockoutWithValue:keypadLockoutArgument
completionHandler:^(NSError * _Nullable err) {
NSLog(@"write to the mandatory attribute: KeypadLockout Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_TSUIC_2_1_000009_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"read the mandatory attribute: KeypadLockout"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestThermostatUserInterfaceConfiguration * cluster =
[[CHIPTestThermostatUserInterfaceConfiguration alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeKeypadLockoutWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"read the mandatory attribute: KeypadLockout Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertEqual([actualValue unsignedCharValue], 0);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_TSUIC_2_1_000010_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"read the mandatory attribute: KeypadLockout"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestThermostatUserInterfaceConfiguration * cluster =
[[CHIPTestThermostatUserInterfaceConfiguration alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeKeypadLockoutWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"read the mandatory attribute: KeypadLockout Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_TSUIC_2_1_000011_ReadAttribute
{
XCTestExpectation * expectation =
[self expectationWithDescription:@"read the optional attribute: ScheduleProgrammingVisibility"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestThermostatUserInterfaceConfiguration * cluster =
[[CHIPTestThermostatUserInterfaceConfiguration alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster
readAttributeScheduleProgrammingVisibilityWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"read the optional attribute: ScheduleProgrammingVisibility Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertEqual([actualValue unsignedCharValue], 0);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_TSUIC_2_1_000012_ReadAttribute
{
XCTestExpectation * expectation =
[self expectationWithDescription:@"read the optional attribute: ScheduleProgrammingVisibility"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestThermostatUserInterfaceConfiguration * cluster =
[[CHIPTestThermostatUserInterfaceConfiguration alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster
readAttributeScheduleProgrammingVisibilityWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"read the optional attribute: ScheduleProgrammingVisibility Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_TSUIC_2_1_000013_WriteAttribute
{
XCTestExpectation * expectation =
[self expectationWithDescription:@"write to the mandatory attribute: ScheduleProgrammingVisibility"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestThermostatUserInterfaceConfiguration * cluster =
[[CHIPTestThermostatUserInterfaceConfiguration alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
id scheduleProgrammingVisibilityArgument;
scheduleProgrammingVisibilityArgument = [NSNumber numberWithUnsignedChar:0];
[cluster
writeAttributeScheduleProgrammingVisibilityWithValue:scheduleProgrammingVisibilityArgument
completionHandler:^(NSError * _Nullable err) {
NSLog(@"write to the mandatory attribute: ScheduleProgrammingVisibility Error: %@",
err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_TSUIC_2_1_000014_ReadAttribute
{
XCTestExpectation * expectation =
[self expectationWithDescription:@"read the optional attribute: ScheduleProgrammingVisibility"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestThermostatUserInterfaceConfiguration * cluster =
[[CHIPTestThermostatUserInterfaceConfiguration alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster
readAttributeScheduleProgrammingVisibilityWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"read the optional attribute: ScheduleProgrammingVisibility Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertEqual([actualValue unsignedCharValue], 0);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_TSUIC_2_1_000015_ReadAttribute
{
XCTestExpectation * expectation =
[self expectationWithDescription:@"read the optional attribute: ScheduleProgrammingVisibility"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestThermostatUserInterfaceConfiguration * cluster =
[[CHIPTestThermostatUserInterfaceConfiguration alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster
readAttributeScheduleProgrammingVisibilityWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"read the optional attribute: ScheduleProgrammingVisibility Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_TSUIC_2_2_000000_WaitForCommissionee
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"];
dispatch_queue_t queue = dispatch_get_main_queue();
WaitForCommissionee(expectation, queue);
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_TSUIC_2_2_000001_WriteAttribute
{
XCTestExpectation * expectation =
[self expectationWithDescription:@"Writes a value of 0 to TemperatureDisplayMode attribute of DUT"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestThermostatUserInterfaceConfiguration * cluster =
[[CHIPTestThermostatUserInterfaceConfiguration alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
id temperatureDisplayModeArgument;
temperatureDisplayModeArgument = [NSNumber numberWithUnsignedChar:0];
[cluster
writeAttributeTemperatureDisplayModeWithValue:temperatureDisplayModeArgument
completionHandler:^(NSError * _Nullable err) {
NSLog(@"Writes a value of 0 to TemperatureDisplayMode attribute of DUT Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_TSUIC_2_2_000002_WriteAttribute
{
XCTestExpectation * expectation =
[self expectationWithDescription:@"Writes a value of 1 to TemperatureDisplayMode attribute of DUT"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestThermostatUserInterfaceConfiguration * cluster =
[[CHIPTestThermostatUserInterfaceConfiguration alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
id temperatureDisplayModeArgument;
temperatureDisplayModeArgument = [NSNumber numberWithUnsignedChar:1];
[cluster
writeAttributeTemperatureDisplayModeWithValue:temperatureDisplayModeArgument
completionHandler:^(NSError * _Nullable err) {
NSLog(@"Writes a value of 1 to TemperatureDisplayMode attribute of DUT Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_TSUIC_2_2_000003_WriteAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Writes a value of 0 to KeypadLockout attribute of DUT"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestThermostatUserInterfaceConfiguration * cluster =
[[CHIPTestThermostatUserInterfaceConfiguration alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
id keypadLockoutArgument;
keypadLockoutArgument = [NSNumber numberWithUnsignedChar:0];
[cluster writeAttributeKeypadLockoutWithValue:keypadLockoutArgument
completionHandler:^(NSError * _Nullable err) {
NSLog(@"Writes a value of 0 to KeypadLockout attribute of DUT Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_TSUIC_2_2_000004_WriteAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Writes a value of 1 to KeypadLockout attribute of DUT"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestThermostatUserInterfaceConfiguration * cluster =
[[CHIPTestThermostatUserInterfaceConfiguration alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
id keypadLockoutArgument;
keypadLockoutArgument = [NSNumber numberWithUnsignedChar:1];
[cluster writeAttributeKeypadLockoutWithValue:keypadLockoutArgument
completionHandler:^(NSError * _Nullable err) {
NSLog(@"Writes a value of 1 to KeypadLockout attribute of DUT Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_TSUIC_2_2_000005_WriteAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Writes a value of 2 to KeypadLockout attribute of DUT"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestThermostatUserInterfaceConfiguration * cluster =
[[CHIPTestThermostatUserInterfaceConfiguration alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
id keypadLockoutArgument;
keypadLockoutArgument = [NSNumber numberWithUnsignedChar:2];
[cluster writeAttributeKeypadLockoutWithValue:keypadLockoutArgument
completionHandler:^(NSError * _Nullable err) {
NSLog(@"Writes a value of 2 to KeypadLockout attribute of DUT Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_TSUIC_2_2_000006_WriteAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Writes a value of 3 to KeypadLockout attribute of DUT"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestThermostatUserInterfaceConfiguration * cluster =
[[CHIPTestThermostatUserInterfaceConfiguration alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
id keypadLockoutArgument;
keypadLockoutArgument = [NSNumber numberWithUnsignedChar:3];
[cluster writeAttributeKeypadLockoutWithValue:keypadLockoutArgument
completionHandler:^(NSError * _Nullable err) {
NSLog(@"Writes a value of 3 to KeypadLockout attribute of DUT Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_TSUIC_2_2_000007_WriteAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Writes a value of 4 to KeypadLockout attribute of DUT"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestThermostatUserInterfaceConfiguration * cluster =
[[CHIPTestThermostatUserInterfaceConfiguration alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
id keypadLockoutArgument;
keypadLockoutArgument = [NSNumber numberWithUnsignedChar:4];
[cluster writeAttributeKeypadLockoutWithValue:keypadLockoutArgument
completionHandler:^(NSError * _Nullable err) {
NSLog(@"Writes a value of 4 to KeypadLockout attribute of DUT Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_TSUIC_2_2_000008_WriteAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Writes a value of 5 to KeypadLockout attribute of DUT"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestThermostatUserInterfaceConfiguration * cluster =
[[CHIPTestThermostatUserInterfaceConfiguration alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
id keypadLockoutArgument;
keypadLockoutArgument = [NSNumber numberWithUnsignedChar:5];
[cluster writeAttributeKeypadLockoutWithValue:keypadLockoutArgument
completionHandler:^(NSError * _Nullable err) {
NSLog(@"Writes a value of 5 to KeypadLockout attribute of DUT Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_TSUIC_2_2_000009_WriteAttribute
{
XCTestExpectation * expectation =
[self expectationWithDescription:@"Writes a value of 0 to ScheduleProgrammingVisibility attribute of DUT"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestThermostatUserInterfaceConfiguration * cluster =
[[CHIPTestThermostatUserInterfaceConfiguration alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
id scheduleProgrammingVisibilityArgument;
scheduleProgrammingVisibilityArgument = [NSNumber numberWithUnsignedChar:0];
[cluster writeAttributeScheduleProgrammingVisibilityWithValue:scheduleProgrammingVisibilityArgument
completionHandler:^(NSError * _Nullable err) {
NSLog(@"Writes a value of 0 to ScheduleProgrammingVisibility attribute of DUT "
@"Error: %@",
err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_TSUIC_2_2_000010_WriteAttribute
{
XCTestExpectation * expectation =
[self expectationWithDescription:@"Writes a value of 1 to ScheduleProgrammingVisibility attribute of DUT"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestThermostatUserInterfaceConfiguration * cluster =
[[CHIPTestThermostatUserInterfaceConfiguration alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
id scheduleProgrammingVisibilityArgument;
scheduleProgrammingVisibilityArgument = [NSNumber numberWithUnsignedChar:1];
[cluster writeAttributeScheduleProgrammingVisibilityWithValue:scheduleProgrammingVisibilityArgument
completionHandler:^(NSError * _Nullable err) {
NSLog(@"Writes a value of 1 to ScheduleProgrammingVisibility attribute of DUT "
@"Error: %@",
err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_DIAGTH_1_1_000000_WaitForCommissionee
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"];
dispatch_queue_t queue = dispatch_get_main_queue();
WaitForCommissionee(expectation, queue);
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_DIAGTH_1_1_000001_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"read the global attribute: ClusterRevision"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestThreadNetworkDiagnostics * cluster = [[CHIPTestThreadNetworkDiagnostics alloc] initWithDevice:device
endpoint:0
queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeClusterRevisionWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"read the global attribute: ClusterRevision Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertEqual([actualValue unsignedShortValue], 1U);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_DIAGTH_1_1_000002_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Read the global attribute constraints: ClusterRevision"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestThreadNetworkDiagnostics * cluster = [[CHIPTestThreadNetworkDiagnostics alloc] initWithDevice:device
endpoint:0
queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeClusterRevisionWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"Read the global attribute constraints: ClusterRevision Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_DIAGTH_1_1_000003_WriteAttribute
{
XCTestExpectation * expectation =
[self expectationWithDescription:@"write the default values to mandatory global attribute: ClusterRevision"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestThreadNetworkDiagnostics * cluster = [[CHIPTestThreadNetworkDiagnostics alloc] initWithDevice:device
endpoint:0
queue:queue];
XCTAssertNotNil(cluster);
id clusterRevisionArgument;
clusterRevisionArgument = [NSNumber numberWithUnsignedShort:1U];
[cluster
writeAttributeClusterRevisionWithValue:clusterRevisionArgument
completionHandler:^(NSError * _Nullable err) {
NSLog(@"write the default values to mandatory global attribute: ClusterRevision Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], EMBER_ZCL_STATUS_UNSUPPORTED_WRITE);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_DIAGTH_1_1_000004_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"reads back global attribute: ClusterRevision"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestThreadNetworkDiagnostics * cluster = [[CHIPTestThreadNetworkDiagnostics alloc] initWithDevice:device
endpoint:0
queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeClusterRevisionWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"reads back global attribute: ClusterRevision Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertEqual([actualValue unsignedShortValue], 1U);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_WNCV_1_1_000000_WaitForCommissionee
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"];
dispatch_queue_t queue = dispatch_get_main_queue();
WaitForCommissionee(expectation, queue);
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_WNCV_1_1_000001_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"2: read the global attribute: ClusterRevision"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestWindowCovering * cluster = [[CHIPTestWindowCovering alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeClusterRevisionWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"2: read the global attribute: ClusterRevision Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertGreaterThanOrEqual([actualValue unsignedShortValue], 5);
}
{
id actualValue = value;
XCTAssertLessThanOrEqual([actualValue unsignedShortValue], 200);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_WNCV_1_1_000002_WriteAttribute
{
XCTestExpectation * expectation =
[self expectationWithDescription:@"3a: write a value into the RO mandatory global attribute: ClusterRevision"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestWindowCovering * cluster = [[CHIPTestWindowCovering alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
id clusterRevisionArgument;
clusterRevisionArgument = [NSNumber numberWithUnsignedShort:201U];
[cluster
writeAttributeClusterRevisionWithValue:clusterRevisionArgument
completionHandler:^(NSError * _Nullable err) {
NSLog(@"3a: write a value into the RO mandatory global attribute: ClusterRevision Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], EMBER_ZCL_STATUS_UNSUPPORTED_WRITE);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_WNCV_1_1_000003_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"3b: reads back global attribute: ClusterRevision"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestWindowCovering * cluster = [[CHIPTestWindowCovering alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeClusterRevisionWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"3b: reads back global attribute: ClusterRevision Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertNotEqual([actualValue unsignedShortValue], 201);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_WNCV_1_1_000004_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"2: read the global attribute: FeatureMap"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestWindowCovering * cluster = [[CHIPTestWindowCovering alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeFeatureMapWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"2: read the global attribute: FeatureMap Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertLessThanOrEqual([actualValue unsignedIntValue], 32768);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_WNCV_1_1_000005_WriteAttribute
{
XCTestExpectation * expectation =
[self expectationWithDescription:@"3a: write the default value to optional global attribute: FeatureMap"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestWindowCovering * cluster = [[CHIPTestWindowCovering alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
id featureMapArgument;
featureMapArgument = [NSNumber numberWithUnsignedInt:32769UL];
[cluster writeAttributeFeatureMapWithValue:featureMapArgument
completionHandler:^(NSError * _Nullable err) {
NSLog(@"3a: write the default value to optional global attribute: FeatureMap Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], EMBER_ZCL_STATUS_UNSUPPORTED_WRITE);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_WNCV_1_1_000006_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"3b: reads back global attribute: FeatureMap"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestWindowCovering * cluster = [[CHIPTestWindowCovering alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeFeatureMapWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"3b: reads back global attribute: FeatureMap Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertNotEqual([actualValue unsignedIntValue], 32769);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_WNCV_2_1_000000_WaitForCommissionee
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"];
dispatch_queue_t queue = dispatch_get_main_queue();
WaitForCommissionee(expectation, queue);
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_WNCV_2_1_000001_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"2: read the RO mandatory attribute default: Type"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestWindowCovering * cluster = [[CHIPTestWindowCovering alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeTypeWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"2: read the RO mandatory attribute default: Type Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertLessThanOrEqual([actualValue unsignedCharValue], 9);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_WNCV_2_1_000002_WriteAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"3a: write a value into the RO mandatory attribute: Type"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestWindowCovering * cluster = [[CHIPTestWindowCovering alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
id typeArgument;
typeArgument = [NSNumber numberWithUnsignedChar:250];
[cluster writeAttributeTypeWithValue:typeArgument
completionHandler:^(NSError * _Nullable err) {
NSLog(@"3a: write a value into the RO mandatory attribute: Type Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], EMBER_ZCL_STATUS_UNSUPPORTED_WRITE);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_WNCV_2_1_000003_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"3b: reads back the RO mandatory attribute: Type"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestWindowCovering * cluster = [[CHIPTestWindowCovering alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeTypeWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"3b: reads back the RO mandatory attribute: Type Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertNotEqual([actualValue unsignedCharValue], 250);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_WNCV_2_1_000004_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"2: read the RO mandatory attribute default: ConfigStatus"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestWindowCovering * cluster = [[CHIPTestWindowCovering alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeConfigStatusWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"2: read the RO mandatory attribute default: ConfigStatus Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertLessThanOrEqual([actualValue unsignedCharValue], 63);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_WNCV_2_1_000005_WriteAttribute
{
XCTestExpectation * expectation =
[self expectationWithDescription:@"3a: write a value into the RO mandatory attribute: ConfigStatus"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestWindowCovering * cluster = [[CHIPTestWindowCovering alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
id configStatusArgument;
configStatusArgument = [NSNumber numberWithUnsignedChar:128];
[cluster writeAttributeConfigStatusWithValue:configStatusArgument
completionHandler:^(NSError * _Nullable err) {
NSLog(@"3a: write a value into the RO mandatory attribute: ConfigStatus Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], EMBER_ZCL_STATUS_UNSUPPORTED_WRITE);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_WNCV_2_1_000006_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"3b: reads back the RO mandatory attribute: ConfigStatus"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestWindowCovering * cluster = [[CHIPTestWindowCovering alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeConfigStatusWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"3b: reads back the RO mandatory attribute: ConfigStatus Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertNotEqual([actualValue unsignedCharValue], 128);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_WNCV_2_1_000007_ReadAttribute
{
XCTestExpectation * expectation =
[self expectationWithDescription:@"2: read the RO mandatory attribute default: OperationalStatus"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestWindowCovering * cluster = [[CHIPTestWindowCovering alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeOperationalStatusWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"2: read the RO mandatory attribute default: OperationalStatus Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertLessThanOrEqual([actualValue unsignedCharValue], 63);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_WNCV_2_1_000008_WriteAttribute
{
XCTestExpectation * expectation =
[self expectationWithDescription:@"3a: write a value into the RO mandatory attribute: OperationalStatus"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestWindowCovering * cluster = [[CHIPTestWindowCovering alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
id operationalStatusArgument;
operationalStatusArgument = [NSNumber numberWithUnsignedChar:128];
[cluster
writeAttributeOperationalStatusWithValue:operationalStatusArgument
completionHandler:^(NSError * _Nullable err) {
NSLog(@"3a: write a value into the RO mandatory attribute: OperationalStatus Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], EMBER_ZCL_STATUS_UNSUPPORTED_WRITE);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_WNCV_2_1_000009_ReadAttribute
{
XCTestExpectation * expectation =
[self expectationWithDescription:@"3b: reads back the RO mandatory attribute: OperationalStatus"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestWindowCovering * cluster = [[CHIPTestWindowCovering alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeOperationalStatusWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"3b: reads back the RO mandatory attribute: OperationalStatus Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertNotEqual([actualValue unsignedCharValue], 128);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_WNCV_2_1_000010_ReadAttribute
{
XCTestExpectation * expectation =
[self expectationWithDescription:@"2: read the RO mandatory attribute default: EndProductType"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestWindowCovering * cluster = [[CHIPTestWindowCovering alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeEndProductTypeWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"2: read the RO mandatory attribute default: EndProductType Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertLessThanOrEqual([actualValue unsignedCharValue], 23);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_WNCV_2_1_000011_WriteAttribute
{
XCTestExpectation * expectation =
[self expectationWithDescription:@"3a: write a value into the RO mandatory attribute: EndProductType"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestWindowCovering * cluster = [[CHIPTestWindowCovering alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
id endProductTypeArgument;
endProductTypeArgument = [NSNumber numberWithUnsignedChar:250];
[cluster
writeAttributeEndProductTypeWithValue:endProductTypeArgument
completionHandler:^(NSError * _Nullable err) {
NSLog(@"3a: write a value into the RO mandatory attribute: EndProductType Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], EMBER_ZCL_STATUS_UNSUPPORTED_WRITE);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_WNCV_2_1_000012_ReadAttribute
{
XCTestExpectation * expectation =
[self expectationWithDescription:@"3b: reads back the RO mandatory attribute: EndProductType"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestWindowCovering * cluster = [[CHIPTestWindowCovering alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeEndProductTypeWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"3b: reads back the RO mandatory attribute: EndProductType Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertNotEqual([actualValue unsignedCharValue], 250);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_WNCV_2_1_000013_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"2: read the RW mandatory attribute default: Mode"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestWindowCovering * cluster = [[CHIPTestWindowCovering alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeModeWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"2: read the RW mandatory attribute default: Mode Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertLessThanOrEqual([actualValue unsignedCharValue], 15);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_WNCV_2_1_000014_WriteAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"3a: write a value into the RW mandatory attribute:: Mode"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestWindowCovering * cluster = [[CHIPTestWindowCovering alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
id modeArgument;
modeArgument = [NSNumber numberWithUnsignedChar:8];
[cluster writeAttributeModeWithValue:modeArgument
completionHandler:^(NSError * _Nullable err) {
NSLog(@"3a: write a value into the RW mandatory attribute:: Mode Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_WNCV_2_1_000015_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"3b: reads back the RW mandatory attribute: Mode"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestWindowCovering * cluster = [[CHIPTestWindowCovering alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeModeWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"3b: reads back the RW mandatory attribute: Mode Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertEqual([actualValue unsignedCharValue], 8);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_WNCV_2_1_000016_ReadAttribute
{
XCTestExpectation * expectation =
[self expectationWithDescription:@"2: read the RO optional attribute default: TargetPositionLiftPercent100ths"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestWindowCovering * cluster = [[CHIPTestWindowCovering alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster
readAttributeTargetPositionLiftPercent100thsWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"2: read the RO optional attribute default: TargetPositionLiftPercent100ths Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertLessThanOrEqual([actualValue unsignedShortValue], 10000);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_WNCV_2_1_000017_WriteAttribute
{
XCTestExpectation * expectation =
[self expectationWithDescription:@"3a: write a value into the RO optional attribute: TargetPositionLiftPercent100ths"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestWindowCovering * cluster = [[CHIPTestWindowCovering alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
id targetPositionLiftPercent100thsArgument;
targetPositionLiftPercent100thsArgument = [NSNumber numberWithUnsignedShort:20000U];
[cluster writeAttributeTargetPositionLiftPercent100thsWithValue:targetPositionLiftPercent100thsArgument
completionHandler:^(NSError * _Nullable err) {
NSLog(@"3a: write a value into the RO optional attribute: "
@"TargetPositionLiftPercent100ths Error: %@",
err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err],
EMBER_ZCL_STATUS_UNSUPPORTED_WRITE);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_WNCV_2_1_000018_ReadAttribute
{
XCTestExpectation * expectation =
[self expectationWithDescription:@"3b: reads back the RO optional attribute: TargetPositionLiftPercent100ths"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestWindowCovering * cluster = [[CHIPTestWindowCovering alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster
readAttributeTargetPositionLiftPercent100thsWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"3b: reads back the RO optional attribute: TargetPositionLiftPercent100ths Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertNotEqual([actualValue unsignedShortValue], 20000);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_WNCV_2_1_000019_ReadAttribute
{
XCTestExpectation * expectation =
[self expectationWithDescription:@"2: read the RO optional attribute default: TargetPositionTiltPercent100ths"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestWindowCovering * cluster = [[CHIPTestWindowCovering alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster
readAttributeTargetPositionTiltPercent100thsWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"2: read the RO optional attribute default: TargetPositionTiltPercent100ths Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertLessThanOrEqual([actualValue unsignedShortValue], 10000);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_WNCV_2_1_000020_WriteAttribute
{
XCTestExpectation * expectation =
[self expectationWithDescription:@"3a: write a value into the RO optional attribute: TargetPositionTiltPercent100ths"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestWindowCovering * cluster = [[CHIPTestWindowCovering alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
id targetPositionTiltPercent100thsArgument;
targetPositionTiltPercent100thsArgument = [NSNumber numberWithUnsignedShort:20000U];
[cluster writeAttributeTargetPositionTiltPercent100thsWithValue:targetPositionTiltPercent100thsArgument
completionHandler:^(NSError * _Nullable err) {
NSLog(@"3a: write a value into the RO optional attribute: "
@"TargetPositionTiltPercent100ths Error: %@",
err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err],
EMBER_ZCL_STATUS_UNSUPPORTED_WRITE);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_WNCV_2_1_000021_ReadAttribute
{
XCTestExpectation * expectation =
[self expectationWithDescription:@"3b: reads back the RO optional attribute: TargetPositionTiltPercent100ths"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestWindowCovering * cluster = [[CHIPTestWindowCovering alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster
readAttributeTargetPositionTiltPercent100thsWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"3b: reads back the RO optional attribute: TargetPositionTiltPercent100ths Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertNotEqual([actualValue unsignedShortValue], 20000);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_WNCV_2_1_000022_ReadAttribute
{
XCTestExpectation * expectation =
[self expectationWithDescription:@"2: read the RO optional attribute default: CurrentPositionLiftPercent100ths"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestWindowCovering * cluster = [[CHIPTestWindowCovering alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster
readAttributeCurrentPositionLiftPercent100thsWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"2: read the RO optional attribute default: CurrentPositionLiftPercent100ths Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertLessThanOrEqual([actualValue unsignedShortValue], 10000);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_WNCV_2_1_000023_WriteAttribute
{
XCTestExpectation * expectation =
[self expectationWithDescription:@"3a: write a value into the RO optional attribute: CurrentPositionLiftPercent100ths"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestWindowCovering * cluster = [[CHIPTestWindowCovering alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
id currentPositionLiftPercent100thsArgument;
currentPositionLiftPercent100thsArgument = [NSNumber numberWithUnsignedShort:20000U];
[cluster writeAttributeCurrentPositionLiftPercent100thsWithValue:currentPositionLiftPercent100thsArgument
completionHandler:^(NSError * _Nullable err) {
NSLog(@"3a: write a value into the RO optional attribute: "
@"CurrentPositionLiftPercent100ths Error: %@",
err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err],
EMBER_ZCL_STATUS_UNSUPPORTED_WRITE);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_WNCV_2_1_000024_ReadAttribute
{
XCTestExpectation * expectation =
[self expectationWithDescription:@"3b: reads back the RO optional attribute: CurrentPositionLiftPercent100ths"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestWindowCovering * cluster = [[CHIPTestWindowCovering alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster
readAttributeCurrentPositionLiftPercent100thsWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"3b: reads back the RO optional attribute: CurrentPositionLiftPercent100ths Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertNotEqual([actualValue unsignedShortValue], 20000);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_WNCV_2_1_000025_ReadAttribute
{
XCTestExpectation * expectation =
[self expectationWithDescription:@"2: read the RO optional attribute default: CurrentPositionTiltPercent100ths"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestWindowCovering * cluster = [[CHIPTestWindowCovering alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster
readAttributeCurrentPositionTiltPercent100thsWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"2: read the RO optional attribute default: CurrentPositionTiltPercent100ths Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertLessThanOrEqual([actualValue unsignedShortValue], 10000);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_WNCV_2_1_000026_WriteAttribute
{
XCTestExpectation * expectation =
[self expectationWithDescription:@"3a: write a value into the RO optional attribute: CurrentPositionTiltPercent100ths"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestWindowCovering * cluster = [[CHIPTestWindowCovering alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
id currentPositionTiltPercent100thsArgument;
currentPositionTiltPercent100thsArgument = [NSNumber numberWithUnsignedShort:20000U];
[cluster writeAttributeCurrentPositionTiltPercent100thsWithValue:currentPositionTiltPercent100thsArgument
completionHandler:^(NSError * _Nullable err) {
NSLog(@"3a: write a value into the RO optional attribute: "
@"CurrentPositionTiltPercent100ths Error: %@",
err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err],
EMBER_ZCL_STATUS_UNSUPPORTED_WRITE);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_WNCV_2_1_000027_ReadAttribute
{
XCTestExpectation * expectation =
[self expectationWithDescription:@"3b: reads back the RO optional attribute: CurrentPositionTiltPercent100ths"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestWindowCovering * cluster = [[CHIPTestWindowCovering alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster
readAttributeCurrentPositionTiltPercent100thsWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"3b: reads back the RO optional attribute: CurrentPositionTiltPercent100ths Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertNotEqual([actualValue unsignedShortValue], 20000);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_WNCV_2_1_000028_ReadAttribute
{
XCTestExpectation * expectation =
[self expectationWithDescription:@"2: read the RO optional attribute default: InstalledOpenLimitLift"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestWindowCovering * cluster = [[CHIPTestWindowCovering alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeInstalledOpenLimitLiftWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"2: read the RO optional attribute default: InstalledOpenLimitLift Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertLessThanOrEqual([actualValue unsignedShortValue], 65535);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_WNCV_2_1_000029_WriteAttribute
{
XCTestExpectation * expectation =
[self expectationWithDescription:@"3a: write a value into the RO optional attribute: InstalledOpenLimitLift"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestWindowCovering * cluster = [[CHIPTestWindowCovering alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
id installedOpenLimitLiftArgument;
installedOpenLimitLiftArgument = [NSNumber numberWithUnsignedShort:255U];
[cluster
writeAttributeInstalledOpenLimitLiftWithValue:installedOpenLimitLiftArgument
completionHandler:^(NSError * _Nullable err) {
NSLog(@"3a: write a value into the RO optional attribute: InstalledOpenLimitLift Error: %@",
err);
XCTAssertEqual(
[CHIPErrorTestUtils errorToZCLErrorCode:err], EMBER_ZCL_STATUS_UNSUPPORTED_WRITE);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_WNCV_2_1_000030_ReadAttribute
{
XCTestExpectation * expectation =
[self expectationWithDescription:@"3b: reads back the RO optional attribute: InstalledOpenLimitLift"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestWindowCovering * cluster = [[CHIPTestWindowCovering alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeInstalledOpenLimitLiftWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"3b: reads back the RO optional attribute: InstalledOpenLimitLift Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertLessThanOrEqual([actualValue unsignedShortValue], 65535);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_WNCV_2_1_000031_ReadAttribute
{
XCTestExpectation * expectation =
[self expectationWithDescription:@"2: read the RO optional attribute default: InstalledClosedLimitLift"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestWindowCovering * cluster = [[CHIPTestWindowCovering alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeInstalledClosedLimitLiftWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"2: read the RO optional attribute default: InstalledClosedLimitLift Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertLessThanOrEqual([actualValue unsignedShortValue], 65535);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_WNCV_2_1_000032_WriteAttribute
{
XCTestExpectation * expectation =
[self expectationWithDescription:@"3a: write a value into the RO optional attribute: InstalledClosedLimitLift"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestWindowCovering * cluster = [[CHIPTestWindowCovering alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
id installedClosedLimitLiftArgument;
installedClosedLimitLiftArgument = [NSNumber numberWithUnsignedShort:255U];
[cluster writeAttributeInstalledClosedLimitLiftWithValue:installedClosedLimitLiftArgument
completionHandler:^(NSError * _Nullable err) {
NSLog(@"3a: write a value into the RO optional attribute: InstalledClosedLimitLift "
@"Error: %@",
err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err],
EMBER_ZCL_STATUS_UNSUPPORTED_WRITE);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_WNCV_2_1_000033_ReadAttribute
{
XCTestExpectation * expectation =
[self expectationWithDescription:@"3b: reads back the RO optional attribute: InstalledClosedLimitLift"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestWindowCovering * cluster = [[CHIPTestWindowCovering alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeInstalledClosedLimitLiftWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"3b: reads back the RO optional attribute: InstalledClosedLimitLift Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertLessThanOrEqual([actualValue unsignedShortValue], 65535);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_WNCV_2_1_000034_ReadAttribute
{
XCTestExpectation * expectation =
[self expectationWithDescription:@"2: read the RO optional attribute default: InstalledOpenLimitTilt"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestWindowCovering * cluster = [[CHIPTestWindowCovering alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeInstalledOpenLimitTiltWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"2: read the RO optional attribute default: InstalledOpenLimitTilt Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertLessThanOrEqual([actualValue unsignedShortValue], 65535);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_WNCV_2_1_000035_WriteAttribute
{
XCTestExpectation * expectation =
[self expectationWithDescription:@"3a: write a value into the RO optional attribute: InstalledOpenLimitTilt"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestWindowCovering * cluster = [[CHIPTestWindowCovering alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
id installedOpenLimitTiltArgument;
installedOpenLimitTiltArgument = [NSNumber numberWithUnsignedShort:255U];
[cluster
writeAttributeInstalledOpenLimitTiltWithValue:installedOpenLimitTiltArgument
completionHandler:^(NSError * _Nullable err) {
NSLog(@"3a: write a value into the RO optional attribute: InstalledOpenLimitTilt Error: %@",
err);
XCTAssertEqual(
[CHIPErrorTestUtils errorToZCLErrorCode:err], EMBER_ZCL_STATUS_UNSUPPORTED_WRITE);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_WNCV_2_1_000036_ReadAttribute
{
XCTestExpectation * expectation =
[self expectationWithDescription:@"3b: reads back the RO optional attribute: InstalledOpenLimitTilt"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestWindowCovering * cluster = [[CHIPTestWindowCovering alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeInstalledOpenLimitTiltWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"3b: reads back the RO optional attribute: InstalledOpenLimitTilt Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertLessThanOrEqual([actualValue unsignedShortValue], 65535);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_WNCV_2_1_000037_ReadAttribute
{
XCTestExpectation * expectation =
[self expectationWithDescription:@"2: read the RO optional attribute default: InstalledClosedLimitTilt"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestWindowCovering * cluster = [[CHIPTestWindowCovering alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeInstalledClosedLimitTiltWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"2: read the RO optional attribute default: InstalledClosedLimitTilt Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertLessThanOrEqual([actualValue unsignedShortValue], 65535);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_WNCV_2_1_000038_WriteAttribute
{
XCTestExpectation * expectation =
[self expectationWithDescription:@"3a: write a value into the RO optional attribute: InstalledClosedLimitTilt"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestWindowCovering * cluster = [[CHIPTestWindowCovering alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
id installedClosedLimitTiltArgument;
installedClosedLimitTiltArgument = [NSNumber numberWithUnsignedShort:255U];
[cluster writeAttributeInstalledClosedLimitTiltWithValue:installedClosedLimitTiltArgument
completionHandler:^(NSError * _Nullable err) {
NSLog(@"3a: write a value into the RO optional attribute: InstalledClosedLimitTilt "
@"Error: %@",
err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err],
EMBER_ZCL_STATUS_UNSUPPORTED_WRITE);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_WNCV_2_1_000039_ReadAttribute
{
XCTestExpectation * expectation =
[self expectationWithDescription:@"3b: reads back the RO optional attribute: InstalledClosedLimitTilt"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestWindowCovering * cluster = [[CHIPTestWindowCovering alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeInstalledClosedLimitTiltWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"3b: reads back the RO optional attribute: InstalledClosedLimitTilt Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertLessThanOrEqual([actualValue unsignedShortValue], 65535);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_WNCV_2_1_000040_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"4: read the RO mandatory attribute default: SafetyStatus"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestWindowCovering * cluster = [[CHIPTestWindowCovering alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeSafetyStatusWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"4: read the RO mandatory attribute default: SafetyStatus Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertLessThanOrEqual([actualValue unsignedShortValue], 2047);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_WNCV_2_1_000041_WriteAttribute
{
XCTestExpectation * expectation =
[self expectationWithDescription:@"5a: write a value into the RO mandatory attribute: SafetyStatus"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestWindowCovering * cluster = [[CHIPTestWindowCovering alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
id safetyStatusArgument;
safetyStatusArgument = [NSNumber numberWithUnsignedShort:4096U];
[cluster writeAttributeSafetyStatusWithValue:safetyStatusArgument
completionHandler:^(NSError * _Nullable err) {
NSLog(@"5a: write a value into the RO mandatory attribute: SafetyStatus Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], EMBER_ZCL_STATUS_UNSUPPORTED_WRITE);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_WNCV_2_1_000042_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"5b: reads back the RO mandatory attribute: SafetyStatus"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestWindowCovering * cluster = [[CHIPTestWindowCovering alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeSafetyStatusWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"5b: reads back the RO mandatory attribute: SafetyStatus Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertNotEqual([actualValue unsignedShortValue], 4096);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_WNCV_2_1_000043_ReadAttribute
{
XCTestExpectation * expectation =
[self expectationWithDescription:@"4: read the RO optional attribute default: CurrentPositionLift"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestWindowCovering * cluster = [[CHIPTestWindowCovering alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeCurrentPositionLiftWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"4: read the RO optional attribute default: CurrentPositionLift Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertLessThanOrEqual([actualValue unsignedShortValue], 65535);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_WNCV_2_1_000044_WriteAttribute
{
XCTestExpectation * expectation =
[self expectationWithDescription:@"5a: write a value into the RO optional attribute: CurrentPositionLift"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestWindowCovering * cluster = [[CHIPTestWindowCovering alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
id currentPositionLiftArgument;
currentPositionLiftArgument = [NSNumber numberWithUnsignedShort:255U];
[cluster
writeAttributeCurrentPositionLiftWithValue:currentPositionLiftArgument
completionHandler:^(NSError * _Nullable err) {
NSLog(@"5a: write a value into the RO optional attribute: CurrentPositionLift Error: %@", err);
XCTAssertEqual(
[CHIPErrorTestUtils errorToZCLErrorCode:err], EMBER_ZCL_STATUS_UNSUPPORTED_WRITE);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_WNCV_2_1_000045_ReadAttribute
{
XCTestExpectation * expectation =
[self expectationWithDescription:@"5b: reads back the RO optional attribute: CurrentPositionLift"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestWindowCovering * cluster = [[CHIPTestWindowCovering alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeCurrentPositionLiftWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"5b: reads back the RO optional attribute: CurrentPositionLift Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertLessThanOrEqual([actualValue unsignedShortValue], 65535);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_WNCV_2_1_000046_ReadAttribute
{
XCTestExpectation * expectation =
[self expectationWithDescription:@"4: read the RO optional attribute default: CurrentPositionTilt"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestWindowCovering * cluster = [[CHIPTestWindowCovering alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeCurrentPositionTiltWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"4: read the RO optional attribute default: CurrentPositionTilt Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertLessThanOrEqual([actualValue unsignedShortValue], 65535);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_WNCV_2_1_000047_WriteAttribute
{
XCTestExpectation * expectation =
[self expectationWithDescription:@"5a: write a value into the RO optional attribute: CurrentPositionTilt"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestWindowCovering * cluster = [[CHIPTestWindowCovering alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
id currentPositionTiltArgument;
currentPositionTiltArgument = [NSNumber numberWithUnsignedShort:255U];
[cluster
writeAttributeCurrentPositionTiltWithValue:currentPositionTiltArgument
completionHandler:^(NSError * _Nullable err) {
NSLog(@"5a: write a value into the RO optional attribute: CurrentPositionTilt Error: %@", err);
XCTAssertEqual(
[CHIPErrorTestUtils errorToZCLErrorCode:err], EMBER_ZCL_STATUS_UNSUPPORTED_WRITE);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_WNCV_2_1_000048_ReadAttribute
{
XCTestExpectation * expectation =
[self expectationWithDescription:@"5b: reads back the RO optional attribute: CurrentPositionTilt"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestWindowCovering * cluster = [[CHIPTestWindowCovering alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeCurrentPositionTiltWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"5b: reads back the RO optional attribute: CurrentPositionTilt Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertLessThanOrEqual([actualValue unsignedShortValue], 65535);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_WNCV_2_1_000049_ReadAttribute
{
XCTestExpectation * expectation =
[self expectationWithDescription:@"4: read the RO optional attribute default: CurrentPositionLiftPercentage"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestWindowCovering * cluster = [[CHIPTestWindowCovering alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster
readAttributeCurrentPositionLiftPercentageWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"4: read the RO optional attribute default: CurrentPositionLiftPercentage Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertLessThanOrEqual([actualValue unsignedCharValue], 100);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_WNCV_2_1_000050_WriteAttribute
{
XCTestExpectation * expectation =
[self expectationWithDescription:@"5a: write a value into the RO optional attribute: CurrentPositionLiftPercentage"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestWindowCovering * cluster = [[CHIPTestWindowCovering alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
id currentPositionLiftPercentageArgument;
currentPositionLiftPercentageArgument = [NSNumber numberWithUnsignedChar:200];
[cluster writeAttributeCurrentPositionLiftPercentageWithValue:currentPositionLiftPercentageArgument
completionHandler:^(NSError * _Nullable err) {
NSLog(@"5a: write a value into the RO optional attribute: "
@"CurrentPositionLiftPercentage Error: %@",
err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err],
EMBER_ZCL_STATUS_UNSUPPORTED_WRITE);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_WNCV_2_1_000051_ReadAttribute
{
XCTestExpectation * expectation =
[self expectationWithDescription:@"5b: reads back the RO optional attribute: CurrentPositionLiftPercentage"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestWindowCovering * cluster = [[CHIPTestWindowCovering alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster
readAttributeCurrentPositionLiftPercentageWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"5b: reads back the RO optional attribute: CurrentPositionLiftPercentage Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertNotEqual([actualValue unsignedCharValue], 200);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_WNCV_2_1_000052_ReadAttribute
{
XCTestExpectation * expectation =
[self expectationWithDescription:@"4: read the RO optional attribute default: CurrentPositionTiltPercentage"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestWindowCovering * cluster = [[CHIPTestWindowCovering alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster
readAttributeCurrentPositionTiltPercentageWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"4: read the RO optional attribute default: CurrentPositionTiltPercentage Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertLessThanOrEqual([actualValue unsignedCharValue], 100);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_WNCV_2_1_000053_WriteAttribute
{
XCTestExpectation * expectation =
[self expectationWithDescription:@"5a: write a value into the RO optional attribute: CurrentPositionTiltPercentage"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestWindowCovering * cluster = [[CHIPTestWindowCovering alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
id currentPositionTiltPercentageArgument;
currentPositionTiltPercentageArgument = [NSNumber numberWithUnsignedChar:200];
[cluster writeAttributeCurrentPositionTiltPercentageWithValue:currentPositionTiltPercentageArgument
completionHandler:^(NSError * _Nullable err) {
NSLog(@"5a: write a value into the RO optional attribute: "
@"CurrentPositionTiltPercentage Error: %@",
err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err],
EMBER_ZCL_STATUS_UNSUPPORTED_WRITE);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_WNCV_2_1_000054_ReadAttribute
{
XCTestExpectation * expectation =
[self expectationWithDescription:@"5b: reads back the RO optional attribute: CurrentPositionTiltPercentage"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestWindowCovering * cluster = [[CHIPTestWindowCovering alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster
readAttributeCurrentPositionTiltPercentageWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"5b: reads back the RO optional attribute: CurrentPositionTiltPercentage Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertNotEqual([actualValue unsignedCharValue], 200);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_WNCV_2_2_000000_WaitForCommissionee
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"];
dispatch_queue_t queue = dispatch_get_main_queue();
WaitForCommissionee(expectation, queue);
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_WNCV_2_4_000000_WaitForCommissionee
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"];
dispatch_queue_t queue = dispatch_get_main_queue();
WaitForCommissionee(expectation, queue);
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_WNCV_2_4_000001_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Reads Type attribute from DUT"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestWindowCovering * cluster = [[CHIPTestWindowCovering alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeTypeWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"Reads Type attribute from DUT Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertEqual([actualValue unsignedCharValue], 0);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_WNCV_2_4_000002_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Reads Type attribute constraints"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestWindowCovering * cluster = [[CHIPTestWindowCovering alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeTypeWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"Reads Type attribute constraints Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertLessThanOrEqual([actualValue unsignedCharValue], 9);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_WNCV_2_5_000000_WaitForCommissionee
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"];
dispatch_queue_t queue = dispatch_get_main_queue();
WaitForCommissionee(expectation, queue);
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_WNCV_2_5_000001_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Reads EndProductType attribute from DUT"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestWindowCovering * cluster = [[CHIPTestWindowCovering alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeEndProductTypeWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"Reads EndProductType attribute from DUT Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertEqual([actualValue unsignedCharValue], 0);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_WNCV_2_5_000002_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Reads EndProductType attribute constraints from DUT"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestWindowCovering * cluster = [[CHIPTestWindowCovering alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeEndProductTypeWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"Reads EndProductType attribute constraints from DUT Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertLessThanOrEqual([actualValue unsignedCharValue], 23);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_WNCV_3_1_000000_WaitForCommissionee
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"];
dispatch_queue_t queue = dispatch_get_main_queue();
WaitForCommissionee(expectation, queue);
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_WNCV_3_1_000001_DownOrClose
{
XCTestExpectation * expectation = [self expectationWithDescription:@"1a: TH adjusts the the DUT to a non-open position"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestWindowCovering * cluster = [[CHIPTestWindowCovering alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster downOrCloseWithCompletionHandler:^(NSError * _Nullable err) {
NSLog(@"1a: TH adjusts the the DUT to a non-open position Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_WNCV_3_1_000002_UpOrOpen
{
XCTestExpectation * expectation = [self expectationWithDescription:@"2a: TH sends UpOrOpen command to DUT"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestWindowCovering * cluster = [[CHIPTestWindowCovering alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster upOrOpenWithCompletionHandler:^(NSError * _Nullable err) {
NSLog(@"2a: TH sends UpOrOpen command to DUT Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_WNCV_3_1_000003_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"3a: TH reads OperationalStatus attribute from DUT"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestWindowCovering * cluster = [[CHIPTestWindowCovering alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeOperationalStatusWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"3a: TH reads OperationalStatus attribute from DUT Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertEqual([actualValue unsignedCharValue], 0);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_WNCV_3_2_000000_WaitForCommissionee
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"];
dispatch_queue_t queue = dispatch_get_main_queue();
WaitForCommissionee(expectation, queue);
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_WNCV_3_2_000001_UpOrOpen
{
XCTestExpectation * expectation = [self expectationWithDescription:@"1a: TH adjusts the the DUT to a non-closed position"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestWindowCovering * cluster = [[CHIPTestWindowCovering alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster upOrOpenWithCompletionHandler:^(NSError * _Nullable err) {
NSLog(@"1a: TH adjusts the the DUT to a non-closed position Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_WNCV_3_2_000002_DownOrClose
{
XCTestExpectation * expectation = [self expectationWithDescription:@"2a: TH sends DownOrClose command to DUT"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestWindowCovering * cluster = [[CHIPTestWindowCovering alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster downOrCloseWithCompletionHandler:^(NSError * _Nullable err) {
NSLog(@"2a: TH sends DownOrClose command to DUT Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_WNCV_3_2_000003_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"3a: TH reads OperationalStatus attribute from DUT"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestWindowCovering * cluster = [[CHIPTestWindowCovering alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeOperationalStatusWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"3a: TH reads OperationalStatus attribute from DUT Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertEqual([actualValue unsignedCharValue], 0);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_WNCV_3_3_000000_WaitForCommissionee
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"];
dispatch_queue_t queue = dispatch_get_main_queue();
WaitForCommissionee(expectation, queue);
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_WNCV_3_3_000001_UpOrOpen
{
XCTestExpectation * expectation = [self expectationWithDescription:@"1a: TH adjusts the the DUT to a non-open position"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestWindowCovering * cluster = [[CHIPTestWindowCovering alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster upOrOpenWithCompletionHandler:^(NSError * _Nullable err) {
NSLog(@"1a: TH adjusts the the DUT to a non-open position Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_WNCV_3_3_000002_StopMotion
{
XCTestExpectation * expectation = [self expectationWithDescription:@"2a: TH sends StopMotion command to DUT"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestWindowCovering * cluster = [[CHIPTestWindowCovering alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster stopMotionWithCompletionHandler:^(NSError * _Nullable err) {
NSLog(@"2a: TH sends StopMotion command to DUT Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_WNCV_3_3_000003_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"2b: TH reads OperationalStatus attribute from DUT"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestWindowCovering * cluster = [[CHIPTestWindowCovering alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeOperationalStatusWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"2b: TH reads OperationalStatus attribute from DUT Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertEqual([actualValue unsignedCharValue], 0);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTestCluster_000000_WaitForCommissionee
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"];
dispatch_queue_t queue = dispatch_get_main_queue();
WaitForCommissionee(expectation, queue);
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTestCluster_000001_Test
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Send Test Command"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster testWithCompletionHandler:^(NSError * _Nullable err) {
NSLog(@"Send Test Command Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTestCluster_000002_TestNotHandled
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Send Test Not Handled Command"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster testNotHandledWithCompletionHandler:^(NSError * _Nullable err) {
NSLog(@"Send Test Not Handled Command Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], EMBER_ZCL_STATUS_INVALID_COMMAND);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTestCluster_000003_TestSpecific
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Send Test Specific Command"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster testSpecificWithCompletionHandler:^(
CHIPTestClusterClusterTestSpecificResponseParams * _Nullable values, NSError * _Nullable err) {
NSLog(@"Send Test Specific Command Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = values.returnValue;
XCTAssertEqual([actualValue unsignedCharValue], 7);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTestCluster_000004_TestAddArguments
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Send Test Add Arguments Command"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
__auto_type * params = [[CHIPTestClusterClusterTestAddArgumentsParams alloc] init];
params.arg1 = [NSNumber numberWithUnsignedChar:3];
params.arg2 = [NSNumber numberWithUnsignedChar:17];
[cluster testAddArgumentsWithParams:params
completionHandler:^(
CHIPTestClusterClusterTestAddArgumentsResponseParams * _Nullable values, NSError * _Nullable err) {
NSLog(@"Send Test Add Arguments Command Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = values.returnValue;
XCTAssertEqual([actualValue unsignedCharValue], 20);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTestCluster_000005_TestAddArguments
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Send failing Test Add Arguments Command"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
__auto_type * params = [[CHIPTestClusterClusterTestAddArgumentsParams alloc] init];
params.arg1 = [NSNumber numberWithUnsignedChar:250];
params.arg2 = [NSNumber numberWithUnsignedChar:6];
[cluster testAddArgumentsWithParams:params
completionHandler:^(
CHIPTestClusterClusterTestAddArgumentsResponseParams * _Nullable values, NSError * _Nullable err) {
NSLog(@"Send failing Test Add Arguments Command Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], EMBER_ZCL_STATUS_INVALID_COMMAND);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTestCluster_000006_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute BOOLEAN Default Value"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeBooleanWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"Read attribute BOOLEAN Default Value Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertEqual([actualValue boolValue], 0);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTestCluster_000007_WriteAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Write attribute BOOLEAN True"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
id booleanArgument;
booleanArgument = [NSNumber numberWithBool:1];
[cluster writeAttributeBooleanWithValue:booleanArgument
completionHandler:^(NSError * _Nullable err) {
NSLog(@"Write attribute BOOLEAN True Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTestCluster_000008_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute BOOLEAN True"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeBooleanWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"Read attribute BOOLEAN True Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertEqual([actualValue boolValue], 1);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTestCluster_000009_WriteAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Write attribute BOOLEAN False"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
id booleanArgument;
booleanArgument = [NSNumber numberWithBool:0];
[cluster writeAttributeBooleanWithValue:booleanArgument
completionHandler:^(NSError * _Nullable err) {
NSLog(@"Write attribute BOOLEAN False Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTestCluster_000010_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute BOOLEAN False"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeBooleanWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"Read attribute BOOLEAN False Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertEqual([actualValue boolValue], 0);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTestCluster_000011_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute BITMAP8 Default Value"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeBitmap8WithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"Read attribute BITMAP8 Default Value Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertEqual([actualValue unsignedCharValue], 0);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTestCluster_000012_WriteAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Write attribute BITMAP8 Max Value"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
id bitmap8Argument;
bitmap8Argument = [NSNumber numberWithUnsignedChar:255];
[cluster writeAttributeBitmap8WithValue:bitmap8Argument
completionHandler:^(NSError * _Nullable err) {
NSLog(@"Write attribute BITMAP8 Max Value Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTestCluster_000013_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute BITMAP8 Max Value"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeBitmap8WithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"Read attribute BITMAP8 Max Value Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertEqual([actualValue unsignedCharValue], 255);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTestCluster_000014_WriteAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Write attribute BITMAP8 Min Value"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
id bitmap8Argument;
bitmap8Argument = [NSNumber numberWithUnsignedChar:0];
[cluster writeAttributeBitmap8WithValue:bitmap8Argument
completionHandler:^(NSError * _Nullable err) {
NSLog(@"Write attribute BITMAP8 Min Value Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTestCluster_000015_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute BITMAP8 Min Value"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeBitmap8WithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"Read attribute BITMAP8 Min Value Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertEqual([actualValue unsignedCharValue], 0);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTestCluster_000016_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute BITMAP16 Default Value"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeBitmap16WithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"Read attribute BITMAP16 Default Value Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertEqual([actualValue unsignedShortValue], 0U);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTestCluster_000017_WriteAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Write attribute BITMAP16 Max Value"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
id bitmap16Argument;
bitmap16Argument = [NSNumber numberWithUnsignedShort:65535U];
[cluster writeAttributeBitmap16WithValue:bitmap16Argument
completionHandler:^(NSError * _Nullable err) {
NSLog(@"Write attribute BITMAP16 Max Value Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTestCluster_000018_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute BITMAP16 Max Value"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeBitmap16WithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"Read attribute BITMAP16 Max Value Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertEqual([actualValue unsignedShortValue], 65535U);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTestCluster_000019_WriteAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Write attribute BITMAP16 Min Value"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
id bitmap16Argument;
bitmap16Argument = [NSNumber numberWithUnsignedShort:0U];
[cluster writeAttributeBitmap16WithValue:bitmap16Argument
completionHandler:^(NSError * _Nullable err) {
NSLog(@"Write attribute BITMAP16 Min Value Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTestCluster_000020_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute BITMAP16 Min Value"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeBitmap16WithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"Read attribute BITMAP16 Min Value Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertEqual([actualValue unsignedShortValue], 0U);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTestCluster_000021_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute BITMAP32 Default Value"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeBitmap32WithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"Read attribute BITMAP32 Default Value Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertEqual([actualValue unsignedIntValue], 0UL);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTestCluster_000022_WriteAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Write attribute BITMAP32 Max Value"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
id bitmap32Argument;
bitmap32Argument = [NSNumber numberWithUnsignedInt:4294967295UL];
[cluster writeAttributeBitmap32WithValue:bitmap32Argument
completionHandler:^(NSError * _Nullable err) {
NSLog(@"Write attribute BITMAP32 Max Value Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTestCluster_000023_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute BITMAP32 Max Value"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeBitmap32WithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"Read attribute BITMAP32 Max Value Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertEqual([actualValue unsignedIntValue], 4294967295UL);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTestCluster_000024_WriteAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Write attribute BITMAP32 Min Value"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
id bitmap32Argument;
bitmap32Argument = [NSNumber numberWithUnsignedInt:0UL];
[cluster writeAttributeBitmap32WithValue:bitmap32Argument
completionHandler:^(NSError * _Nullable err) {
NSLog(@"Write attribute BITMAP32 Min Value Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTestCluster_000025_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute BITMAP32 Min Value"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeBitmap32WithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"Read attribute BITMAP32 Min Value Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertEqual([actualValue unsignedIntValue], 0UL);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTestCluster_000026_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute BITMAP64 Default Value"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeBitmap64WithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"Read attribute BITMAP64 Default Value Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertEqual([actualValue unsignedLongLongValue], 0ULL);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTestCluster_000027_WriteAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Write attribute BITMAP64 Max Value"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
id bitmap64Argument;
bitmap64Argument = [NSNumber numberWithUnsignedLongLong:18446744073709551615ULL];
[cluster writeAttributeBitmap64WithValue:bitmap64Argument
completionHandler:^(NSError * _Nullable err) {
NSLog(@"Write attribute BITMAP64 Max Value Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTestCluster_000028_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute BITMAP64 Max Value"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeBitmap64WithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"Read attribute BITMAP64 Max Value Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertEqual([actualValue unsignedLongLongValue], 18446744073709551615ULL);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTestCluster_000029_WriteAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Write attribute BITMAP64 Min Value"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
id bitmap64Argument;
bitmap64Argument = [NSNumber numberWithUnsignedLongLong:0ULL];
[cluster writeAttributeBitmap64WithValue:bitmap64Argument
completionHandler:^(NSError * _Nullable err) {
NSLog(@"Write attribute BITMAP64 Min Value Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTestCluster_000030_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute BITMAP64 Min Value"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeBitmap64WithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"Read attribute BITMAP64 Min Value Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertEqual([actualValue unsignedLongLongValue], 0ULL);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTestCluster_000031_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute INT8U Default Value"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeInt8uWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"Read attribute INT8U Default Value Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertEqual([actualValue unsignedCharValue], 0);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTestCluster_000032_WriteAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Write attribute INT8U Max Value"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
id int8uArgument;
int8uArgument = [NSNumber numberWithUnsignedChar:255];
[cluster writeAttributeInt8uWithValue:int8uArgument
completionHandler:^(NSError * _Nullable err) {
NSLog(@"Write attribute INT8U Max Value Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTestCluster_000033_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute INT8U Max Value"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeInt8uWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"Read attribute INT8U Max Value Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertEqual([actualValue unsignedCharValue], 255);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTestCluster_000034_WriteAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Write attribute INT8U Min Value"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
id int8uArgument;
int8uArgument = [NSNumber numberWithUnsignedChar:0];
[cluster writeAttributeInt8uWithValue:int8uArgument
completionHandler:^(NSError * _Nullable err) {
NSLog(@"Write attribute INT8U Min Value Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTestCluster_000035_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute INT8U Min Value"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeInt8uWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"Read attribute INT8U Min Value Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertEqual([actualValue unsignedCharValue], 0);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTestCluster_000036_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute INT16U Default Value"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeInt16uWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"Read attribute INT16U Default Value Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertEqual([actualValue unsignedShortValue], 0U);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTestCluster_000037_WriteAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Write attribute INT16U Max Value"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
id int16uArgument;
int16uArgument = [NSNumber numberWithUnsignedShort:65535U];
[cluster writeAttributeInt16uWithValue:int16uArgument
completionHandler:^(NSError * _Nullable err) {
NSLog(@"Write attribute INT16U Max Value Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTestCluster_000038_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute INT16U Max Value"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeInt16uWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"Read attribute INT16U Max Value Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertEqual([actualValue unsignedShortValue], 65535U);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTestCluster_000039_WriteAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Write attribute INT16U Min Value"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
id int16uArgument;
int16uArgument = [NSNumber numberWithUnsignedShort:0U];
[cluster writeAttributeInt16uWithValue:int16uArgument
completionHandler:^(NSError * _Nullable err) {
NSLog(@"Write attribute INT16U Min Value Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTestCluster_000040_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute INT16U Min Value"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeInt16uWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"Read attribute INT16U Min Value Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertEqual([actualValue unsignedShortValue], 0U);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTestCluster_000041_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute INT32U Default Value"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeInt32uWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"Read attribute INT32U Default Value Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertEqual([actualValue unsignedIntValue], 0UL);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTestCluster_000042_WriteAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Write attribute INT32U Max Value"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
id int32uArgument;
int32uArgument = [NSNumber numberWithUnsignedInt:4294967295UL];
[cluster writeAttributeInt32uWithValue:int32uArgument
completionHandler:^(NSError * _Nullable err) {
NSLog(@"Write attribute INT32U Max Value Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTestCluster_000043_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute INT32U Max Value"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeInt32uWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"Read attribute INT32U Max Value Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertEqual([actualValue unsignedIntValue], 4294967295UL);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTestCluster_000044_WriteAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Write attribute INT32U Min Value"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
id int32uArgument;
int32uArgument = [NSNumber numberWithUnsignedInt:0UL];
[cluster writeAttributeInt32uWithValue:int32uArgument
completionHandler:^(NSError * _Nullable err) {
NSLog(@"Write attribute INT32U Min Value Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTestCluster_000045_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute INT32U Min Value"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeInt32uWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"Read attribute INT32U Min Value Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertEqual([actualValue unsignedIntValue], 0UL);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTestCluster_000046_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute INT64U Default Value"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeInt64uWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"Read attribute INT64U Default Value Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertEqual([actualValue unsignedLongLongValue], 0ULL);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTestCluster_000047_WriteAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Write attribute INT64U Max Value"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
id int64uArgument;
int64uArgument = [NSNumber numberWithUnsignedLongLong:18446744073709551615ULL];
[cluster writeAttributeInt64uWithValue:int64uArgument
completionHandler:^(NSError * _Nullable err) {
NSLog(@"Write attribute INT64U Max Value Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTestCluster_000048_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute INT64U Max Value"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeInt64uWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"Read attribute INT64U Max Value Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertEqual([actualValue unsignedLongLongValue], 18446744073709551615ULL);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTestCluster_000049_WriteAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Write attribute INT64U Min Value"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
id int64uArgument;
int64uArgument = [NSNumber numberWithUnsignedLongLong:0ULL];
[cluster writeAttributeInt64uWithValue:int64uArgument
completionHandler:^(NSError * _Nullable err) {
NSLog(@"Write attribute INT64U Min Value Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTestCluster_000050_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute INT64U Min Value"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeInt64uWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"Read attribute INT64U Min Value Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertEqual([actualValue unsignedLongLongValue], 0ULL);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTestCluster_000051_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute INT8S Default Value"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeInt8sWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"Read attribute INT8S Default Value Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertEqual([actualValue charValue], 0);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTestCluster_000052_WriteAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Write attribute INT8S Max Value"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
id int8sArgument;
int8sArgument = [NSNumber numberWithChar:127];
[cluster writeAttributeInt8sWithValue:int8sArgument
completionHandler:^(NSError * _Nullable err) {
NSLog(@"Write attribute INT8S Max Value Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTestCluster_000053_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute INT8S Max Value"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeInt8sWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"Read attribute INT8S Max Value Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertEqual([actualValue charValue], 127);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTestCluster_000054_WriteAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Write attribute INT8S Min Value"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
id int8sArgument;
int8sArgument = [NSNumber numberWithChar:-128];
[cluster writeAttributeInt8sWithValue:int8sArgument
completionHandler:^(NSError * _Nullable err) {
NSLog(@"Write attribute INT8S Min Value Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTestCluster_000055_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute INT8S Min Value"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeInt8sWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"Read attribute INT8S Min Value Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertEqual([actualValue charValue], -128);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTestCluster_000056_WriteAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Write attribute INT8S Default Value"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
id int8sArgument;
int8sArgument = [NSNumber numberWithChar:0];
[cluster writeAttributeInt8sWithValue:int8sArgument
completionHandler:^(NSError * _Nullable err) {
NSLog(@"Write attribute INT8S Default Value Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTestCluster_000057_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute INT8S Default Value"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeInt8sWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"Read attribute INT8S Default Value Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertEqual([actualValue charValue], 0);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTestCluster_000058_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute INT16S Default Value"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeInt16sWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"Read attribute INT16S Default Value Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertEqual([actualValue shortValue], 0);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTestCluster_000059_WriteAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Write attribute INT16S Max Value"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
id int16sArgument;
int16sArgument = [NSNumber numberWithShort:32767];
[cluster writeAttributeInt16sWithValue:int16sArgument
completionHandler:^(NSError * _Nullable err) {
NSLog(@"Write attribute INT16S Max Value Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTestCluster_000060_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute INT16S Max Value"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeInt16sWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"Read attribute INT16S Max Value Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertEqual([actualValue shortValue], 32767);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTestCluster_000061_WriteAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Write attribute INT16S Min Value"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
id int16sArgument;
int16sArgument = [NSNumber numberWithShort:-32768];
[cluster writeAttributeInt16sWithValue:int16sArgument
completionHandler:^(NSError * _Nullable err) {
NSLog(@"Write attribute INT16S Min Value Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTestCluster_000062_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute INT16S Min Value"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeInt16sWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"Read attribute INT16S Min Value Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertEqual([actualValue shortValue], -32768);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTestCluster_000063_WriteAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Write attribute INT16S Default Value"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
id int16sArgument;
int16sArgument = [NSNumber numberWithShort:0];
[cluster writeAttributeInt16sWithValue:int16sArgument
completionHandler:^(NSError * _Nullable err) {
NSLog(@"Write attribute INT16S Default Value Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTestCluster_000064_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute INT16S Default Value"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeInt16sWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"Read attribute INT16S Default Value Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertEqual([actualValue shortValue], 0);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTestCluster_000065_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute INT32S Default Value"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeInt32sWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"Read attribute INT32S Default Value Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertEqual([actualValue intValue], 0L);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTestCluster_000066_WriteAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Write attribute INT32S Max Value"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
id int32sArgument;
int32sArgument = [NSNumber numberWithInt:2147483647L];
[cluster writeAttributeInt32sWithValue:int32sArgument
completionHandler:^(NSError * _Nullable err) {
NSLog(@"Write attribute INT32S Max Value Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTestCluster_000067_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute INT32S Max Value"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeInt32sWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"Read attribute INT32S Max Value Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertEqual([actualValue intValue], 2147483647L);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTestCluster_000068_WriteAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Write attribute INT32S Min Value"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
id int32sArgument;
int32sArgument = [NSNumber numberWithInt:-2147483648L];
[cluster writeAttributeInt32sWithValue:int32sArgument
completionHandler:^(NSError * _Nullable err) {
NSLog(@"Write attribute INT32S Min Value Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTestCluster_000069_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute INT32S Min Value"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeInt32sWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"Read attribute INT32S Min Value Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertEqual([actualValue intValue], -2147483648L);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTestCluster_000070_WriteAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Write attribute INT32S Default Value"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
id int32sArgument;
int32sArgument = [NSNumber numberWithInt:0L];
[cluster writeAttributeInt32sWithValue:int32sArgument
completionHandler:^(NSError * _Nullable err) {
NSLog(@"Write attribute INT32S Default Value Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTestCluster_000071_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute INT32S Default Value"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeInt32sWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"Read attribute INT32S Default Value Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertEqual([actualValue intValue], 0L);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTestCluster_000072_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute INT64S Default Value"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeInt64sWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"Read attribute INT64S Default Value Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertEqual([actualValue longLongValue], 0LL);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTestCluster_000073_WriteAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Write attribute INT64S Max Value"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
id int64sArgument;
int64sArgument = [NSNumber numberWithLongLong:9223372036854775807LL];
[cluster writeAttributeInt64sWithValue:int64sArgument
completionHandler:^(NSError * _Nullable err) {
NSLog(@"Write attribute INT64S Max Value Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTestCluster_000074_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute INT64S Max Value"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeInt64sWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"Read attribute INT64S Max Value Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertEqual([actualValue longLongValue], 9223372036854775807LL);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTestCluster_000075_WriteAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Write attribute INT64S Min Value"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
id int64sArgument;
int64sArgument = [NSNumber numberWithLongLong:-9223372036854775807LL];
[cluster writeAttributeInt64sWithValue:int64sArgument
completionHandler:^(NSError * _Nullable err) {
NSLog(@"Write attribute INT64S Min Value Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTestCluster_000076_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute INT64S Min Value"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeInt64sWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"Read attribute INT64S Min Value Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertEqual([actualValue longLongValue], -9223372036854775807LL);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTestCluster_000077_WriteAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Write attribute INT64S Default Value"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
id int64sArgument;
int64sArgument = [NSNumber numberWithLongLong:0LL];
[cluster writeAttributeInt64sWithValue:int64sArgument
completionHandler:^(NSError * _Nullable err) {
NSLog(@"Write attribute INT64S Default Value Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTestCluster_000078_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute INT64S Default Value"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeInt64sWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"Read attribute INT64S Default Value Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertEqual([actualValue longLongValue], 0LL);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTestCluster_000079_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute SINGLE Default Value"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeFloatSingleWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"Read attribute SINGLE Default Value Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertEqual([actualValue floatValue], 0.0f);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTestCluster_000080_WriteAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Write attribute SINGLE medium Value"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
id floatSingleArgument;
floatSingleArgument = [NSNumber numberWithFloat:0.1f];
[cluster writeAttributeFloatSingleWithValue:floatSingleArgument
completionHandler:^(NSError * _Nullable err) {
NSLog(@"Write attribute SINGLE medium Value Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTestCluster_000081_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute SINGLE medium Value"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeFloatSingleWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"Read attribute SINGLE medium Value Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertEqual([actualValue floatValue], 0.1f);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTestCluster_000082_WriteAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Write attribute SINGLE large Value"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
id floatSingleArgument;
floatSingleArgument = [NSNumber numberWithFloat:17000000000.0f];
[cluster writeAttributeFloatSingleWithValue:floatSingleArgument
completionHandler:^(NSError * _Nullable err) {
NSLog(@"Write attribute SINGLE large Value Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTestCluster_000083_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute SINGLE large Value"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeFloatSingleWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"Read attribute SINGLE large Value Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertEqual([actualValue floatValue], 17000000000.0f);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTestCluster_000084_WriteAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Write attribute SINGLE small Value"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
id floatSingleArgument;
floatSingleArgument = [NSNumber numberWithFloat:1.7e-10f];
[cluster writeAttributeFloatSingleWithValue:floatSingleArgument
completionHandler:^(NSError * _Nullable err) {
NSLog(@"Write attribute SINGLE small Value Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTestCluster_000085_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute SINGLE small Value"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeFloatSingleWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"Read attribute SINGLE small Value Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertEqual([actualValue floatValue], 1.7e-10f);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTestCluster_000086_WriteAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Write attribute SINGLE Default Value"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
id floatSingleArgument;
floatSingleArgument = [NSNumber numberWithFloat:0.0f];
[cluster writeAttributeFloatSingleWithValue:floatSingleArgument
completionHandler:^(NSError * _Nullable err) {
NSLog(@"Write attribute SINGLE Default Value Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTestCluster_000087_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute SINGLE Default Value"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeFloatSingleWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"Read attribute SINGLE Default Value Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertEqual([actualValue floatValue], 0.0f);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTestCluster_000088_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute DOUBLE Default Value"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeFloatDoubleWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"Read attribute DOUBLE Default Value Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertEqual([actualValue doubleValue], 0);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTestCluster_000089_WriteAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Write attribute DOUBLE medium Value"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
id floatDoubleArgument;
floatDoubleArgument = [NSNumber numberWithDouble:0.1234567890123];
[cluster writeAttributeFloatDoubleWithValue:floatDoubleArgument
completionHandler:^(NSError * _Nullable err) {
NSLog(@"Write attribute DOUBLE medium Value Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTestCluster_000090_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute DOUBLE medium Value"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeFloatDoubleWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"Read attribute DOUBLE medium Value Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertEqual([actualValue doubleValue], 0.1234567890123);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTestCluster_000091_WriteAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Write attribute DOUBLE large Value"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
id floatDoubleArgument;
floatDoubleArgument = [NSNumber numberWithDouble:1.7e+200];
[cluster writeAttributeFloatDoubleWithValue:floatDoubleArgument
completionHandler:^(NSError * _Nullable err) {
NSLog(@"Write attribute DOUBLE large Value Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTestCluster_000092_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute DOUBLE large Value"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeFloatDoubleWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"Read attribute DOUBLE large Value Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertEqual([actualValue doubleValue], 1.7e+200);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTestCluster_000093_WriteAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Write attribute DOUBLE small Value"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
id floatDoubleArgument;
floatDoubleArgument = [NSNumber numberWithDouble:1.7e-200];
[cluster writeAttributeFloatDoubleWithValue:floatDoubleArgument
completionHandler:^(NSError * _Nullable err) {
NSLog(@"Write attribute DOUBLE small Value Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTestCluster_000094_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute DOUBLE small Value"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeFloatDoubleWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"Read attribute DOUBLE small Value Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertEqual([actualValue doubleValue], 1.7e-200);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTestCluster_000095_WriteAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Write attribute DOUBLE Default Value"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
id floatDoubleArgument;
floatDoubleArgument = [NSNumber numberWithDouble:0];
[cluster writeAttributeFloatDoubleWithValue:floatDoubleArgument
completionHandler:^(NSError * _Nullable err) {
NSLog(@"Write attribute DOUBLE Default Value Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTestCluster_000096_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute DOUBLE Default Value"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeFloatDoubleWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"Read attribute DOUBLE Default Value Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertEqual([actualValue doubleValue], 0);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTestCluster_000097_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute ENUM8 Default Value"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeEnum8WithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"Read attribute ENUM8 Default Value Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertEqual([actualValue unsignedCharValue], 0);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTestCluster_000098_WriteAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Write attribute ENUM8 Max Value"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
id enum8Argument;
enum8Argument = [NSNumber numberWithUnsignedChar:255];
[cluster writeAttributeEnum8WithValue:enum8Argument
completionHandler:^(NSError * _Nullable err) {
NSLog(@"Write attribute ENUM8 Max Value Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTestCluster_000099_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute ENUM8 Max Value"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeEnum8WithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"Read attribute ENUM8 Max Value Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertEqual([actualValue unsignedCharValue], 255);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTestCluster_000100_WriteAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Write attribute ENUM8 Min Value"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
id enum8Argument;
enum8Argument = [NSNumber numberWithUnsignedChar:0];
[cluster writeAttributeEnum8WithValue:enum8Argument
completionHandler:^(NSError * _Nullable err) {
NSLog(@"Write attribute ENUM8 Min Value Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTestCluster_000101_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute ENUM8 Min Value"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeEnum8WithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"Read attribute ENUM8 Min Value Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertEqual([actualValue unsignedCharValue], 0);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTestCluster_000102_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute ENUM16 Default Value"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeEnum16WithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"Read attribute ENUM16 Default Value Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertEqual([actualValue unsignedShortValue], 0U);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTestCluster_000103_WriteAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Write attribute ENUM16 Max Value"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
id enum16Argument;
enum16Argument = [NSNumber numberWithUnsignedShort:65535U];
[cluster writeAttributeEnum16WithValue:enum16Argument
completionHandler:^(NSError * _Nullable err) {
NSLog(@"Write attribute ENUM16 Max Value Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTestCluster_000104_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute ENUM16 Max Value"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeEnum16WithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"Read attribute ENUM16 Max Value Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertEqual([actualValue unsignedShortValue], 65535U);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTestCluster_000105_WriteAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Write attribute ENUM16 Min Value"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
id enum16Argument;
enum16Argument = [NSNumber numberWithUnsignedShort:0U];
[cluster writeAttributeEnum16WithValue:enum16Argument
completionHandler:^(NSError * _Nullable err) {
NSLog(@"Write attribute ENUM16 Min Value Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTestCluster_000106_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute ENUM16 Min Value"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeEnum16WithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"Read attribute ENUM16 Min Value Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertEqual([actualValue unsignedShortValue], 0U);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTestCluster_000107_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute OCTET_STRING Default Value"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeOctetStringWithCompletionHandler:^(NSData * _Nullable value, NSError * _Nullable err) {
NSLog(@"Read attribute OCTET_STRING Default Value Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertTrue([actualValue isEqualToData:[[NSData alloc] initWithBytes:"" length:0]]);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTestCluster_000108_WriteAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Write attribute OCTET_STRING with embedded null"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
id octetStringArgument;
octetStringArgument = [[NSData alloc] initWithBytes:"Tes\x00ti\x00ng" length:9];
[cluster writeAttributeOctetStringWithValue:octetStringArgument
completionHandler:^(NSError * _Nullable err) {
NSLog(@"Write attribute OCTET_STRING with embedded null Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTestCluster_000109_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute OCTET_STRING with embedded null"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeOctetStringWithCompletionHandler:^(NSData * _Nullable value, NSError * _Nullable err) {
NSLog(@"Read attribute OCTET_STRING with embedded null Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertTrue([actualValue isEqualToData:[[NSData alloc] initWithBytes:"Tes\x00ti\x00ng" length:9]]);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTestCluster_000110_WriteAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Write attribute OCTET_STRING"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
id octetStringArgument;
octetStringArgument = [[NSData alloc] initWithBytes:"TestValue" length:9];
[cluster writeAttributeOctetStringWithValue:octetStringArgument
completionHandler:^(NSError * _Nullable err) {
NSLog(@"Write attribute OCTET_STRING Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTestCluster_000111_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute OCTET_STRING"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeOctetStringWithCompletionHandler:^(NSData * _Nullable value, NSError * _Nullable err) {
NSLog(@"Read attribute OCTET_STRING Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertTrue([actualValue isEqualToData:[[NSData alloc] initWithBytes:"TestValue" length:9]]);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTestCluster_000112_WriteAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Write attribute OCTET_STRING"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
id octetStringArgument;
octetStringArgument = [[NSData alloc] initWithBytes:"TestValueLongerThan10" length:21];
[cluster writeAttributeOctetStringWithValue:octetStringArgument
completionHandler:^(NSError * _Nullable err) {
NSLog(@"Write attribute OCTET_STRING Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], EMBER_ZCL_STATUS_CONSTRAINT_ERROR);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTestCluster_000113_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute OCTET_STRING"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeOctetStringWithCompletionHandler:^(NSData * _Nullable value, NSError * _Nullable err) {
NSLog(@"Read attribute OCTET_STRING Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertTrue([actualValue isEqualToData:[[NSData alloc] initWithBytes:"TestValue" length:9]]);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTestCluster_000114_WriteAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Write attribute OCTET_STRING"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
id octetStringArgument;
octetStringArgument = [[NSData alloc] initWithBytes:"" length:0];
[cluster writeAttributeOctetStringWithValue:octetStringArgument
completionHandler:^(NSError * _Nullable err) {
NSLog(@"Write attribute OCTET_STRING Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTestCluster_000115_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute LONG_OCTET_STRING Default Value"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeLongOctetStringWithCompletionHandler:^(NSData * _Nullable value, NSError * _Nullable err) {
NSLog(@"Read attribute LONG_OCTET_STRING Default Value Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertTrue([actualValue isEqualToData:[[NSData alloc] initWithBytes:"" length:0]]);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTestCluster_000116_WriteAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Write attribute LONG_OCTET_STRING"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
id longOctetStringArgument;
longOctetStringArgument = [[NSData alloc]
initWithBytes:"111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111"
"111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111"
"111111111111111111111111111111111111111111111111111111111111111111111111111111111111"
length:300];
[cluster writeAttributeLongOctetStringWithValue:longOctetStringArgument
completionHandler:^(NSError * _Nullable err) {
NSLog(@"Write attribute LONG_OCTET_STRING Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTestCluster_000117_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute LONG_OCTET_STRING"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeLongOctetStringWithCompletionHandler:^(NSData * _Nullable value, NSError * _Nullable err) {
NSLog(@"Read attribute LONG_OCTET_STRING Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertTrue([actualValue
isEqualToData:[[NSData alloc]
initWithBytes:"1111111111111111111111111111111111111111111111111111111111111111111111111111111111"
"1111111111111111111111111111111111111111111111111111111111111111111111111111111111"
"1111111111111111111111111111111111111111111111111111111111111111111111111111111111"
"111111111111111111111111111111111111111111111111111111"
length:300]]);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTestCluster_000118_WriteAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Write attribute LONG_OCTET_STRING"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
id longOctetStringArgument;
longOctetStringArgument = [[NSData alloc] initWithBytes:"" length:0];
[cluster writeAttributeLongOctetStringWithValue:longOctetStringArgument
completionHandler:^(NSError * _Nullable err) {
NSLog(@"Write attribute LONG_OCTET_STRING Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTestCluster_000119_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute CHAR_STRING Default Value"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeCharStringWithCompletionHandler:^(NSString * _Nullable value, NSError * _Nullable err) {
NSLog(@"Read attribute CHAR_STRING Default Value Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertTrue([actualValue isEqualToString:@""]);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTestCluster_000120_WriteAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Write attribute CHAR_STRING"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
id charStringArgument;
charStringArgument = @"☉T☉";
[cluster writeAttributeCharStringWithValue:charStringArgument
completionHandler:^(NSError * _Nullable err) {
NSLog(@"Write attribute CHAR_STRING Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTestCluster_000121_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute CHAR_STRING"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeCharStringWithCompletionHandler:^(NSString * _Nullable value, NSError * _Nullable err) {
NSLog(@"Read attribute CHAR_STRING Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertTrue([actualValue isEqualToString:@"☉T☉"]);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTestCluster_000122_WriteAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Write attribute CHAR_STRING - Value too long"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
id charStringArgument;
charStringArgument = @"☉TestValueLongerThan10☉";
[cluster writeAttributeCharStringWithValue:charStringArgument
completionHandler:^(NSError * _Nullable err) {
NSLog(@"Write attribute CHAR_STRING - Value too long Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], EMBER_ZCL_STATUS_CONSTRAINT_ERROR);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTestCluster_000123_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute CHAR_STRING"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeCharStringWithCompletionHandler:^(NSString * _Nullable value, NSError * _Nullable err) {
NSLog(@"Read attribute CHAR_STRING Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertTrue([actualValue isEqualToString:@"☉T☉"]);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTestCluster_000124_WriteAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Write attribute CHAR_STRING - Empty"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
id charStringArgument;
charStringArgument = @"";
[cluster writeAttributeCharStringWithValue:charStringArgument
completionHandler:^(NSError * _Nullable err) {
NSLog(@"Write attribute CHAR_STRING - Empty Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTestCluster_000125_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute LONG_CHAR_STRING Default Value"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeLongCharStringWithCompletionHandler:^(NSString * _Nullable value, NSError * _Nullable err) {
NSLog(@"Read attribute LONG_CHAR_STRING Default Value Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertTrue([actualValue isEqualToString:@""]);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTestCluster_000126_WriteAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Write attribute LONG_CHAR_STRING"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
id longCharStringArgument;
longCharStringArgument
= @"☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉"
@"☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉"
@"☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉";
[cluster writeAttributeLongCharStringWithValue:longCharStringArgument
completionHandler:^(NSError * _Nullable err) {
NSLog(@"Write attribute LONG_CHAR_STRING Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTestCluster_000127_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute LONG_CHAR_STRING"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeLongCharStringWithCompletionHandler:^(NSString * _Nullable value, NSError * _Nullable err) {
NSLog(@"Read attribute LONG_CHAR_STRING Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertTrue([actualValue
isEqualToString:
@"☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉"
@"☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉"
@"☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉"]);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTestCluster_000128_WriteAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Write attribute LONG_CHAR_STRING"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
id longCharStringArgument;
longCharStringArgument = @"";
[cluster writeAttributeLongCharStringWithValue:longCharStringArgument
completionHandler:^(NSError * _Nullable err) {
NSLog(@"Write attribute LONG_CHAR_STRING Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTestCluster_000129_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute LIST_LONG_OCTET_STRING"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeListLongOctetStringWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) {
NSLog(@"Read attribute LIST_LONG_OCTET_STRING Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertEqual([actualValue count], 4);
XCTAssertTrue([actualValue[0]
isEqualToData:
[[NSData alloc]
initWithBytes:"0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789ab"
"cdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef01234567"
"89abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123"
"456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef"
"0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789ab"
"cdef0123456789abcdef0123456789abcdef0123456789abcdef"
length:512]]);
XCTAssertTrue([actualValue[1]
isEqualToData:
[[NSData alloc]
initWithBytes:"0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789ab"
"cdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef01234567"
"89abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123"
"456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef"
"0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789ab"
"cdef0123456789abcdef0123456789abcdef0123456789abcdef"
length:512]]);
XCTAssertTrue([actualValue[2]
isEqualToData:
[[NSData alloc]
initWithBytes:"0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789ab"
"cdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef01234567"
"89abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123"
"456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef"
"0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789ab"
"cdef0123456789abcdef0123456789abcdef0123456789abcdef"
length:512]]);
XCTAssertTrue([actualValue[3]
isEqualToData:
[[NSData alloc]
initWithBytes:"0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789ab"
"cdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef01234567"
"89abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123"
"456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef"
"0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789ab"
"cdef0123456789abcdef0123456789abcdef0123456789abcdef"
length:512]]);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTestCluster_000130_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute EPOCH_US Default Value"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeEpochUsWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"Read attribute EPOCH_US Default Value Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertEqual([actualValue unsignedLongLongValue], 0ULL);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTestCluster_000131_WriteAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Write attribute EPOCH_US Max Value"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
id epochUsArgument;
epochUsArgument = [NSNumber numberWithUnsignedLongLong:18446744073709551615ULL];
[cluster writeAttributeEpochUsWithValue:epochUsArgument
completionHandler:^(NSError * _Nullable err) {
NSLog(@"Write attribute EPOCH_US Max Value Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTestCluster_000132_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute EPOCH_US Max Value"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeEpochUsWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"Read attribute EPOCH_US Max Value Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertEqual([actualValue unsignedLongLongValue], 18446744073709551615ULL);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTestCluster_000133_WriteAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Write attribute EPOCH_US Min Value"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
id epochUsArgument;
epochUsArgument = [NSNumber numberWithUnsignedLongLong:0ULL];
[cluster writeAttributeEpochUsWithValue:epochUsArgument
completionHandler:^(NSError * _Nullable err) {
NSLog(@"Write attribute EPOCH_US Min Value Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTestCluster_000134_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute EPOCH_US Min Value"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeEpochUsWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"Read attribute EPOCH_US Min Value Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertEqual([actualValue unsignedLongLongValue], 0ULL);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTestCluster_000135_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute EPOCH_S Default Value"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeEpochSWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"Read attribute EPOCH_S Default Value Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertEqual([actualValue unsignedIntValue], 0UL);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTestCluster_000136_WriteAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Write attribute EPOCH_S Max Value"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
id epochSArgument;
epochSArgument = [NSNumber numberWithUnsignedInt:4294967295UL];
[cluster writeAttributeEpochSWithValue:epochSArgument
completionHandler:^(NSError * _Nullable err) {
NSLog(@"Write attribute EPOCH_S Max Value Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTestCluster_000137_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute EPOCH_S Max Value"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeEpochSWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"Read attribute EPOCH_S Max Value Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertEqual([actualValue unsignedIntValue], 4294967295UL);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTestCluster_000138_WriteAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Write attribute EPOCH_S Min Value"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
id epochSArgument;
epochSArgument = [NSNumber numberWithUnsignedInt:0UL];
[cluster writeAttributeEpochSWithValue:epochSArgument
completionHandler:^(NSError * _Nullable err) {
NSLog(@"Write attribute EPOCH_S Min Value Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTestCluster_000139_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute EPOCH_S Min Value"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeEpochSWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"Read attribute EPOCH_S Min Value Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertEqual([actualValue unsignedIntValue], 0UL);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTestCluster_000140_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute UNSUPPORTED"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeUnsupportedWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"Read attribute UNSUPPORTED Error: %@", err);
if (err.code == CHIPErrorCodeUnsupportedAttribute) {
[expectation fulfill];
return;
}
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertEqual([actualValue boolValue], 0);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTestCluster_000141_WriteAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Writeattribute UNSUPPORTED"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
id unsupportedArgument;
unsupportedArgument = [NSNumber numberWithBool:0];
[cluster writeAttributeUnsupportedWithValue:unsupportedArgument
completionHandler:^(NSError * _Nullable err) {
NSLog(@"Writeattribute UNSUPPORTED Error: %@", err);
if (err.code == CHIPErrorCodeUnsupportedAttribute) {
[expectation fulfill];
return;
}
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTestCluster_000142_Test
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Send Test Command to unsupported endpoint"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:200 queue:queue];
XCTAssertNotNil(cluster);
[cluster testWithCompletionHandler:^(NSError * _Nullable err) {
NSLog(@"Send Test Command to unsupported endpoint Error: %@", err);
XCTAssertNotEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTestCluster_000143_Test
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Send Test Command to unsupported cluster"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:0 queue:queue];
XCTAssertNotNil(cluster);
[cluster testWithCompletionHandler:^(NSError * _Nullable err) {
NSLog(@"Send Test Command to unsupported cluster Error: %@", err);
XCTAssertNotEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTestCluster_000144_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute vendor_id Default Value"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeVendorIdWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"Read attribute vendor_id Default Value Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertEqual([actualValue unsignedShortValue], 0U);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTestCluster_000145_WriteAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Write attribute vendor_id"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
id vendorIdArgument;
vendorIdArgument = [NSNumber numberWithUnsignedShort:17U];
[cluster writeAttributeVendorIdWithValue:vendorIdArgument
completionHandler:^(NSError * _Nullable err) {
NSLog(@"Write attribute vendor_id Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTestCluster_000146_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute vendor_id"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeVendorIdWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"Read attribute vendor_id Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertEqual([actualValue unsignedShortValue], 17U);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTestCluster_000147_WriteAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Restore attribute vendor_id"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
id vendorIdArgument;
vendorIdArgument = [NSNumber numberWithUnsignedShort:0U];
[cluster writeAttributeVendorIdWithValue:vendorIdArgument
completionHandler:^(NSError * _Nullable err) {
NSLog(@"Restore attribute vendor_id Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTestCluster_000148_TestEnumsRequest
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Send a command with a vendor_id and enum"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
__auto_type * params = [[CHIPTestClusterClusterTestEnumsRequestParams alloc] init];
params.arg1 = [NSNumber numberWithUnsignedShort:20003U];
params.arg2 = [NSNumber numberWithUnsignedChar:101];
[cluster
testEnumsRequestWithParams:params
completionHandler:^(CHIPTestClusterClusterTestEnumsResponseParams * _Nullable values, NSError * _Nullable err) {
NSLog(@"Send a command with a vendor_id and enum Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = values.arg1;
XCTAssertEqual([actualValue unsignedShortValue], 20003U);
}
{
id actualValue = values.arg2;
XCTAssertEqual([actualValue unsignedCharValue], 101);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTestCluster_000149_TestStructArgumentRequest
{
XCTestExpectation * expectation =
[self expectationWithDescription:@"Send Test Command With Struct Argument and arg1.b is true"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
__auto_type * params = [[CHIPTestClusterClusterTestStructArgumentRequestParams alloc] init];
params.arg1 = [[CHIPTestClusterClusterSimpleStruct alloc] init];
((CHIPTestClusterClusterSimpleStruct *) params.arg1).a = [NSNumber numberWithUnsignedChar:0];
((CHIPTestClusterClusterSimpleStruct *) params.arg1).b = [NSNumber numberWithBool:true];
((CHIPTestClusterClusterSimpleStruct *) params.arg1).c = [NSNumber numberWithUnsignedChar:2];
((CHIPTestClusterClusterSimpleStruct *) params.arg1).d = [[NSData alloc] initWithBytes:"octet_string" length:12];
((CHIPTestClusterClusterSimpleStruct *) params.arg1).e = @"char_string";
((CHIPTestClusterClusterSimpleStruct *) params.arg1).f = [NSNumber numberWithUnsignedChar:1];
((CHIPTestClusterClusterSimpleStruct *) params.arg1).g = [NSNumber numberWithFloat:0.0f];
((CHIPTestClusterClusterSimpleStruct *) params.arg1).h = [NSNumber numberWithDouble:0];
[cluster testStructArgumentRequestWithParams:params
completionHandler:^(
CHIPTestClusterClusterBooleanResponseParams * _Nullable values, NSError * _Nullable err) {
NSLog(@"Send Test Command With Struct Argument and arg1.b is true Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = values.value;
XCTAssertEqual([actualValue boolValue], true);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTestCluster_000150_TestStructArgumentRequest
{
XCTestExpectation * expectation =
[self expectationWithDescription:@"Send Test Command With Struct Argument and arg1.b is false"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
__auto_type * params = [[CHIPTestClusterClusterTestStructArgumentRequestParams alloc] init];
params.arg1 = [[CHIPTestClusterClusterSimpleStruct alloc] init];
((CHIPTestClusterClusterSimpleStruct *) params.arg1).a = [NSNumber numberWithUnsignedChar:0];
((CHIPTestClusterClusterSimpleStruct *) params.arg1).b = [NSNumber numberWithBool:false];
((CHIPTestClusterClusterSimpleStruct *) params.arg1).c = [NSNumber numberWithUnsignedChar:2];
((CHIPTestClusterClusterSimpleStruct *) params.arg1).d = [[NSData alloc] initWithBytes:"octet_string" length:12];
((CHIPTestClusterClusterSimpleStruct *) params.arg1).e = @"char_string";
((CHIPTestClusterClusterSimpleStruct *) params.arg1).f = [NSNumber numberWithUnsignedChar:1];
((CHIPTestClusterClusterSimpleStruct *) params.arg1).g = [NSNumber numberWithFloat:0.0f];
((CHIPTestClusterClusterSimpleStruct *) params.arg1).h = [NSNumber numberWithDouble:0];
[cluster testStructArgumentRequestWithParams:params
completionHandler:^(
CHIPTestClusterClusterBooleanResponseParams * _Nullable values, NSError * _Nullable err) {
NSLog(@"Send Test Command With Struct Argument and arg1.b is false Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = values.value;
XCTAssertEqual([actualValue boolValue], false);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTestCluster_000151_TestNestedStructArgumentRequest
{
XCTestExpectation * expectation =
[self expectationWithDescription:@"Send Test Command With Nested Struct Argument and arg1.c.b is true"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
__auto_type * params = [[CHIPTestClusterClusterTestNestedStructArgumentRequestParams alloc] init];
params.arg1 = [[CHIPTestClusterClusterNestedStruct alloc] init];
((CHIPTestClusterClusterNestedStruct *) params.arg1).a = [NSNumber numberWithUnsignedChar:0];
((CHIPTestClusterClusterNestedStruct *) params.arg1).b = [NSNumber numberWithBool:true];
((CHIPTestClusterClusterNestedStruct *) params.arg1).c = [[CHIPTestClusterClusterSimpleStruct alloc] init];
((CHIPTestClusterClusterSimpleStruct *) ((CHIPTestClusterClusterNestedStruct *) params.arg1).c).a =
[NSNumber numberWithUnsignedChar:0];
((CHIPTestClusterClusterSimpleStruct *) ((CHIPTestClusterClusterNestedStruct *) params.arg1).c).b =
[NSNumber numberWithBool:true];
((CHIPTestClusterClusterSimpleStruct *) ((CHIPTestClusterClusterNestedStruct *) params.arg1).c).c =
[NSNumber numberWithUnsignedChar:2];
((CHIPTestClusterClusterSimpleStruct *) ((CHIPTestClusterClusterNestedStruct *) params.arg1).c).d =
[[NSData alloc] initWithBytes:"octet_string" length:12];
((CHIPTestClusterClusterSimpleStruct *) ((CHIPTestClusterClusterNestedStruct *) params.arg1).c).e = @"char_string";
((CHIPTestClusterClusterSimpleStruct *) ((CHIPTestClusterClusterNestedStruct *) params.arg1).c).f =
[NSNumber numberWithUnsignedChar:1];
((CHIPTestClusterClusterSimpleStruct *) ((CHIPTestClusterClusterNestedStruct *) params.arg1).c).g =
[NSNumber numberWithFloat:0.0f];
((CHIPTestClusterClusterSimpleStruct *) ((CHIPTestClusterClusterNestedStruct *) params.arg1).c).h =
[NSNumber numberWithDouble:0];
[cluster
testNestedStructArgumentRequestWithParams:params
completionHandler:^(
CHIPTestClusterClusterBooleanResponseParams * _Nullable values, NSError * _Nullable err) {
NSLog(@"Send Test Command With Nested Struct Argument and arg1.c.b is true Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = values.value;
XCTAssertEqual([actualValue boolValue], true);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTestCluster_000152_TestNestedStructArgumentRequest
{
XCTestExpectation * expectation =
[self expectationWithDescription:@"Send Test Command With Nested Struct Argument arg1.c.b is false"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
__auto_type * params = [[CHIPTestClusterClusterTestNestedStructArgumentRequestParams alloc] init];
params.arg1 = [[CHIPTestClusterClusterNestedStruct alloc] init];
((CHIPTestClusterClusterNestedStruct *) params.arg1).a = [NSNumber numberWithUnsignedChar:0];
((CHIPTestClusterClusterNestedStruct *) params.arg1).b = [NSNumber numberWithBool:true];
((CHIPTestClusterClusterNestedStruct *) params.arg1).c = [[CHIPTestClusterClusterSimpleStruct alloc] init];
((CHIPTestClusterClusterSimpleStruct *) ((CHIPTestClusterClusterNestedStruct *) params.arg1).c).a =
[NSNumber numberWithUnsignedChar:0];
((CHIPTestClusterClusterSimpleStruct *) ((CHIPTestClusterClusterNestedStruct *) params.arg1).c).b =
[NSNumber numberWithBool:false];
((CHIPTestClusterClusterSimpleStruct *) ((CHIPTestClusterClusterNestedStruct *) params.arg1).c).c =
[NSNumber numberWithUnsignedChar:2];
((CHIPTestClusterClusterSimpleStruct *) ((CHIPTestClusterClusterNestedStruct *) params.arg1).c).d =
[[NSData alloc] initWithBytes:"octet_string" length:12];
((CHIPTestClusterClusterSimpleStruct *) ((CHIPTestClusterClusterNestedStruct *) params.arg1).c).e = @"char_string";
((CHIPTestClusterClusterSimpleStruct *) ((CHIPTestClusterClusterNestedStruct *) params.arg1).c).f =
[NSNumber numberWithUnsignedChar:1];
((CHIPTestClusterClusterSimpleStruct *) ((CHIPTestClusterClusterNestedStruct *) params.arg1).c).g =
[NSNumber numberWithFloat:0.0f];
((CHIPTestClusterClusterSimpleStruct *) ((CHIPTestClusterClusterNestedStruct *) params.arg1).c).h =
[NSNumber numberWithDouble:0];
[cluster testNestedStructArgumentRequestWithParams:params
completionHandler:^(
CHIPTestClusterClusterBooleanResponseParams * _Nullable values, NSError * _Nullable err) {
NSLog(@"Send Test Command With Nested Struct Argument arg1.c.b is false Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = values.value;
XCTAssertEqual([actualValue boolValue], false);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTestCluster_000153_TestNestedStructListArgumentRequest
{
XCTestExpectation * expectation =
[self expectationWithDescription:@"Send Test Command With Nested Struct List Argument and all fields b of arg1.d are true"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
__auto_type * params = [[CHIPTestClusterClusterTestNestedStructListArgumentRequestParams alloc] init];
params.arg1 = [[CHIPTestClusterClusterNestedStructList alloc] init];
((CHIPTestClusterClusterNestedStructList *) params.arg1).a = [NSNumber numberWithUnsignedChar:0];
((CHIPTestClusterClusterNestedStructList *) params.arg1).b = [NSNumber numberWithBool:true];
((CHIPTestClusterClusterNestedStructList *) params.arg1).c = [[CHIPTestClusterClusterSimpleStruct alloc] init];
((CHIPTestClusterClusterSimpleStruct *) ((CHIPTestClusterClusterNestedStructList *) params.arg1).c).a =
[NSNumber numberWithUnsignedChar:0];
((CHIPTestClusterClusterSimpleStruct *) ((CHIPTestClusterClusterNestedStructList *) params.arg1).c).b =
[NSNumber numberWithBool:true];
((CHIPTestClusterClusterSimpleStruct *) ((CHIPTestClusterClusterNestedStructList *) params.arg1).c).c =
[NSNumber numberWithUnsignedChar:2];
((CHIPTestClusterClusterSimpleStruct *) ((CHIPTestClusterClusterNestedStructList *) params.arg1).c).d =
[[NSData alloc] initWithBytes:"octet_string" length:12];
((CHIPTestClusterClusterSimpleStruct *) ((CHIPTestClusterClusterNestedStructList *) params.arg1).c).e = @"char_string";
((CHIPTestClusterClusterSimpleStruct *) ((CHIPTestClusterClusterNestedStructList *) params.arg1).c).f =
[NSNumber numberWithUnsignedChar:1];
((CHIPTestClusterClusterSimpleStruct *) ((CHIPTestClusterClusterNestedStructList *) params.arg1).c).g =
[NSNumber numberWithFloat:0.0f];
((CHIPTestClusterClusterSimpleStruct *) ((CHIPTestClusterClusterNestedStructList *) params.arg1).c).h =
[NSNumber numberWithDouble:0];
{
NSMutableArray * temp_1 = [[NSMutableArray alloc] init];
temp_1[0] = [[CHIPTestClusterClusterSimpleStruct alloc] init];
((CHIPTestClusterClusterSimpleStruct *) temp_1[0]).a = [NSNumber numberWithUnsignedChar:1];
((CHIPTestClusterClusterSimpleStruct *) temp_1[0]).b = [NSNumber numberWithBool:true];
((CHIPTestClusterClusterSimpleStruct *) temp_1[0]).c = [NSNumber numberWithUnsignedChar:3];
((CHIPTestClusterClusterSimpleStruct *) temp_1[0]).d = [[NSData alloc] initWithBytes:"nested_octet_string" length:19];
((CHIPTestClusterClusterSimpleStruct *) temp_1[0]).e = @"nested_char_string";
((CHIPTestClusterClusterSimpleStruct *) temp_1[0]).f = [NSNumber numberWithUnsignedChar:1];
((CHIPTestClusterClusterSimpleStruct *) temp_1[0]).g = [NSNumber numberWithFloat:0.0f];
((CHIPTestClusterClusterSimpleStruct *) temp_1[0]).h = [NSNumber numberWithDouble:0];
temp_1[1] = [[CHIPTestClusterClusterSimpleStruct alloc] init];
((CHIPTestClusterClusterSimpleStruct *) temp_1[1]).a = [NSNumber numberWithUnsignedChar:2];
((CHIPTestClusterClusterSimpleStruct *) temp_1[1]).b = [NSNumber numberWithBool:true];
((CHIPTestClusterClusterSimpleStruct *) temp_1[1]).c = [NSNumber numberWithUnsignedChar:3];
((CHIPTestClusterClusterSimpleStruct *) temp_1[1]).d = [[NSData alloc] initWithBytes:"nested_octet_string" length:19];
((CHIPTestClusterClusterSimpleStruct *) temp_1[1]).e = @"nested_char_string";
((CHIPTestClusterClusterSimpleStruct *) temp_1[1]).f = [NSNumber numberWithUnsignedChar:1];
((CHIPTestClusterClusterSimpleStruct *) temp_1[1]).g = [NSNumber numberWithFloat:0.0f];
((CHIPTestClusterClusterSimpleStruct *) temp_1[1]).h = [NSNumber numberWithDouble:0];
((CHIPTestClusterClusterNestedStructList *) params.arg1).d = temp_1;
}
{
NSMutableArray * temp_1 = [[NSMutableArray alloc] init];
temp_1[0] = [NSNumber numberWithUnsignedInt:1UL];
temp_1[1] = [NSNumber numberWithUnsignedInt:2UL];
temp_1[2] = [NSNumber numberWithUnsignedInt:3UL];
((CHIPTestClusterClusterNestedStructList *) params.arg1).e = temp_1;
}
{
NSMutableArray * temp_1 = [[NSMutableArray alloc] init];
temp_1[0] = [[NSData alloc] initWithBytes:"octet_string_1" length:14];
temp_1[1] = [[NSData alloc] initWithBytes:"octect_string_2" length:15];
temp_1[2] = [[NSData alloc] initWithBytes:"octet_string_3" length:14];
((CHIPTestClusterClusterNestedStructList *) params.arg1).f = temp_1;
}
{
NSMutableArray * temp_1 = [[NSMutableArray alloc] init];
temp_1[0] = [NSNumber numberWithUnsignedChar:0];
temp_1[1] = [NSNumber numberWithUnsignedChar:255];
((CHIPTestClusterClusterNestedStructList *) params.arg1).g = temp_1;
}
[cluster testNestedStructListArgumentRequestWithParams:params
completionHandler:^(CHIPTestClusterClusterBooleanResponseParams * _Nullable values,
NSError * _Nullable err) {
NSLog(@"Send Test Command With Nested Struct List Argument and all fields b of arg1.d "
@"are true Error: %@",
err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = values.value;
XCTAssertEqual([actualValue boolValue], true);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTestCluster_000154_TestNestedStructListArgumentRequest
{
XCTestExpectation * expectation = [self
expectationWithDescription:@"Send Test Command With Nested Struct List Argument and some fields b of arg1.d are false"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
__auto_type * params = [[CHIPTestClusterClusterTestNestedStructListArgumentRequestParams alloc] init];
params.arg1 = [[CHIPTestClusterClusterNestedStructList alloc] init];
((CHIPTestClusterClusterNestedStructList *) params.arg1).a = [NSNumber numberWithUnsignedChar:0];
((CHIPTestClusterClusterNestedStructList *) params.arg1).b = [NSNumber numberWithBool:true];
((CHIPTestClusterClusterNestedStructList *) params.arg1).c = [[CHIPTestClusterClusterSimpleStruct alloc] init];
((CHIPTestClusterClusterSimpleStruct *) ((CHIPTestClusterClusterNestedStructList *) params.arg1).c).a =
[NSNumber numberWithUnsignedChar:0];
((CHIPTestClusterClusterSimpleStruct *) ((CHIPTestClusterClusterNestedStructList *) params.arg1).c).b =
[NSNumber numberWithBool:true];
((CHIPTestClusterClusterSimpleStruct *) ((CHIPTestClusterClusterNestedStructList *) params.arg1).c).c =
[NSNumber numberWithUnsignedChar:2];
((CHIPTestClusterClusterSimpleStruct *) ((CHIPTestClusterClusterNestedStructList *) params.arg1).c).d =
[[NSData alloc] initWithBytes:"octet_string" length:12];
((CHIPTestClusterClusterSimpleStruct *) ((CHIPTestClusterClusterNestedStructList *) params.arg1).c).e = @"char_string";
((CHIPTestClusterClusterSimpleStruct *) ((CHIPTestClusterClusterNestedStructList *) params.arg1).c).f =
[NSNumber numberWithUnsignedChar:1];
((CHIPTestClusterClusterSimpleStruct *) ((CHIPTestClusterClusterNestedStructList *) params.arg1).c).g =
[NSNumber numberWithFloat:0.0f];
((CHIPTestClusterClusterSimpleStruct *) ((CHIPTestClusterClusterNestedStructList *) params.arg1).c).h =
[NSNumber numberWithDouble:0];
{
NSMutableArray * temp_1 = [[NSMutableArray alloc] init];
temp_1[0] = [[CHIPTestClusterClusterSimpleStruct alloc] init];
((CHIPTestClusterClusterSimpleStruct *) temp_1[0]).a = [NSNumber numberWithUnsignedChar:1];
((CHIPTestClusterClusterSimpleStruct *) temp_1[0]).b = [NSNumber numberWithBool:true];
((CHIPTestClusterClusterSimpleStruct *) temp_1[0]).c = [NSNumber numberWithUnsignedChar:3];
((CHIPTestClusterClusterSimpleStruct *) temp_1[0]).d = [[NSData alloc] initWithBytes:"nested_octet_string" length:19];
((CHIPTestClusterClusterSimpleStruct *) temp_1[0]).e = @"nested_char_string";
((CHIPTestClusterClusterSimpleStruct *) temp_1[0]).f = [NSNumber numberWithUnsignedChar:1];
((CHIPTestClusterClusterSimpleStruct *) temp_1[0]).g = [NSNumber numberWithFloat:0.0f];
((CHIPTestClusterClusterSimpleStruct *) temp_1[0]).h = [NSNumber numberWithDouble:0];
temp_1[1] = [[CHIPTestClusterClusterSimpleStruct alloc] init];
((CHIPTestClusterClusterSimpleStruct *) temp_1[1]).a = [NSNumber numberWithUnsignedChar:2];
((CHIPTestClusterClusterSimpleStruct *) temp_1[1]).b = [NSNumber numberWithBool:false];
((CHIPTestClusterClusterSimpleStruct *) temp_1[1]).c = [NSNumber numberWithUnsignedChar:3];
((CHIPTestClusterClusterSimpleStruct *) temp_1[1]).d = [[NSData alloc] initWithBytes:"nested_octet_string" length:19];
((CHIPTestClusterClusterSimpleStruct *) temp_1[1]).e = @"nested_char_string";
((CHIPTestClusterClusterSimpleStruct *) temp_1[1]).f = [NSNumber numberWithUnsignedChar:1];
((CHIPTestClusterClusterSimpleStruct *) temp_1[1]).g = [NSNumber numberWithFloat:0.0f];
((CHIPTestClusterClusterSimpleStruct *) temp_1[1]).h = [NSNumber numberWithDouble:0];
((CHIPTestClusterClusterNestedStructList *) params.arg1).d = temp_1;
}
{
NSMutableArray * temp_1 = [[NSMutableArray alloc] init];
temp_1[0] = [NSNumber numberWithUnsignedInt:1UL];
temp_1[1] = [NSNumber numberWithUnsignedInt:2UL];
temp_1[2] = [NSNumber numberWithUnsignedInt:3UL];
((CHIPTestClusterClusterNestedStructList *) params.arg1).e = temp_1;
}
{
NSMutableArray * temp_1 = [[NSMutableArray alloc] init];
temp_1[0] = [[NSData alloc] initWithBytes:"octet_string_1" length:14];
temp_1[1] = [[NSData alloc] initWithBytes:"octect_string_2" length:15];
temp_1[2] = [[NSData alloc] initWithBytes:"octet_string_3" length:14];
((CHIPTestClusterClusterNestedStructList *) params.arg1).f = temp_1;
}
{
NSMutableArray * temp_1 = [[NSMutableArray alloc] init];
temp_1[0] = [NSNumber numberWithUnsignedChar:0];
temp_1[1] = [NSNumber numberWithUnsignedChar:255];
((CHIPTestClusterClusterNestedStructList *) params.arg1).g = temp_1;
}
[cluster testNestedStructListArgumentRequestWithParams:params
completionHandler:^(CHIPTestClusterClusterBooleanResponseParams * _Nullable values,
NSError * _Nullable err) {
NSLog(@"Send Test Command With Nested Struct List Argument and some fields b of "
@"arg1.d are false Error: %@",
err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = values.value;
XCTAssertEqual([actualValue boolValue], false);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTestCluster_000155_SimpleStructEchoRequest
{
XCTestExpectation * expectation =
[self expectationWithDescription:@"Send Test Command With Struct Argument and see what we get back"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
__auto_type * params = [[CHIPTestClusterClusterSimpleStructEchoRequestParams alloc] init];
params.arg1 = [[CHIPTestClusterClusterSimpleStruct alloc] init];
((CHIPTestClusterClusterSimpleStruct *) params.arg1).a = [NSNumber numberWithUnsignedChar:17];
((CHIPTestClusterClusterSimpleStruct *) params.arg1).b = [NSNumber numberWithBool:false];
((CHIPTestClusterClusterSimpleStruct *) params.arg1).c = [NSNumber numberWithUnsignedChar:2];
((CHIPTestClusterClusterSimpleStruct *) params.arg1).d = [[NSData alloc] initWithBytes:"octet_string" length:12];
((CHIPTestClusterClusterSimpleStruct *) params.arg1).e = @"char_string";
((CHIPTestClusterClusterSimpleStruct *) params.arg1).f = [NSNumber numberWithUnsignedChar:1];
((CHIPTestClusterClusterSimpleStruct *) params.arg1).g = [NSNumber numberWithFloat:0.1f];
((CHIPTestClusterClusterSimpleStruct *) params.arg1).h = [NSNumber numberWithDouble:0.1];
[cluster simpleStructEchoRequestWithParams:params
completionHandler:^(
CHIPTestClusterClusterSimpleStructResponseParams * _Nullable values, NSError * _Nullable err) {
NSLog(@"Send Test Command With Struct Argument and see what we get back Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = values.arg1;
XCTAssertEqual([((CHIPTestClusterClusterSimpleStruct *) actualValue).a unsignedCharValue], 17);
XCTAssertEqual([((CHIPTestClusterClusterSimpleStruct *) actualValue).b boolValue], false);
XCTAssertEqual([((CHIPTestClusterClusterSimpleStruct *) actualValue).c unsignedCharValue], 2);
XCTAssertTrue([((CHIPTestClusterClusterSimpleStruct *) actualValue).d
isEqualToData:[[NSData alloc] initWithBytes:"octet_string" length:12]]);
XCTAssertTrue(
[((CHIPTestClusterClusterSimpleStruct *) actualValue).e isEqualToString:@"char_string"]);
XCTAssertEqual([((CHIPTestClusterClusterSimpleStruct *) actualValue).f unsignedCharValue], 1);
XCTAssertEqual([((CHIPTestClusterClusterSimpleStruct *) actualValue).g floatValue], 0.1f);
XCTAssertEqual([((CHIPTestClusterClusterSimpleStruct *) actualValue).h doubleValue], 0.1);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTestCluster_000156_TestListInt8UArgumentRequest
{
XCTestExpectation * expectation =
[self expectationWithDescription:@"Send Test Command With List of INT8U and none of them is set to 0"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
__auto_type * params = [[CHIPTestClusterClusterTestListInt8UArgumentRequestParams alloc] init];
{
NSMutableArray * temp_0 = [[NSMutableArray alloc] init];
temp_0[0] = [NSNumber numberWithUnsignedChar:1];
temp_0[1] = [NSNumber numberWithUnsignedChar:2];
temp_0[2] = [NSNumber numberWithUnsignedChar:3];
temp_0[3] = [NSNumber numberWithUnsignedChar:4];
temp_0[4] = [NSNumber numberWithUnsignedChar:5];
temp_0[5] = [NSNumber numberWithUnsignedChar:6];
temp_0[6] = [NSNumber numberWithUnsignedChar:7];
temp_0[7] = [NSNumber numberWithUnsignedChar:8];
temp_0[8] = [NSNumber numberWithUnsignedChar:9];
params.arg1 = temp_0;
}
[cluster testListInt8UArgumentRequestWithParams:params
completionHandler:^(
CHIPTestClusterClusterBooleanResponseParams * _Nullable values, NSError * _Nullable err) {
NSLog(@"Send Test Command With List of INT8U and none of them is set to 0 Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = values.value;
XCTAssertEqual([actualValue boolValue], true);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTestCluster_000157_TestListInt8UArgumentRequest
{
XCTestExpectation * expectation =
[self expectationWithDescription:@"Send Test Command With List of INT8U and one of them is set to 0"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
__auto_type * params = [[CHIPTestClusterClusterTestListInt8UArgumentRequestParams alloc] init];
{
NSMutableArray * temp_0 = [[NSMutableArray alloc] init];
temp_0[0] = [NSNumber numberWithUnsignedChar:1];
temp_0[1] = [NSNumber numberWithUnsignedChar:2];
temp_0[2] = [NSNumber numberWithUnsignedChar:3];
temp_0[3] = [NSNumber numberWithUnsignedChar:4];
temp_0[4] = [NSNumber numberWithUnsignedChar:5];
temp_0[5] = [NSNumber numberWithUnsignedChar:6];
temp_0[6] = [NSNumber numberWithUnsignedChar:7];
temp_0[7] = [NSNumber numberWithUnsignedChar:8];
temp_0[8] = [NSNumber numberWithUnsignedChar:9];
temp_0[9] = [NSNumber numberWithUnsignedChar:0];
params.arg1 = temp_0;
}
[cluster testListInt8UArgumentRequestWithParams:params
completionHandler:^(
CHIPTestClusterClusterBooleanResponseParams * _Nullable values, NSError * _Nullable err) {
NSLog(@"Send Test Command With List of INT8U and one of them is set to 0 Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = values.value;
XCTAssertEqual([actualValue boolValue], false);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTestCluster_000158_TestListInt8UReverseRequest
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Send Test Command With List of INT8U and get it reversed"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
__auto_type * params = [[CHIPTestClusterClusterTestListInt8UReverseRequestParams alloc] init];
{
NSMutableArray * temp_0 = [[NSMutableArray alloc] init];
temp_0[0] = [NSNumber numberWithUnsignedChar:1];
temp_0[1] = [NSNumber numberWithUnsignedChar:2];
temp_0[2] = [NSNumber numberWithUnsignedChar:3];
temp_0[3] = [NSNumber numberWithUnsignedChar:4];
temp_0[4] = [NSNumber numberWithUnsignedChar:5];
temp_0[5] = [NSNumber numberWithUnsignedChar:6];
temp_0[6] = [NSNumber numberWithUnsignedChar:7];
temp_0[7] = [NSNumber numberWithUnsignedChar:8];
temp_0[8] = [NSNumber numberWithUnsignedChar:9];
params.arg1 = temp_0;
}
[cluster testListInt8UReverseRequestWithParams:params
completionHandler:^(CHIPTestClusterClusterTestListInt8UReverseResponseParams * _Nullable values,
NSError * _Nullable err) {
NSLog(@"Send Test Command With List of INT8U and get it reversed Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = values.arg1;
XCTAssertEqual([actualValue count], 9);
XCTAssertEqual([actualValue[0] unsignedCharValue], 9);
XCTAssertEqual([actualValue[1] unsignedCharValue], 8);
XCTAssertEqual([actualValue[2] unsignedCharValue], 7);
XCTAssertEqual([actualValue[3] unsignedCharValue], 6);
XCTAssertEqual([actualValue[4] unsignedCharValue], 5);
XCTAssertEqual([actualValue[5] unsignedCharValue], 4);
XCTAssertEqual([actualValue[6] unsignedCharValue], 3);
XCTAssertEqual([actualValue[7] unsignedCharValue], 2);
XCTAssertEqual([actualValue[8] unsignedCharValue], 1);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTestCluster_000159_TestListInt8UReverseRequest
{
XCTestExpectation * expectation =
[self expectationWithDescription:@"Send Test Command With empty List of INT8U and get an empty list back"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
__auto_type * params = [[CHIPTestClusterClusterTestListInt8UReverseRequestParams alloc] init];
{
NSMutableArray * temp_0 = [[NSMutableArray alloc] init];
params.arg1 = temp_0;
}
[cluster testListInt8UReverseRequestWithParams:params
completionHandler:^(CHIPTestClusterClusterTestListInt8UReverseResponseParams * _Nullable values,
NSError * _Nullable err) {
NSLog(@"Send Test Command With empty List of INT8U and get an empty list back Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = values.arg1;
XCTAssertEqual([actualValue count], 0);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTestCluster_000160_TestListStructArgumentRequest
{
XCTestExpectation * expectation =
[self expectationWithDescription:@"Send Test Command With List of Struct Argument and arg1.b of first item is true"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
__auto_type * params = [[CHIPTestClusterClusterTestListStructArgumentRequestParams alloc] init];
{
NSMutableArray * temp_0 = [[NSMutableArray alloc] init];
temp_0[0] = [[CHIPTestClusterClusterSimpleStruct alloc] init];
((CHIPTestClusterClusterSimpleStruct *) temp_0[0]).a = [NSNumber numberWithUnsignedChar:0];
((CHIPTestClusterClusterSimpleStruct *) temp_0[0]).b = [NSNumber numberWithBool:true];
((CHIPTestClusterClusterSimpleStruct *) temp_0[0]).c = [NSNumber numberWithUnsignedChar:2];
((CHIPTestClusterClusterSimpleStruct *) temp_0[0]).d = [[NSData alloc] initWithBytes:"first_octet_string" length:18];
((CHIPTestClusterClusterSimpleStruct *) temp_0[0]).e = @"first_char_string";
((CHIPTestClusterClusterSimpleStruct *) temp_0[0]).f = [NSNumber numberWithUnsignedChar:1];
((CHIPTestClusterClusterSimpleStruct *) temp_0[0]).g = [NSNumber numberWithFloat:0.0f];
((CHIPTestClusterClusterSimpleStruct *) temp_0[0]).h = [NSNumber numberWithDouble:0];
temp_0[1] = [[CHIPTestClusterClusterSimpleStruct alloc] init];
((CHIPTestClusterClusterSimpleStruct *) temp_0[1]).a = [NSNumber numberWithUnsignedChar:1];
((CHIPTestClusterClusterSimpleStruct *) temp_0[1]).b = [NSNumber numberWithBool:true];
((CHIPTestClusterClusterSimpleStruct *) temp_0[1]).c = [NSNumber numberWithUnsignedChar:3];
((CHIPTestClusterClusterSimpleStruct *) temp_0[1]).d = [[NSData alloc] initWithBytes:"second_octet_string" length:19];
((CHIPTestClusterClusterSimpleStruct *) temp_0[1]).e = @"second_char_string";
((CHIPTestClusterClusterSimpleStruct *) temp_0[1]).f = [NSNumber numberWithUnsignedChar:1];
((CHIPTestClusterClusterSimpleStruct *) temp_0[1]).g = [NSNumber numberWithFloat:0.0f];
((CHIPTestClusterClusterSimpleStruct *) temp_0[1]).h = [NSNumber numberWithDouble:0];
params.arg1 = temp_0;
}
[cluster
testListStructArgumentRequestWithParams:params
completionHandler:^(
CHIPTestClusterClusterBooleanResponseParams * _Nullable values, NSError * _Nullable err) {
NSLog(
@"Send Test Command With List of Struct Argument and arg1.b of first item is true Error: %@",
err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = values.value;
XCTAssertEqual([actualValue boolValue], true);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTestCluster_000161_TestListStructArgumentRequest
{
XCTestExpectation * expectation =
[self expectationWithDescription:@"Send Test Command With List of Struct Argument and arg1.b of first item is false"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
__auto_type * params = [[CHIPTestClusterClusterTestListStructArgumentRequestParams alloc] init];
{
NSMutableArray * temp_0 = [[NSMutableArray alloc] init];
temp_0[0] = [[CHIPTestClusterClusterSimpleStruct alloc] init];
((CHIPTestClusterClusterSimpleStruct *) temp_0[0]).a = [NSNumber numberWithUnsignedChar:1];
((CHIPTestClusterClusterSimpleStruct *) temp_0[0]).b = [NSNumber numberWithBool:true];
((CHIPTestClusterClusterSimpleStruct *) temp_0[0]).c = [NSNumber numberWithUnsignedChar:3];
((CHIPTestClusterClusterSimpleStruct *) temp_0[0]).d = [[NSData alloc] initWithBytes:"second_octet_string" length:19];
((CHIPTestClusterClusterSimpleStruct *) temp_0[0]).e = @"second_char_string";
((CHIPTestClusterClusterSimpleStruct *) temp_0[0]).f = [NSNumber numberWithUnsignedChar:1];
((CHIPTestClusterClusterSimpleStruct *) temp_0[0]).g = [NSNumber numberWithFloat:0.0f];
((CHIPTestClusterClusterSimpleStruct *) temp_0[0]).h = [NSNumber numberWithDouble:0];
temp_0[1] = [[CHIPTestClusterClusterSimpleStruct alloc] init];
((CHIPTestClusterClusterSimpleStruct *) temp_0[1]).a = [NSNumber numberWithUnsignedChar:0];
((CHIPTestClusterClusterSimpleStruct *) temp_0[1]).b = [NSNumber numberWithBool:false];
((CHIPTestClusterClusterSimpleStruct *) temp_0[1]).c = [NSNumber numberWithUnsignedChar:2];
((CHIPTestClusterClusterSimpleStruct *) temp_0[1]).d = [[NSData alloc] initWithBytes:"first_octet_string" length:18];
((CHIPTestClusterClusterSimpleStruct *) temp_0[1]).e = @"first_char_string";
((CHIPTestClusterClusterSimpleStruct *) temp_0[1]).f = [NSNumber numberWithUnsignedChar:1];
((CHIPTestClusterClusterSimpleStruct *) temp_0[1]).g = [NSNumber numberWithFloat:0.0f];
((CHIPTestClusterClusterSimpleStruct *) temp_0[1]).h = [NSNumber numberWithDouble:0];
params.arg1 = temp_0;
}
[cluster
testListStructArgumentRequestWithParams:params
completionHandler:^(
CHIPTestClusterClusterBooleanResponseParams * _Nullable values, NSError * _Nullable err) {
NSLog(
@"Send Test Command With List of Struct Argument and arg1.b of first item is false Error: %@",
err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = values.value;
XCTAssertEqual([actualValue boolValue], false);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTestCluster_000162_TestListNestedStructListArgumentRequest
{
XCTestExpectation * expectation =
[self expectationWithDescription:
@"Send Test Command With List of Nested Struct List Argument and all fields b of elements of arg1.d are true"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
__auto_type * params = [[CHIPTestClusterClusterTestListNestedStructListArgumentRequestParams alloc] init];
{
NSMutableArray * temp_0 = [[NSMutableArray alloc] init];
temp_0[0] = [[CHIPTestClusterClusterNestedStructList alloc] init];
((CHIPTestClusterClusterNestedStructList *) temp_0[0]).a = [NSNumber numberWithUnsignedChar:0];
((CHIPTestClusterClusterNestedStructList *) temp_0[0]).b = [NSNumber numberWithBool:true];
((CHIPTestClusterClusterNestedStructList *) temp_0[0]).c = [[CHIPTestClusterClusterSimpleStruct alloc] init];
((CHIPTestClusterClusterSimpleStruct *) ((CHIPTestClusterClusterNestedStructList *) temp_0[0]).c).a =
[NSNumber numberWithUnsignedChar:0];
((CHIPTestClusterClusterSimpleStruct *) ((CHIPTestClusterClusterNestedStructList *) temp_0[0]).c).b =
[NSNumber numberWithBool:true];
((CHIPTestClusterClusterSimpleStruct *) ((CHIPTestClusterClusterNestedStructList *) temp_0[0]).c).c =
[NSNumber numberWithUnsignedChar:2];
((CHIPTestClusterClusterSimpleStruct *) ((CHIPTestClusterClusterNestedStructList *) temp_0[0]).c).d =
[[NSData alloc] initWithBytes:"octet_string" length:12];
((CHIPTestClusterClusterSimpleStruct *) ((CHIPTestClusterClusterNestedStructList *) temp_0[0]).c).e = @"char_string";
((CHIPTestClusterClusterSimpleStruct *) ((CHIPTestClusterClusterNestedStructList *) temp_0[0]).c).f =
[NSNumber numberWithUnsignedChar:1];
((CHIPTestClusterClusterSimpleStruct *) ((CHIPTestClusterClusterNestedStructList *) temp_0[0]).c).g =
[NSNumber numberWithFloat:0.0f];
((CHIPTestClusterClusterSimpleStruct *) ((CHIPTestClusterClusterNestedStructList *) temp_0[0]).c).h =
[NSNumber numberWithDouble:0];
{
NSMutableArray * temp_2 = [[NSMutableArray alloc] init];
temp_2[0] = [[CHIPTestClusterClusterSimpleStruct alloc] init];
((CHIPTestClusterClusterSimpleStruct *) temp_2[0]).a = [NSNumber numberWithUnsignedChar:1];
((CHIPTestClusterClusterSimpleStruct *) temp_2[0]).b = [NSNumber numberWithBool:true];
((CHIPTestClusterClusterSimpleStruct *) temp_2[0]).c = [NSNumber numberWithUnsignedChar:3];
((CHIPTestClusterClusterSimpleStruct *) temp_2[0]).d = [[NSData alloc] initWithBytes:"nested_octet_string" length:19];
((CHIPTestClusterClusterSimpleStruct *) temp_2[0]).e = @"nested_char_string";
((CHIPTestClusterClusterSimpleStruct *) temp_2[0]).f = [NSNumber numberWithUnsignedChar:1];
((CHIPTestClusterClusterSimpleStruct *) temp_2[0]).g = [NSNumber numberWithFloat:0.0f];
((CHIPTestClusterClusterSimpleStruct *) temp_2[0]).h = [NSNumber numberWithDouble:0];
temp_2[1] = [[CHIPTestClusterClusterSimpleStruct alloc] init];
((CHIPTestClusterClusterSimpleStruct *) temp_2[1]).a = [NSNumber numberWithUnsignedChar:2];
((CHIPTestClusterClusterSimpleStruct *) temp_2[1]).b = [NSNumber numberWithBool:true];
((CHIPTestClusterClusterSimpleStruct *) temp_2[1]).c = [NSNumber numberWithUnsignedChar:3];
((CHIPTestClusterClusterSimpleStruct *) temp_2[1]).d = [[NSData alloc] initWithBytes:"nested_octet_string" length:19];
((CHIPTestClusterClusterSimpleStruct *) temp_2[1]).e = @"nested_char_string";
((CHIPTestClusterClusterSimpleStruct *) temp_2[1]).f = [NSNumber numberWithUnsignedChar:1];
((CHIPTestClusterClusterSimpleStruct *) temp_2[1]).g = [NSNumber numberWithFloat:0.0f];
((CHIPTestClusterClusterSimpleStruct *) temp_2[1]).h = [NSNumber numberWithDouble:0];
((CHIPTestClusterClusterNestedStructList *) temp_0[0]).d = temp_2;
}
{
NSMutableArray * temp_2 = [[NSMutableArray alloc] init];
temp_2[0] = [NSNumber numberWithUnsignedInt:1UL];
temp_2[1] = [NSNumber numberWithUnsignedInt:2UL];
temp_2[2] = [NSNumber numberWithUnsignedInt:3UL];
((CHIPTestClusterClusterNestedStructList *) temp_0[0]).e = temp_2;
}
{
NSMutableArray * temp_2 = [[NSMutableArray alloc] init];
temp_2[0] = [[NSData alloc] initWithBytes:"octet_string_1" length:14];
temp_2[1] = [[NSData alloc] initWithBytes:"octect_string_2" length:15];
temp_2[2] = [[NSData alloc] initWithBytes:"octet_string_3" length:14];
((CHIPTestClusterClusterNestedStructList *) temp_0[0]).f = temp_2;
}
{
NSMutableArray * temp_2 = [[NSMutableArray alloc] init];
temp_2[0] = [NSNumber numberWithUnsignedChar:0];
temp_2[1] = [NSNumber numberWithUnsignedChar:255];
((CHIPTestClusterClusterNestedStructList *) temp_0[0]).g = temp_2;
}
params.arg1 = temp_0;
}
[cluster testListNestedStructListArgumentRequestWithParams:params
completionHandler:^(CHIPTestClusterClusterBooleanResponseParams * _Nullable values,
NSError * _Nullable err) {
NSLog(@"Send Test Command With List of Nested Struct List Argument and all fields "
@"b of elements of arg1.d are true Error: %@",
err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = values.value;
XCTAssertEqual([actualValue boolValue], true);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTestCluster_000163_TestListNestedStructListArgumentRequest
{
XCTestExpectation * expectation =
[self expectationWithDescription:
@"Send Test Command With Nested Struct List Argument and some fields b of elements of arg1.d are false"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
__auto_type * params = [[CHIPTestClusterClusterTestListNestedStructListArgumentRequestParams alloc] init];
{
NSMutableArray * temp_0 = [[NSMutableArray alloc] init];
temp_0[0] = [[CHIPTestClusterClusterNestedStructList alloc] init];
((CHIPTestClusterClusterNestedStructList *) temp_0[0]).a = [NSNumber numberWithUnsignedChar:0];
((CHIPTestClusterClusterNestedStructList *) temp_0[0]).b = [NSNumber numberWithBool:true];
((CHIPTestClusterClusterNestedStructList *) temp_0[0]).c = [[CHIPTestClusterClusterSimpleStruct alloc] init];
((CHIPTestClusterClusterSimpleStruct *) ((CHIPTestClusterClusterNestedStructList *) temp_0[0]).c).a =
[NSNumber numberWithUnsignedChar:0];
((CHIPTestClusterClusterSimpleStruct *) ((CHIPTestClusterClusterNestedStructList *) temp_0[0]).c).b =
[NSNumber numberWithBool:true];
((CHIPTestClusterClusterSimpleStruct *) ((CHIPTestClusterClusterNestedStructList *) temp_0[0]).c).c =
[NSNumber numberWithUnsignedChar:2];
((CHIPTestClusterClusterSimpleStruct *) ((CHIPTestClusterClusterNestedStructList *) temp_0[0]).c).d =
[[NSData alloc] initWithBytes:"octet_string" length:12];
((CHIPTestClusterClusterSimpleStruct *) ((CHIPTestClusterClusterNestedStructList *) temp_0[0]).c).e = @"char_string";
((CHIPTestClusterClusterSimpleStruct *) ((CHIPTestClusterClusterNestedStructList *) temp_0[0]).c).f =
[NSNumber numberWithUnsignedChar:1];
((CHIPTestClusterClusterSimpleStruct *) ((CHIPTestClusterClusterNestedStructList *) temp_0[0]).c).g =
[NSNumber numberWithFloat:0.0f];
((CHIPTestClusterClusterSimpleStruct *) ((CHIPTestClusterClusterNestedStructList *) temp_0[0]).c).h =
[NSNumber numberWithDouble:0];
{
NSMutableArray * temp_2 = [[NSMutableArray alloc] init];
temp_2[0] = [[CHIPTestClusterClusterSimpleStruct alloc] init];
((CHIPTestClusterClusterSimpleStruct *) temp_2[0]).a = [NSNumber numberWithUnsignedChar:1];
((CHIPTestClusterClusterSimpleStruct *) temp_2[0]).b = [NSNumber numberWithBool:true];
((CHIPTestClusterClusterSimpleStruct *) temp_2[0]).c = [NSNumber numberWithUnsignedChar:3];
((CHIPTestClusterClusterSimpleStruct *) temp_2[0]).d = [[NSData alloc] initWithBytes:"nested_octet_string" length:19];
((CHIPTestClusterClusterSimpleStruct *) temp_2[0]).e = @"nested_char_string";
((CHIPTestClusterClusterSimpleStruct *) temp_2[0]).f = [NSNumber numberWithUnsignedChar:1];
((CHIPTestClusterClusterSimpleStruct *) temp_2[0]).g = [NSNumber numberWithFloat:0.0f];
((CHIPTestClusterClusterSimpleStruct *) temp_2[0]).h = [NSNumber numberWithDouble:0];
temp_2[1] = [[CHIPTestClusterClusterSimpleStruct alloc] init];
((CHIPTestClusterClusterSimpleStruct *) temp_2[1]).a = [NSNumber numberWithUnsignedChar:2];
((CHIPTestClusterClusterSimpleStruct *) temp_2[1]).b = [NSNumber numberWithBool:false];
((CHIPTestClusterClusterSimpleStruct *) temp_2[1]).c = [NSNumber numberWithUnsignedChar:3];
((CHIPTestClusterClusterSimpleStruct *) temp_2[1]).d = [[NSData alloc] initWithBytes:"nested_octet_string" length:19];
((CHIPTestClusterClusterSimpleStruct *) temp_2[1]).e = @"nested_char_string";
((CHIPTestClusterClusterSimpleStruct *) temp_2[1]).f = [NSNumber numberWithUnsignedChar:1];
((CHIPTestClusterClusterSimpleStruct *) temp_2[1]).g = [NSNumber numberWithFloat:0.0f];
((CHIPTestClusterClusterSimpleStruct *) temp_2[1]).h = [NSNumber numberWithDouble:0];
((CHIPTestClusterClusterNestedStructList *) temp_0[0]).d = temp_2;
}
{
NSMutableArray * temp_2 = [[NSMutableArray alloc] init];
temp_2[0] = [NSNumber numberWithUnsignedInt:1UL];
temp_2[1] = [NSNumber numberWithUnsignedInt:2UL];
temp_2[2] = [NSNumber numberWithUnsignedInt:3UL];
((CHIPTestClusterClusterNestedStructList *) temp_0[0]).e = temp_2;
}
{
NSMutableArray * temp_2 = [[NSMutableArray alloc] init];
temp_2[0] = [[NSData alloc] initWithBytes:"octet_string_1" length:14];
temp_2[1] = [[NSData alloc] initWithBytes:"octect_string_2" length:15];
temp_2[2] = [[NSData alloc] initWithBytes:"octet_string_3" length:14];
((CHIPTestClusterClusterNestedStructList *) temp_0[0]).f = temp_2;
}
{
NSMutableArray * temp_2 = [[NSMutableArray alloc] init];
temp_2[0] = [NSNumber numberWithUnsignedChar:0];
temp_2[1] = [NSNumber numberWithUnsignedChar:255];
((CHIPTestClusterClusterNestedStructList *) temp_0[0]).g = temp_2;
}
params.arg1 = temp_0;
}
[cluster testListNestedStructListArgumentRequestWithParams:params
completionHandler:^(CHIPTestClusterClusterBooleanResponseParams * _Nullable values,
NSError * _Nullable err) {
NSLog(@"Send Test Command With Nested Struct List Argument and some fields b of "
@"elements of arg1.d are false Error: %@",
err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = values.value;
XCTAssertEqual([actualValue boolValue], false);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTestCluster_000164_WriteAttribute
{
XCTestExpectation * expectation =
[self expectationWithDescription:@"Write attribute LIST With List of INT8U and none of them is set to 0"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
id listInt8uArgument;
{
NSMutableArray * temp_0 = [[NSMutableArray alloc] init];
temp_0[0] = [NSNumber numberWithUnsignedChar:1];
temp_0[1] = [NSNumber numberWithUnsignedChar:2];
temp_0[2] = [NSNumber numberWithUnsignedChar:3];
temp_0[3] = [NSNumber numberWithUnsignedChar:4];
listInt8uArgument = temp_0;
}
[cluster writeAttributeListInt8uWithValue:listInt8uArgument
completionHandler:^(NSError * _Nullable err) {
NSLog(@"Write attribute LIST With List of INT8U and none of them is set to 0 Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTestCluster_000165_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute LIST With List of INT8U"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeListInt8uWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) {
NSLog(@"Read attribute LIST With List of INT8U Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertEqual([actualValue count], 4);
XCTAssertEqual([actualValue[0] unsignedCharValue], 1);
XCTAssertEqual([actualValue[1] unsignedCharValue], 2);
XCTAssertEqual([actualValue[2] unsignedCharValue], 3);
XCTAssertEqual([actualValue[3] unsignedCharValue], 4);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTestCluster_000166_WriteAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Write attribute LIST With List of OCTET_STRING"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
id listOctetStringArgument;
{
NSMutableArray * temp_0 = [[NSMutableArray alloc] init];
temp_0[0] = [[NSData alloc] initWithBytes:"Test0" length:5];
temp_0[1] = [[NSData alloc] initWithBytes:"Test1" length:5];
temp_0[2] = [[NSData alloc] initWithBytes:"Test2" length:5];
temp_0[3] = [[NSData alloc] initWithBytes:"Test3" length:5];
listOctetStringArgument = temp_0;
}
[cluster writeAttributeListOctetStringWithValue:listOctetStringArgument
completionHandler:^(NSError * _Nullable err) {
NSLog(@"Write attribute LIST With List of OCTET_STRING Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTestCluster_000167_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute LIST With List of OCTET_STRING"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeListOctetStringWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) {
NSLog(@"Read attribute LIST With List of OCTET_STRING Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertEqual([actualValue count], 4);
XCTAssertTrue([actualValue[0] isEqualToData:[[NSData alloc] initWithBytes:"Test0" length:5]]);
XCTAssertTrue([actualValue[1] isEqualToData:[[NSData alloc] initWithBytes:"Test1" length:5]]);
XCTAssertTrue([actualValue[2] isEqualToData:[[NSData alloc] initWithBytes:"Test2" length:5]]);
XCTAssertTrue([actualValue[3] isEqualToData:[[NSData alloc] initWithBytes:"Test3" length:5]]);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTestCluster_000168_WriteAttribute
{
XCTestExpectation * expectation =
[self expectationWithDescription:@"Write attribute LIST With List of LIST_STRUCT_OCTET_STRING"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
id listStructOctetStringArgument;
{
NSMutableArray * temp_0 = [[NSMutableArray alloc] init];
temp_0[0] = [[CHIPTestClusterClusterTestListStructOctet alloc] init];
((CHIPTestClusterClusterTestListStructOctet *) temp_0[0]).fabricIndex = [NSNumber numberWithUnsignedLongLong:0ULL];
((CHIPTestClusterClusterTestListStructOctet *) temp_0[0]).operationalCert = [[NSData alloc] initWithBytes:"Test0" length:5];
temp_0[1] = [[CHIPTestClusterClusterTestListStructOctet alloc] init];
((CHIPTestClusterClusterTestListStructOctet *) temp_0[1]).fabricIndex = [NSNumber numberWithUnsignedLongLong:1ULL];
((CHIPTestClusterClusterTestListStructOctet *) temp_0[1]).operationalCert = [[NSData alloc] initWithBytes:"Test1" length:5];
temp_0[2] = [[CHIPTestClusterClusterTestListStructOctet alloc] init];
((CHIPTestClusterClusterTestListStructOctet *) temp_0[2]).fabricIndex = [NSNumber numberWithUnsignedLongLong:2ULL];
((CHIPTestClusterClusterTestListStructOctet *) temp_0[2]).operationalCert = [[NSData alloc] initWithBytes:"Test2" length:5];
temp_0[3] = [[CHIPTestClusterClusterTestListStructOctet alloc] init];
((CHIPTestClusterClusterTestListStructOctet *) temp_0[3]).fabricIndex = [NSNumber numberWithUnsignedLongLong:3ULL];
((CHIPTestClusterClusterTestListStructOctet *) temp_0[3]).operationalCert = [[NSData alloc] initWithBytes:"Test3" length:5];
listStructOctetStringArgument = temp_0;
}
[cluster writeAttributeListStructOctetStringWithValue:listStructOctetStringArgument
completionHandler:^(NSError * _Nullable err) {
NSLog(@"Write attribute LIST With List of LIST_STRUCT_OCTET_STRING Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTestCluster_000169_ReadAttribute
{
XCTestExpectation * expectation =
[self expectationWithDescription:@"Read attribute LIST With List of LIST_STRUCT_OCTET_STRING"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeListStructOctetStringWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) {
NSLog(@"Read attribute LIST With List of LIST_STRUCT_OCTET_STRING Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertEqual([actualValue count], 4);
XCTAssertEqual(
[((CHIPTestClusterClusterTestListStructOctet *) actualValue[0]).fabricIndex unsignedLongLongValue], 0ULL);
XCTAssertTrue([((CHIPTestClusterClusterTestListStructOctet *) actualValue[0]).operationalCert
isEqualToData:[[NSData alloc] initWithBytes:"Test0" length:5]]);
XCTAssertEqual(
[((CHIPTestClusterClusterTestListStructOctet *) actualValue[1]).fabricIndex unsignedLongLongValue], 1ULL);
XCTAssertTrue([((CHIPTestClusterClusterTestListStructOctet *) actualValue[1]).operationalCert
isEqualToData:[[NSData alloc] initWithBytes:"Test1" length:5]]);
XCTAssertEqual(
[((CHIPTestClusterClusterTestListStructOctet *) actualValue[2]).fabricIndex unsignedLongLongValue], 2ULL);
XCTAssertTrue([((CHIPTestClusterClusterTestListStructOctet *) actualValue[2]).operationalCert
isEqualToData:[[NSData alloc] initWithBytes:"Test2" length:5]]);
XCTAssertEqual(
[((CHIPTestClusterClusterTestListStructOctet *) actualValue[3]).fabricIndex unsignedLongLongValue], 3ULL);
XCTAssertTrue([((CHIPTestClusterClusterTestListStructOctet *) actualValue[3]).operationalCert
isEqualToData:[[NSData alloc] initWithBytes:"Test3" length:5]]);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTestCluster_000170_TestNullableOptionalRequest
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Send Test Command with optional arg set."];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
__auto_type * params = [[CHIPTestClusterClusterTestNullableOptionalRequestParams alloc] init];
params.arg1 = [NSNumber numberWithUnsignedChar:5];
[cluster testNullableOptionalRequestWithParams:params
completionHandler:^(CHIPTestClusterClusterTestNullableOptionalResponseParams * _Nullable values,
NSError * _Nullable err) {
NSLog(@"Send Test Command with optional arg set. Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = values.wasPresent;
XCTAssertEqual([actualValue boolValue], true);
}
{
id actualValue = values.wasNull;
XCTAssertEqual([actualValue boolValue], false);
}
{
id actualValue = values.value;
XCTAssertEqual([actualValue unsignedCharValue], 5);
}
{
id actualValue = values.originalValue;
XCTAssertFalse(actualValue == nil);
XCTAssertEqual([actualValue unsignedCharValue], 5);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTestCluster_000171_TestNullableOptionalRequest
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Send Test Command without its optional arg."];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
__auto_type * params = [[CHIPTestClusterClusterTestNullableOptionalRequestParams alloc] init];
[cluster testNullableOptionalRequestWithParams:params
completionHandler:^(CHIPTestClusterClusterTestNullableOptionalResponseParams * _Nullable values,
NSError * _Nullable err) {
NSLog(@"Send Test Command without its optional arg. Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = values.wasPresent;
XCTAssertEqual([actualValue boolValue], false);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTestCluster_000172_WriteAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Write attribute NULLABLE_BOOLEAN null"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
id nullableBooleanArgument;
nullableBooleanArgument = nil;
[cluster writeAttributeNullableBooleanWithValue:nullableBooleanArgument
completionHandler:^(NSError * _Nullable err) {
NSLog(@"Write attribute NULLABLE_BOOLEAN null Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTestCluster_000173_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute NULLABLE_BOOLEAN null"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeNullableBooleanWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"Read attribute NULLABLE_BOOLEAN null Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertTrue(actualValue == nil);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTestCluster_000174_WriteAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Write attribute NULLABLE_BOOLEAN True"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
id nullableBooleanArgument;
nullableBooleanArgument = [NSNumber numberWithBool:true];
[cluster writeAttributeNullableBooleanWithValue:nullableBooleanArgument
completionHandler:^(NSError * _Nullable err) {
NSLog(@"Write attribute NULLABLE_BOOLEAN True Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTestCluster_000175_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute NULLABLE_BOOLEAN True"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeNullableBooleanWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"Read attribute NULLABLE_BOOLEAN True Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertFalse(actualValue == nil);
XCTAssertEqual([actualValue boolValue], true);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTestCluster_000176_WriteAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Write attribute NULLABLE_BITMAP8 Max Value"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
id nullableBitmap8Argument;
nullableBitmap8Argument = [NSNumber numberWithUnsignedChar:254];
[cluster writeAttributeNullableBitmap8WithValue:nullableBitmap8Argument
completionHandler:^(NSError * _Nullable err) {
NSLog(@"Write attribute NULLABLE_BITMAP8 Max Value Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTestCluster_000177_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute NULLABLE_BITMAP8 Max Value"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeNullableBitmap8WithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"Read attribute NULLABLE_BITMAP8 Max Value Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertFalse(actualValue == nil);
XCTAssertEqual([actualValue unsignedCharValue], 254);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTestCluster_000178_WriteAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Write attribute NULLABLE_BITMAP8 Invalid Value"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
id nullableBitmap8Argument;
nullableBitmap8Argument = [NSNumber numberWithUnsignedChar:255];
[cluster
writeAttributeNullableBitmap8WithValue:nullableBitmap8Argument
completionHandler:^(NSError * _Nullable err) {
NSLog(@"Write attribute NULLABLE_BITMAP8 Invalid Value Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], EMBER_ZCL_STATUS_CONSTRAINT_ERROR);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTestCluster_000179_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute NULLABLE_BITMAP8 unchanged Value"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeNullableBitmap8WithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"Read attribute NULLABLE_BITMAP8 unchanged Value Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertFalse(actualValue == nil);
XCTAssertEqual([actualValue unsignedCharValue], 254);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTestCluster_000180_WriteAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Write attribute NULLABLE_BITMAP8 null Value"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
id nullableBitmap8Argument;
nullableBitmap8Argument = nil;
[cluster writeAttributeNullableBitmap8WithValue:nullableBitmap8Argument
completionHandler:^(NSError * _Nullable err) {
NSLog(@"Write attribute NULLABLE_BITMAP8 null Value Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTestCluster_000181_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute NULLABLE_BITMAP8 null Value"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeNullableBitmap8WithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"Read attribute NULLABLE_BITMAP8 null Value Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertTrue(actualValue == nil);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTestCluster_000182_WriteAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Write attribute NULLABLE_BITMAP16 Max Value"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
id nullableBitmap16Argument;
nullableBitmap16Argument = [NSNumber numberWithUnsignedShort:65534U];
[cluster writeAttributeNullableBitmap16WithValue:nullableBitmap16Argument
completionHandler:^(NSError * _Nullable err) {
NSLog(@"Write attribute NULLABLE_BITMAP16 Max Value Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTestCluster_000183_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute NULLABLE_BITMAP16 Max Value"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeNullableBitmap16WithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"Read attribute NULLABLE_BITMAP16 Max Value Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertFalse(actualValue == nil);
XCTAssertEqual([actualValue unsignedShortValue], 65534U);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTestCluster_000184_WriteAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Write attribute NULLABLE_BITMAP16 Invalid Value"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
id nullableBitmap16Argument;
nullableBitmap16Argument = [NSNumber numberWithUnsignedShort:65535U];
[cluster
writeAttributeNullableBitmap16WithValue:nullableBitmap16Argument
completionHandler:^(NSError * _Nullable err) {
NSLog(@"Write attribute NULLABLE_BITMAP16 Invalid Value Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], EMBER_ZCL_STATUS_CONSTRAINT_ERROR);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTestCluster_000185_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute NULLABLE_BITMAP16 unchanged Value"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeNullableBitmap16WithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"Read attribute NULLABLE_BITMAP16 unchanged Value Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertFalse(actualValue == nil);
XCTAssertEqual([actualValue unsignedShortValue], 65534U);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTestCluster_000186_WriteAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Write attribute NULLABLE_BITMAP16 null Value"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
id nullableBitmap16Argument;
nullableBitmap16Argument = nil;
[cluster writeAttributeNullableBitmap16WithValue:nullableBitmap16Argument
completionHandler:^(NSError * _Nullable err) {
NSLog(@"Write attribute NULLABLE_BITMAP16 null Value Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTestCluster_000187_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute NULLABLE_BITMAP16 null Value"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeNullableBitmap16WithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"Read attribute NULLABLE_BITMAP16 null Value Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertTrue(actualValue == nil);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTestCluster_000188_WriteAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Write attribute NULLABLE_BITMAP32 Max Value"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
id nullableBitmap32Argument;
nullableBitmap32Argument = [NSNumber numberWithUnsignedInt:4294967294UL];
[cluster writeAttributeNullableBitmap32WithValue:nullableBitmap32Argument
completionHandler:^(NSError * _Nullable err) {
NSLog(@"Write attribute NULLABLE_BITMAP32 Max Value Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTestCluster_000189_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute NULLABLE_BITMAP32 Max Value"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeNullableBitmap32WithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"Read attribute NULLABLE_BITMAP32 Max Value Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertFalse(actualValue == nil);
XCTAssertEqual([actualValue unsignedIntValue], 4294967294UL);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTestCluster_000190_WriteAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Write attribute NULLABLE_BITMAP32 Invalid Value"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
id nullableBitmap32Argument;
nullableBitmap32Argument = [NSNumber numberWithUnsignedInt:4294967295UL];
[cluster
writeAttributeNullableBitmap32WithValue:nullableBitmap32Argument
completionHandler:^(NSError * _Nullable err) {
NSLog(@"Write attribute NULLABLE_BITMAP32 Invalid Value Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], EMBER_ZCL_STATUS_CONSTRAINT_ERROR);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTestCluster_000191_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute NULLABLE_BITMAP32 unchanged Value"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeNullableBitmap32WithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"Read attribute NULLABLE_BITMAP32 unchanged Value Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertFalse(actualValue == nil);
XCTAssertEqual([actualValue unsignedIntValue], 4294967294UL);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTestCluster_000192_WriteAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Write attribute NULLABLE_BITMAP32 null Value"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
id nullableBitmap32Argument;
nullableBitmap32Argument = nil;
[cluster writeAttributeNullableBitmap32WithValue:nullableBitmap32Argument
completionHandler:^(NSError * _Nullable err) {
NSLog(@"Write attribute NULLABLE_BITMAP32 null Value Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTestCluster_000193_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute NULLABLE_BITMAP32 null Value"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeNullableBitmap32WithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"Read attribute NULLABLE_BITMAP32 null Value Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertTrue(actualValue == nil);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTestCluster_000194_WriteAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Write attribute NULLABLE_BITMAP64 Max Value"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
id nullableBitmap64Argument;
nullableBitmap64Argument = [NSNumber numberWithUnsignedLongLong:18446744073709551614ULL];
[cluster writeAttributeNullableBitmap64WithValue:nullableBitmap64Argument
completionHandler:^(NSError * _Nullable err) {
NSLog(@"Write attribute NULLABLE_BITMAP64 Max Value Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTestCluster_000195_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute NULLABLE_BITMAP64 Max Value"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeNullableBitmap64WithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"Read attribute NULLABLE_BITMAP64 Max Value Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertFalse(actualValue == nil);
XCTAssertEqual([actualValue unsignedLongLongValue], 18446744073709551614ULL);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTestCluster_000196_WriteAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Write attribute NULLABLE_BITMAP64 Invalid Value"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
id nullableBitmap64Argument;
nullableBitmap64Argument = [NSNumber numberWithUnsignedLongLong:18446744073709551615ULL];
[cluster
writeAttributeNullableBitmap64WithValue:nullableBitmap64Argument
completionHandler:^(NSError * _Nullable err) {
NSLog(@"Write attribute NULLABLE_BITMAP64 Invalid Value Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], EMBER_ZCL_STATUS_CONSTRAINT_ERROR);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTestCluster_000197_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute NULLABLE_BITMAP64 unchanged Value"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeNullableBitmap64WithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"Read attribute NULLABLE_BITMAP64 unchanged Value Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertFalse(actualValue == nil);
XCTAssertEqual([actualValue unsignedLongLongValue], 18446744073709551614ULL);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTestCluster_000198_WriteAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Write attribute NULLABLE_BITMAP64 null Value"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
id nullableBitmap64Argument;
nullableBitmap64Argument = nil;
[cluster writeAttributeNullableBitmap64WithValue:nullableBitmap64Argument
completionHandler:^(NSError * _Nullable err) {
NSLog(@"Write attribute NULLABLE_BITMAP64 null Value Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTestCluster_000199_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute NULLABLE_BITMAP64 null Value"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeNullableBitmap64WithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"Read attribute NULLABLE_BITMAP64 null Value Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertTrue(actualValue == nil);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTestCluster_000200_WriteAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Write attribute NULLABLE_INT8U Max Value"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
id nullableInt8uArgument;
nullableInt8uArgument = [NSNumber numberWithUnsignedChar:254];
[cluster writeAttributeNullableInt8uWithValue:nullableInt8uArgument
completionHandler:^(NSError * _Nullable err) {
NSLog(@"Write attribute NULLABLE_INT8U Max Value Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTestCluster_000201_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute NULLABLE_INT8U Max Value"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeNullableInt8uWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"Read attribute NULLABLE_INT8U Max Value Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertFalse(actualValue == nil);
XCTAssertEqual([actualValue unsignedCharValue], 254);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTestCluster_000202_WriteAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Write attribute NULLABLE_INT8U Invalid Value"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
id nullableInt8uArgument;
nullableInt8uArgument = [NSNumber numberWithUnsignedChar:255];
[cluster writeAttributeNullableInt8uWithValue:nullableInt8uArgument
completionHandler:^(NSError * _Nullable err) {
NSLog(@"Write attribute NULLABLE_INT8U Invalid Value Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], EMBER_ZCL_STATUS_CONSTRAINT_ERROR);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTestCluster_000203_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute NULLABLE_INT8U unchanged Value"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeNullableInt8uWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"Read attribute NULLABLE_INT8U unchanged Value Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertFalse(actualValue == nil);
XCTAssertEqual([actualValue unsignedCharValue], 254);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTestCluster_000204_WriteAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Write attribute NULLABLE_INT8U null Value"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
id nullableInt8uArgument;
nullableInt8uArgument = nil;
[cluster writeAttributeNullableInt8uWithValue:nullableInt8uArgument
completionHandler:^(NSError * _Nullable err) {
NSLog(@"Write attribute NULLABLE_INT8U null Value Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTestCluster_000205_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute NULLABLE_INT8U null Value"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeNullableInt8uWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"Read attribute NULLABLE_INT8U null Value Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertTrue(actualValue == nil);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTestCluster_000206_WriteAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Write attribute NULLABLE_INT16U Max Value"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
id nullableInt16uArgument;
nullableInt16uArgument = [NSNumber numberWithUnsignedShort:65534U];
[cluster writeAttributeNullableInt16uWithValue:nullableInt16uArgument
completionHandler:^(NSError * _Nullable err) {
NSLog(@"Write attribute NULLABLE_INT16U Max Value Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTestCluster_000207_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute NULLABLE_INT16U Max Value"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeNullableInt16uWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"Read attribute NULLABLE_INT16U Max Value Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertFalse(actualValue == nil);
XCTAssertEqual([actualValue unsignedShortValue], 65534U);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTestCluster_000208_WriteAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Write attribute NULLABLE_INT16U Invalid Value"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
id nullableInt16uArgument;
nullableInt16uArgument = [NSNumber numberWithUnsignedShort:65535U];
[cluster
writeAttributeNullableInt16uWithValue:nullableInt16uArgument
completionHandler:^(NSError * _Nullable err) {
NSLog(@"Write attribute NULLABLE_INT16U Invalid Value Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], EMBER_ZCL_STATUS_CONSTRAINT_ERROR);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTestCluster_000209_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute NULLABLE_INT16U unchanged Value"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeNullableInt16uWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"Read attribute NULLABLE_INT16U unchanged Value Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertFalse(actualValue == nil);
XCTAssertEqual([actualValue unsignedShortValue], 65534U);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTestCluster_000210_WriteAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Write attribute NULLABLE_INT16U null Value"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
id nullableInt16uArgument;
nullableInt16uArgument = nil;
[cluster writeAttributeNullableInt16uWithValue:nullableInt16uArgument
completionHandler:^(NSError * _Nullable err) {
NSLog(@"Write attribute NULLABLE_INT16U null Value Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTestCluster_000211_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute NULLABLE_INT16U null Value"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeNullableInt16uWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"Read attribute NULLABLE_INT16U null Value Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertTrue(actualValue == nil);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTestCluster_000212_WriteAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Write attribute NULLABLE_INT32U Max Value"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
id nullableInt32uArgument;
nullableInt32uArgument = [NSNumber numberWithUnsignedInt:4294967294UL];
[cluster writeAttributeNullableInt32uWithValue:nullableInt32uArgument
completionHandler:^(NSError * _Nullable err) {
NSLog(@"Write attribute NULLABLE_INT32U Max Value Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTestCluster_000213_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute NULLABLE_INT32U Max Value"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeNullableInt32uWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"Read attribute NULLABLE_INT32U Max Value Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertFalse(actualValue == nil);
XCTAssertEqual([actualValue unsignedIntValue], 4294967294UL);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTestCluster_000214_WriteAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Write attribute NULLABLE_INT32U Invalid Value"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
id nullableInt32uArgument;
nullableInt32uArgument = [NSNumber numberWithUnsignedInt:4294967295UL];
[cluster
writeAttributeNullableInt32uWithValue:nullableInt32uArgument
completionHandler:^(NSError * _Nullable err) {
NSLog(@"Write attribute NULLABLE_INT32U Invalid Value Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], EMBER_ZCL_STATUS_CONSTRAINT_ERROR);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTestCluster_000215_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute NULLABLE_INT32U unchanged Value"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeNullableInt32uWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"Read attribute NULLABLE_INT32U unchanged Value Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertFalse(actualValue == nil);
XCTAssertEqual([actualValue unsignedIntValue], 4294967294UL);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTestCluster_000216_WriteAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Write attribute NULLABLE_INT32U null Value"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
id nullableInt32uArgument;
nullableInt32uArgument = nil;
[cluster writeAttributeNullableInt32uWithValue:nullableInt32uArgument
completionHandler:^(NSError * _Nullable err) {
NSLog(@"Write attribute NULLABLE_INT32U null Value Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTestCluster_000217_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute NULLABLE_INT32U null Value"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeNullableInt32uWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"Read attribute NULLABLE_INT32U null Value Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertTrue(actualValue == nil);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTestCluster_000218_WriteAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Write attribute NULLABLE_INT64U Max Value"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
id nullableInt64uArgument;
nullableInt64uArgument = [NSNumber numberWithUnsignedLongLong:18446744073709551614ULL];
[cluster writeAttributeNullableInt64uWithValue:nullableInt64uArgument
completionHandler:^(NSError * _Nullable err) {
NSLog(@"Write attribute NULLABLE_INT64U Max Value Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTestCluster_000219_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute NULLABLE_INT64U Max Value"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeNullableInt64uWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"Read attribute NULLABLE_INT64U Max Value Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertFalse(actualValue == nil);
XCTAssertEqual([actualValue unsignedLongLongValue], 18446744073709551614ULL);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTestCluster_000220_WriteAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Write attribute NULLABLE_INT64U Invalid Value"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
id nullableInt64uArgument;
nullableInt64uArgument = [NSNumber numberWithUnsignedLongLong:18446744073709551615ULL];
[cluster
writeAttributeNullableInt64uWithValue:nullableInt64uArgument
completionHandler:^(NSError * _Nullable err) {
NSLog(@"Write attribute NULLABLE_INT64U Invalid Value Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], EMBER_ZCL_STATUS_CONSTRAINT_ERROR);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTestCluster_000221_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute NULLABLE_INT64U unchanged Value"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeNullableInt64uWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"Read attribute NULLABLE_INT64U unchanged Value Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertFalse(actualValue == nil);
XCTAssertEqual([actualValue unsignedLongLongValue], 18446744073709551614ULL);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTestCluster_000222_WriteAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Write attribute NULLABLE_INT64U null Value"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
id nullableInt64uArgument;
nullableInt64uArgument = nil;
[cluster writeAttributeNullableInt64uWithValue:nullableInt64uArgument
completionHandler:^(NSError * _Nullable err) {
NSLog(@"Write attribute NULLABLE_INT64U null Value Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTestCluster_000223_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute NULLABLE_INT64U null Value"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeNullableInt64uWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"Read attribute NULLABLE_INT64U null Value Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertTrue(actualValue == nil);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTestCluster_000224_WriteAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Write attribute NULLABLE_INT8S Min Value"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
id nullableInt8sArgument;
nullableInt8sArgument = [NSNumber numberWithChar:-127];
[cluster writeAttributeNullableInt8sWithValue:nullableInt8sArgument
completionHandler:^(NSError * _Nullable err) {
NSLog(@"Write attribute NULLABLE_INT8S Min Value Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTestCluster_000225_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute NULLABLE_INT8S Min Value"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeNullableInt8sWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"Read attribute NULLABLE_INT8S Min Value Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertFalse(actualValue == nil);
XCTAssertEqual([actualValue charValue], -127);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTestCluster_000226_WriteAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Write attribute NULLABLE_INT8S Invalid Value"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
id nullableInt8sArgument;
nullableInt8sArgument = [NSNumber numberWithChar:-128];
[cluster writeAttributeNullableInt8sWithValue:nullableInt8sArgument
completionHandler:^(NSError * _Nullable err) {
NSLog(@"Write attribute NULLABLE_INT8S Invalid Value Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], EMBER_ZCL_STATUS_CONSTRAINT_ERROR);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTestCluster_000227_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute NULLABLE_INT8S unchanged Value"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeNullableInt8sWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"Read attribute NULLABLE_INT8S unchanged Value Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertFalse(actualValue == nil);
XCTAssertEqual([actualValue charValue], -127);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTestCluster_000228_WriteAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Write attribute NULLABLE_INT8S null Value"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
id nullableInt8sArgument;
nullableInt8sArgument = nil;
[cluster writeAttributeNullableInt8sWithValue:nullableInt8sArgument
completionHandler:^(NSError * _Nullable err) {
NSLog(@"Write attribute NULLABLE_INT8S null Value Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTestCluster_000229_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute NULLABLE_INT8S null Value"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeNullableInt8sWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"Read attribute NULLABLE_INT8S null Value Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertTrue(actualValue == nil);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTestCluster_000230_WriteAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Write attribute NULLABLE_INT16S Min Value"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
id nullableInt16sArgument;
nullableInt16sArgument = [NSNumber numberWithShort:-32767];
[cluster writeAttributeNullableInt16sWithValue:nullableInt16sArgument
completionHandler:^(NSError * _Nullable err) {
NSLog(@"Write attribute NULLABLE_INT16S Min Value Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTestCluster_000231_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute NULLABLE_INT16S Min Value"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeNullableInt16sWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"Read attribute NULLABLE_INT16S Min Value Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertFalse(actualValue == nil);
XCTAssertEqual([actualValue shortValue], -32767);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTestCluster_000232_WriteAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Write attribute NULLABLE_INT16S Invalid Value"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
id nullableInt16sArgument;
nullableInt16sArgument = [NSNumber numberWithShort:-32768];
[cluster
writeAttributeNullableInt16sWithValue:nullableInt16sArgument
completionHandler:^(NSError * _Nullable err) {
NSLog(@"Write attribute NULLABLE_INT16S Invalid Value Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], EMBER_ZCL_STATUS_CONSTRAINT_ERROR);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTestCluster_000233_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute NULLABLE_INT16S unchanged Value"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeNullableInt16sWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"Read attribute NULLABLE_INT16S unchanged Value Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertFalse(actualValue == nil);
XCTAssertEqual([actualValue shortValue], -32767);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTestCluster_000234_WriteAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Write attribute NULLABLE_INT16S null Value"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
id nullableInt16sArgument;
nullableInt16sArgument = nil;
[cluster writeAttributeNullableInt16sWithValue:nullableInt16sArgument
completionHandler:^(NSError * _Nullable err) {
NSLog(@"Write attribute NULLABLE_INT16S null Value Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTestCluster_000235_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute NULLABLE_INT16S null Value"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeNullableInt16sWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"Read attribute NULLABLE_INT16S null Value Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertTrue(actualValue == nil);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTestCluster_000236_WriteAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Write attribute NULLABLE_INT32S Min Value"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
id nullableInt32sArgument;
nullableInt32sArgument = [NSNumber numberWithInt:-2147483647L];
[cluster writeAttributeNullableInt32sWithValue:nullableInt32sArgument
completionHandler:^(NSError * _Nullable err) {
NSLog(@"Write attribute NULLABLE_INT32S Min Value Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTestCluster_000237_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute NULLABLE_INT32S Min Value"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeNullableInt32sWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"Read attribute NULLABLE_INT32S Min Value Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertFalse(actualValue == nil);
XCTAssertEqual([actualValue intValue], -2147483647L);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTestCluster_000238_WriteAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Write attribute NULLABLE_INT32S Invalid Value"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
id nullableInt32sArgument;
nullableInt32sArgument = [NSNumber numberWithInt:-2147483648L];
[cluster
writeAttributeNullableInt32sWithValue:nullableInt32sArgument
completionHandler:^(NSError * _Nullable err) {
NSLog(@"Write attribute NULLABLE_INT32S Invalid Value Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], EMBER_ZCL_STATUS_CONSTRAINT_ERROR);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTestCluster_000239_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute NULLABLE_INT32S unchanged Value"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeNullableInt32sWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"Read attribute NULLABLE_INT32S unchanged Value Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertFalse(actualValue == nil);
XCTAssertEqual([actualValue intValue], -2147483647L);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTestCluster_000240_WriteAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Write attribute NULLABLE_INT32S null Value"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
id nullableInt32sArgument;
nullableInt32sArgument = nil;
[cluster writeAttributeNullableInt32sWithValue:nullableInt32sArgument
completionHandler:^(NSError * _Nullable err) {
NSLog(@"Write attribute NULLABLE_INT32S null Value Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTestCluster_000241_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute NULLABLE_INT32S null Value"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeNullableInt32sWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"Read attribute NULLABLE_INT32S null Value Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertTrue(actualValue == nil);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTestCluster_000242_WriteAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Write attribute NULLABLE_INT64S Min Value"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
id nullableInt64sArgument;
nullableInt64sArgument = [NSNumber numberWithLongLong:-9223372036854775807LL];
[cluster writeAttributeNullableInt64sWithValue:nullableInt64sArgument
completionHandler:^(NSError * _Nullable err) {
NSLog(@"Write attribute NULLABLE_INT64S Min Value Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTestCluster_000243_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute NULLABLE_INT64S Min Value"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeNullableInt64sWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"Read attribute NULLABLE_INT64S Min Value Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertFalse(actualValue == nil);
XCTAssertEqual([actualValue longLongValue], -9223372036854775807LL);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTestCluster_000244_WriteAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Write attribute NULLABLE_INT64S Invalid Value"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
id nullableInt64sArgument;
nullableInt64sArgument = [NSNumber numberWithLongLong:-9223372036854775807LL - 1];
[cluster
writeAttributeNullableInt64sWithValue:nullableInt64sArgument
completionHandler:^(NSError * _Nullable err) {
NSLog(@"Write attribute NULLABLE_INT64S Invalid Value Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], EMBER_ZCL_STATUS_CONSTRAINT_ERROR);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTestCluster_000245_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute NULLABLE_INT64S unchanged Value"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeNullableInt64sWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"Read attribute NULLABLE_INT64S unchanged Value Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertFalse(actualValue == nil);
XCTAssertEqual([actualValue longLongValue], -9223372036854775807LL);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTestCluster_000246_WriteAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Write attribute NULLABLE_INT64S null Value"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
id nullableInt64sArgument;
nullableInt64sArgument = nil;
[cluster writeAttributeNullableInt64sWithValue:nullableInt64sArgument
completionHandler:^(NSError * _Nullable err) {
NSLog(@"Write attribute NULLABLE_INT64S null Value Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTestCluster_000247_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute NULLABLE_INT64S null Value"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeNullableInt64sWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"Read attribute NULLABLE_INT64S null Value Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertTrue(actualValue == nil);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTestCluster_000248_WriteAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Write attribute NULLABLE_SINGLE medium Value"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
id nullableFloatSingleArgument;
nullableFloatSingleArgument = [NSNumber numberWithFloat:0.1f];
[cluster writeAttributeNullableFloatSingleWithValue:nullableFloatSingleArgument
completionHandler:^(NSError * _Nullable err) {
NSLog(@"Write attribute NULLABLE_SINGLE medium Value Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTestCluster_000249_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute NULLABLE_SINGLE medium Value"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeNullableFloatSingleWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"Read attribute NULLABLE_SINGLE medium Value Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertFalse(actualValue == nil);
XCTAssertEqual([actualValue floatValue], 0.1f);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTestCluster_000250_WriteAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Write attribute NULLABLE_SINGLE largest Value"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
id nullableFloatSingleArgument;
nullableFloatSingleArgument = [NSNumber numberWithFloat:INFINITY];
[cluster writeAttributeNullableFloatSingleWithValue:nullableFloatSingleArgument
completionHandler:^(NSError * _Nullable err) {
NSLog(@"Write attribute NULLABLE_SINGLE largest Value Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTestCluster_000251_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute NULLABLE_SINGLE largest Value"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeNullableFloatSingleWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"Read attribute NULLABLE_SINGLE largest Value Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertFalse(actualValue == nil);
XCTAssertEqual([actualValue floatValue], INFINITY);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTestCluster_000252_WriteAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Write attribute NULLABLE_SINGLE smallest Value"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
id nullableFloatSingleArgument;
nullableFloatSingleArgument = [NSNumber numberWithFloat:-INFINITY];
[cluster writeAttributeNullableFloatSingleWithValue:nullableFloatSingleArgument
completionHandler:^(NSError * _Nullable err) {
NSLog(@"Write attribute NULLABLE_SINGLE smallest Value Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTestCluster_000253_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute NULLABLE_SINGLE smallest Value"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeNullableFloatSingleWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"Read attribute NULLABLE_SINGLE smallest Value Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertFalse(actualValue == nil);
XCTAssertEqual([actualValue floatValue], -INFINITY);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTestCluster_000254_WriteAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Write attribute NULLABLE_SINGLE null Value"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
id nullableFloatSingleArgument;
nullableFloatSingleArgument = nil;
[cluster writeAttributeNullableFloatSingleWithValue:nullableFloatSingleArgument
completionHandler:^(NSError * _Nullable err) {
NSLog(@"Write attribute NULLABLE_SINGLE null Value Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTestCluster_000255_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute NULLABLE_SINGLE null Value"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeNullableFloatSingleWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"Read attribute NULLABLE_SINGLE null Value Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertTrue(actualValue == nil);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTestCluster_000256_WriteAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Write attribute NULLABLE_SINGLE 0 Value"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
id nullableFloatSingleArgument;
nullableFloatSingleArgument = [NSNumber numberWithFloat:0.0f];
[cluster writeAttributeNullableFloatSingleWithValue:nullableFloatSingleArgument
completionHandler:^(NSError * _Nullable err) {
NSLog(@"Write attribute NULLABLE_SINGLE 0 Value Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTestCluster_000257_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute NULLABLE_SINGLE 0 Value"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeNullableFloatSingleWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"Read attribute NULLABLE_SINGLE 0 Value Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertFalse(actualValue == nil);
XCTAssertEqual([actualValue floatValue], 0.0f);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTestCluster_000258_WriteAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Write attribute NULLABLE_DOUBLE medium Value"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
id nullableFloatDoubleArgument;
nullableFloatDoubleArgument = [NSNumber numberWithDouble:0.1234567890123];
[cluster writeAttributeNullableFloatDoubleWithValue:nullableFloatDoubleArgument
completionHandler:^(NSError * _Nullable err) {
NSLog(@"Write attribute NULLABLE_DOUBLE medium Value Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTestCluster_000259_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute NULLABLE_DOUBLE medium Value"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeNullableFloatDoubleWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"Read attribute NULLABLE_DOUBLE medium Value Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertFalse(actualValue == nil);
XCTAssertEqual([actualValue doubleValue], 0.1234567890123);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTestCluster_000260_WriteAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Write attribute NULLABLE_DOUBLE largest Value"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
id nullableFloatDoubleArgument;
nullableFloatDoubleArgument = [NSNumber numberWithDouble:INFINITY];
[cluster writeAttributeNullableFloatDoubleWithValue:nullableFloatDoubleArgument
completionHandler:^(NSError * _Nullable err) {
NSLog(@"Write attribute NULLABLE_DOUBLE largest Value Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTestCluster_000261_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute NULLABLE_DOUBLE largest Value"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeNullableFloatDoubleWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"Read attribute NULLABLE_DOUBLE largest Value Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertFalse(actualValue == nil);
XCTAssertEqual([actualValue doubleValue], INFINITY);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTestCluster_000262_WriteAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Write attribute NULLABLE_DOUBLE smallest Value"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
id nullableFloatDoubleArgument;
nullableFloatDoubleArgument = [NSNumber numberWithDouble:-INFINITY];
[cluster writeAttributeNullableFloatDoubleWithValue:nullableFloatDoubleArgument
completionHandler:^(NSError * _Nullable err) {
NSLog(@"Write attribute NULLABLE_DOUBLE smallest Value Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTestCluster_000263_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute NULLABLE_DOUBLE smallest Value"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeNullableFloatDoubleWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"Read attribute NULLABLE_DOUBLE smallest Value Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertFalse(actualValue == nil);
XCTAssertEqual([actualValue doubleValue], -INFINITY);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTestCluster_000264_WriteAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Write attribute NULLABLE_DOUBLE null Value"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
id nullableFloatDoubleArgument;
nullableFloatDoubleArgument = nil;
[cluster writeAttributeNullableFloatDoubleWithValue:nullableFloatDoubleArgument
completionHandler:^(NSError * _Nullable err) {
NSLog(@"Write attribute NULLABLE_DOUBLE null Value Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTestCluster_000265_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute NULLABLE_DOUBLE null Value"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeNullableFloatDoubleWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"Read attribute NULLABLE_DOUBLE null Value Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertTrue(actualValue == nil);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTestCluster_000266_WriteAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Write attribute NULLABLE_DOUBLE 0 Value"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
id nullableFloatDoubleArgument;
nullableFloatDoubleArgument = [NSNumber numberWithDouble:0];
[cluster writeAttributeNullableFloatDoubleWithValue:nullableFloatDoubleArgument
completionHandler:^(NSError * _Nullable err) {
NSLog(@"Write attribute NULLABLE_DOUBLE 0 Value Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTestCluster_000267_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute NULLABLE_DOUBLE 0 Value"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeNullableFloatDoubleWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"Read attribute NULLABLE_DOUBLE 0 Value Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertFalse(actualValue == nil);
XCTAssertEqual([actualValue doubleValue], 0);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTestCluster_000268_WriteAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Write attribute NULLABLE_ENUM8 Max Value"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
id nullableEnum8Argument;
nullableEnum8Argument = [NSNumber numberWithUnsignedChar:254];
[cluster writeAttributeNullableEnum8WithValue:nullableEnum8Argument
completionHandler:^(NSError * _Nullable err) {
NSLog(@"Write attribute NULLABLE_ENUM8 Max Value Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTestCluster_000269_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute NULLABLE_ENUM8 Max Value"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeNullableEnum8WithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"Read attribute NULLABLE_ENUM8 Max Value Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertFalse(actualValue == nil);
XCTAssertEqual([actualValue unsignedCharValue], 254);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTestCluster_000270_WriteAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Write attribute NULLABLE_ENUM8 Invalid Value"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
id nullableEnum8Argument;
nullableEnum8Argument = [NSNumber numberWithUnsignedChar:255];
[cluster writeAttributeNullableEnum8WithValue:nullableEnum8Argument
completionHandler:^(NSError * _Nullable err) {
NSLog(@"Write attribute NULLABLE_ENUM8 Invalid Value Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], EMBER_ZCL_STATUS_CONSTRAINT_ERROR);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTestCluster_000271_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute NULLABLE_ENUM8 unchanged Value"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeNullableEnum8WithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"Read attribute NULLABLE_ENUM8 unchanged Value Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertFalse(actualValue == nil);
XCTAssertEqual([actualValue unsignedCharValue], 254);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTestCluster_000272_WriteAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Write attribute NULLABLE_ENUM8 null Value"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
id nullableEnum8Argument;
nullableEnum8Argument = nil;
[cluster writeAttributeNullableEnum8WithValue:nullableEnum8Argument
completionHandler:^(NSError * _Nullable err) {
NSLog(@"Write attribute NULLABLE_ENUM8 null Value Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTestCluster_000273_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute NULLABLE_ENUM8 null Value"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeNullableEnum8WithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"Read attribute NULLABLE_ENUM8 null Value Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertTrue(actualValue == nil);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTestCluster_000274_WriteAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Write attribute NULLABLE_ENUM16 Max Value"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
id nullableEnum16Argument;
nullableEnum16Argument = [NSNumber numberWithUnsignedShort:65534U];
[cluster writeAttributeNullableEnum16WithValue:nullableEnum16Argument
completionHandler:^(NSError * _Nullable err) {
NSLog(@"Write attribute NULLABLE_ENUM16 Max Value Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTestCluster_000275_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute NULLABLE_ENUM16 Max Value"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeNullableEnum16WithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"Read attribute NULLABLE_ENUM16 Max Value Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertFalse(actualValue == nil);
XCTAssertEqual([actualValue unsignedShortValue], 65534U);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTestCluster_000276_WriteAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Write attribute NULLABLE_ENUM16 Invalid Value"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
id nullableEnum16Argument;
nullableEnum16Argument = [NSNumber numberWithUnsignedShort:65535U];
[cluster
writeAttributeNullableEnum16WithValue:nullableEnum16Argument
completionHandler:^(NSError * _Nullable err) {
NSLog(@"Write attribute NULLABLE_ENUM16 Invalid Value Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], EMBER_ZCL_STATUS_CONSTRAINT_ERROR);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTestCluster_000277_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute NULLABLE_ENUM16 unchanged Value"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeNullableEnum16WithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"Read attribute NULLABLE_ENUM16 unchanged Value Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertFalse(actualValue == nil);
XCTAssertEqual([actualValue unsignedShortValue], 65534U);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTestCluster_000278_WriteAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Write attribute NULLABLE_ENUM16 null Value"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
id nullableEnum16Argument;
nullableEnum16Argument = nil;
[cluster writeAttributeNullableEnum16WithValue:nullableEnum16Argument
completionHandler:^(NSError * _Nullable err) {
NSLog(@"Write attribute NULLABLE_ENUM16 null Value Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTestCluster_000279_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute NULLABLE_ENUM16 null Value"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeNullableEnum16WithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"Read attribute NULLABLE_ENUM16 null Value Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertTrue(actualValue == nil);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTestCluster_000280_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute NULLABLE_OCTET_STRING Default Value"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeNullableOctetStringWithCompletionHandler:^(NSData * _Nullable value, NSError * _Nullable err) {
NSLog(@"Read attribute NULLABLE_OCTET_STRING Default Value Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertFalse(actualValue == nil);
XCTAssertTrue([actualValue isEqualToData:[[NSData alloc] initWithBytes:"" length:0]]);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTestCluster_000281_WriteAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Write attribute NULLABLE_OCTET_STRING"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
id nullableOctetStringArgument;
nullableOctetStringArgument = [[NSData alloc] initWithBytes:"TestValue" length:9];
[cluster writeAttributeNullableOctetStringWithValue:nullableOctetStringArgument
completionHandler:^(NSError * _Nullable err) {
NSLog(@"Write attribute NULLABLE_OCTET_STRING Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTestCluster_000282_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute NULLABLE_OCTET_STRING"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeNullableOctetStringWithCompletionHandler:^(NSData * _Nullable value, NSError * _Nullable err) {
NSLog(@"Read attribute NULLABLE_OCTET_STRING Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertFalse(actualValue == nil);
XCTAssertTrue([actualValue isEqualToData:[[NSData alloc] initWithBytes:"TestValue" length:9]]);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTestCluster_000283_WriteAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Write attribute NULLABLE_OCTET_STRING"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
id nullableOctetStringArgument;
nullableOctetStringArgument = nil;
[cluster writeAttributeNullableOctetStringWithValue:nullableOctetStringArgument
completionHandler:^(NSError * _Nullable err) {
NSLog(@"Write attribute NULLABLE_OCTET_STRING Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTestCluster_000284_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute NULLABLE_OCTET_STRING"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeNullableOctetStringWithCompletionHandler:^(NSData * _Nullable value, NSError * _Nullable err) {
NSLog(@"Read attribute NULLABLE_OCTET_STRING Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertTrue(actualValue == nil);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTestCluster_000285_WriteAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Write attribute NULLABLE_OCTET_STRING"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
id nullableOctetStringArgument;
nullableOctetStringArgument = [[NSData alloc] initWithBytes:"" length:0];
[cluster writeAttributeNullableOctetStringWithValue:nullableOctetStringArgument
completionHandler:^(NSError * _Nullable err) {
NSLog(@"Write attribute NULLABLE_OCTET_STRING Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTestCluster_000286_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute NULLABLE_OCTET_STRING"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeNullableOctetStringWithCompletionHandler:^(NSData * _Nullable value, NSError * _Nullable err) {
NSLog(@"Read attribute NULLABLE_OCTET_STRING Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertFalse(actualValue == nil);
XCTAssertTrue([actualValue isEqualToData:[[NSData alloc] initWithBytes:"" length:0]]);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTestCluster_000287_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute NULLABLE_CHAR_STRING Default Value"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeNullableCharStringWithCompletionHandler:^(NSString * _Nullable value, NSError * _Nullable err) {
NSLog(@"Read attribute NULLABLE_CHAR_STRING Default Value Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertFalse(actualValue == nil);
XCTAssertTrue([actualValue isEqualToString:@""]);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTestCluster_000288_WriteAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Write attribute NULLABLE_CHAR_STRING"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
id nullableCharStringArgument;
nullableCharStringArgument = @"☉T☉";
[cluster writeAttributeNullableCharStringWithValue:nullableCharStringArgument
completionHandler:^(NSError * _Nullable err) {
NSLog(@"Write attribute NULLABLE_CHAR_STRING Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTestCluster_000289_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute NULLABLE_CHAR_STRING"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeNullableCharStringWithCompletionHandler:^(NSString * _Nullable value, NSError * _Nullable err) {
NSLog(@"Read attribute NULLABLE_CHAR_STRING Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertFalse(actualValue == nil);
XCTAssertTrue([actualValue isEqualToString:@"☉T☉"]);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTestCluster_000290_WriteAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Write attribute NULLABLE_CHAR_STRING - Value too long"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
id nullableCharStringArgument;
nullableCharStringArgument = nil;
[cluster writeAttributeNullableCharStringWithValue:nullableCharStringArgument
completionHandler:^(NSError * _Nullable err) {
NSLog(@"Write attribute NULLABLE_CHAR_STRING - Value too long Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTestCluster_000291_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute NULLABLE_CHAR_STRING"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeNullableCharStringWithCompletionHandler:^(NSString * _Nullable value, NSError * _Nullable err) {
NSLog(@"Read attribute NULLABLE_CHAR_STRING Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertTrue(actualValue == nil);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTestCluster_000292_WriteAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Write attribute NULLABLE_CHAR_STRING - Empty"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
id nullableCharStringArgument;
nullableCharStringArgument = @"";
[cluster writeAttributeNullableCharStringWithValue:nullableCharStringArgument
completionHandler:^(NSError * _Nullable err) {
NSLog(@"Write attribute NULLABLE_CHAR_STRING - Empty Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTestCluster_000293_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute NULLABLE_CHAR_STRING"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeNullableCharStringWithCompletionHandler:^(NSString * _Nullable value, NSError * _Nullable err) {
NSLog(@"Read attribute NULLABLE_CHAR_STRING Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertFalse(actualValue == nil);
XCTAssertTrue([actualValue isEqualToString:@""]);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTestCluster_000294_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute from nonexistent endpoint."];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:200 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeListInt8uWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) {
NSLog(@"Read attribute from nonexistent endpoint. Error: %@", err);
XCTAssertNotEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTestCluster_000295_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute from nonexistent cluster."];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:0 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeListInt8uWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) {
NSLog(@"Read attribute from nonexistent cluster. Error: %@", err);
XCTAssertNotEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTestCluster_000296_TestSimpleOptionalArgumentRequest
{
XCTestExpectation * expectation =
[self expectationWithDescription:@"Send a command that takes an optional parameter but do not set it."];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
__auto_type * params = [[CHIPTestClusterClusterTestSimpleOptionalArgumentRequestParams alloc] init];
[cluster
testSimpleOptionalArgumentRequestWithParams:params
completionHandler:^(NSError * _Nullable err) {
NSLog(@"Send a command that takes an optional parameter but do not set it. Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], EMBER_ZCL_STATUS_INVALID_VALUE);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTestCluster_000297_TestSimpleOptionalArgumentRequest
{
XCTestExpectation * expectation =
[self expectationWithDescription:@"Send a command that takes an optional parameter but do not set it."];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
__auto_type * params = [[CHIPTestClusterClusterTestSimpleOptionalArgumentRequestParams alloc] init];
params.arg1 = [NSNumber numberWithBool:1];
[cluster
testSimpleOptionalArgumentRequestWithParams:params
completionHandler:^(NSError * _Nullable err) {
NSLog(@"Send a command that takes an optional parameter but do not set it. Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTestSaveAs_000000_WaitForCommissionee
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"];
dispatch_queue_t queue = dispatch_get_main_queue();
WaitForCommissionee(expectation, queue);
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
uint8_t TestAddArgumentDefaultValue;
- (void)testSendClusterTestSaveAs_000001_TestAddArguments
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Send Test Add Arguments Command"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
__auto_type * params = [[CHIPTestClusterClusterTestAddArgumentsParams alloc] init];
params.arg1 = [NSNumber numberWithUnsignedChar:3];
params.arg2 = [NSNumber numberWithUnsignedChar:17];
[cluster testAddArgumentsWithParams:params
completionHandler:^(
CHIPTestClusterClusterTestAddArgumentsResponseParams * _Nullable values, NSError * _Nullable err) {
NSLog(@"Send Test Add Arguments Command Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = values.returnValue;
XCTAssertEqual([actualValue unsignedCharValue], 20);
TestAddArgumentDefaultValue = [actualValue unsignedCharValue];
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTestSaveAs_000002_TestAddArguments
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Send Test Add Arguments Command"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
__auto_type * params = [[CHIPTestClusterClusterTestAddArgumentsParams alloc] init];
params.arg1 = [NSNumber numberWithUnsignedChar:3];
params.arg2 = [NSNumber numberWithUnsignedChar:17];
[cluster testAddArgumentsWithParams:params
completionHandler:^(
CHIPTestClusterClusterTestAddArgumentsResponseParams * _Nullable values, NSError * _Nullable err) {
NSLog(@"Send Test Add Arguments Command Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = values.returnValue;
XCTAssertEqual([actualValue unsignedCharValue], TestAddArgumentDefaultValue);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTestSaveAs_000003_TestAddArguments
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Send Test Add Arguments Command"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
__auto_type * params = [[CHIPTestClusterClusterTestAddArgumentsParams alloc] init];
params.arg1 = [NSNumber numberWithUnsignedChar:3];
params.arg2 = [NSNumber numberWithUnsignedChar:TestAddArgumentDefaultValue];
[cluster testAddArgumentsWithParams:params
completionHandler:^(
CHIPTestClusterClusterTestAddArgumentsResponseParams * _Nullable values, NSError * _Nullable err) {
NSLog(@"Send Test Add Arguments Command Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = values.returnValue;
XCTAssertNotEqual([actualValue unsignedCharValue], TestAddArgumentDefaultValue);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
bool readAttributeBooleanDefaultValue;
- (void)testSendClusterTestSaveAs_000004_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute BOOLEAN Default Value"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeBooleanWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"Read attribute BOOLEAN Default Value Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertEqual([actualValue boolValue], 0);
readAttributeBooleanDefaultValue = [actualValue boolValue];
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTestSaveAs_000005_WriteAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Write attribute BOOLEAN Not Default Value"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
id booleanArgument;
booleanArgument = [NSNumber numberWithBool:1];
[cluster writeAttributeBooleanWithValue:booleanArgument
completionHandler:^(NSError * _Nullable err) {
NSLog(@"Write attribute BOOLEAN Not Default Value Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTestSaveAs_000006_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute BOOLEAN Not Default Value"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeBooleanWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"Read attribute BOOLEAN Not Default Value Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertNotEqual([actualValue boolValue], readAttributeBooleanDefaultValue);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTestSaveAs_000007_WriteAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Write attribute BOOLEAN DefaultValue"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
id booleanArgument;
booleanArgument = [NSNumber numberWithBool:readAttributeBooleanDefaultValue];
[cluster writeAttributeBooleanWithValue:booleanArgument
completionHandler:^(NSError * _Nullable err) {
NSLog(@"Write attribute BOOLEAN DefaultValue Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTestSaveAs_000008_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute BOOLEAN False"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeBooleanWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"Read attribute BOOLEAN False Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertEqual([actualValue boolValue], readAttributeBooleanDefaultValue);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
uint8_t readAttributeBitmap8DefaultValue;
- (void)testSendClusterTestSaveAs_000009_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute BITMAP8 Default Value"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeBitmap8WithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"Read attribute BITMAP8 Default Value Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertEqual([actualValue unsignedCharValue], 0);
readAttributeBitmap8DefaultValue = [actualValue unsignedCharValue];
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTestSaveAs_000010_WriteAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Write attribute BITMAP8 Not Default Value"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
id bitmap8Argument;
bitmap8Argument = [NSNumber numberWithUnsignedChar:1];
[cluster writeAttributeBitmap8WithValue:bitmap8Argument
completionHandler:^(NSError * _Nullable err) {
NSLog(@"Write attribute BITMAP8 Not Default Value Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTestSaveAs_000011_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute BITMAP8 Not Default Value"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeBitmap8WithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"Read attribute BITMAP8 Not Default Value Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertNotEqual([actualValue unsignedCharValue], readAttributeBitmap8DefaultValue);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTestSaveAs_000012_WriteAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Write attribute BITMAP8 Default Value"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
id bitmap8Argument;
bitmap8Argument = [NSNumber numberWithUnsignedChar:readAttributeBitmap8DefaultValue];
[cluster writeAttributeBitmap8WithValue:bitmap8Argument
completionHandler:^(NSError * _Nullable err) {
NSLog(@"Write attribute BITMAP8 Default Value Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTestSaveAs_000013_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute BITMAP8 Default Value"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeBitmap8WithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"Read attribute BITMAP8 Default Value Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertEqual([actualValue unsignedCharValue], readAttributeBitmap8DefaultValue);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
uint16_t readAttributeBitmap16DefaultValue;
- (void)testSendClusterTestSaveAs_000014_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute BITMAP16 Default Value"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeBitmap16WithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"Read attribute BITMAP16 Default Value Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertEqual([actualValue unsignedShortValue], 0U);
readAttributeBitmap16DefaultValue = [actualValue unsignedShortValue];
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTestSaveAs_000015_WriteAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Write attribute BITMAP16 Not Default Value"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
id bitmap16Argument;
bitmap16Argument = [NSNumber numberWithUnsignedShort:1U];
[cluster writeAttributeBitmap16WithValue:bitmap16Argument
completionHandler:^(NSError * _Nullable err) {
NSLog(@"Write attribute BITMAP16 Not Default Value Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTestSaveAs_000016_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute BITMAP16 Not Default Value"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeBitmap16WithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"Read attribute BITMAP16 Not Default Value Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertNotEqual([actualValue unsignedShortValue], readAttributeBitmap16DefaultValue);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTestSaveAs_000017_WriteAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Write attribute BITMAP16 Default Value"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
id bitmap16Argument;
bitmap16Argument = [NSNumber numberWithUnsignedShort:readAttributeBitmap16DefaultValue];
[cluster writeAttributeBitmap16WithValue:bitmap16Argument
completionHandler:^(NSError * _Nullable err) {
NSLog(@"Write attribute BITMAP16 Default Value Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTestSaveAs_000018_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute BITMAP16 Default Value"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeBitmap16WithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"Read attribute BITMAP16 Default Value Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertEqual([actualValue unsignedShortValue], readAttributeBitmap16DefaultValue);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
uint32_t readAttributeBitmap32DefaultValue;
- (void)testSendClusterTestSaveAs_000019_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute BITMAP32 Default Value"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeBitmap32WithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"Read attribute BITMAP32 Default Value Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertEqual([actualValue unsignedIntValue], 0UL);
readAttributeBitmap32DefaultValue = [actualValue unsignedIntValue];
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTestSaveAs_000020_WriteAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Write attribute BITMAP32 Not Default Value"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
id bitmap32Argument;
bitmap32Argument = [NSNumber numberWithUnsignedInt:1UL];
[cluster writeAttributeBitmap32WithValue:bitmap32Argument
completionHandler:^(NSError * _Nullable err) {
NSLog(@"Write attribute BITMAP32 Not Default Value Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTestSaveAs_000021_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute BITMAP32 Not Default Value"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeBitmap32WithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"Read attribute BITMAP32 Not Default Value Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertNotEqual([actualValue unsignedIntValue], readAttributeBitmap32DefaultValue);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTestSaveAs_000022_WriteAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Write attribute BITMAP32 Default Value"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
id bitmap32Argument;
bitmap32Argument = [NSNumber numberWithUnsignedInt:readAttributeBitmap32DefaultValue];
[cluster writeAttributeBitmap32WithValue:bitmap32Argument
completionHandler:^(NSError * _Nullable err) {
NSLog(@"Write attribute BITMAP32 Default Value Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTestSaveAs_000023_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute BITMAP32 Default Value"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeBitmap32WithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"Read attribute BITMAP32 Default Value Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertEqual([actualValue unsignedIntValue], readAttributeBitmap32DefaultValue);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
uint64_t readAttributeBitmap64DefaultValue;
- (void)testSendClusterTestSaveAs_000024_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute BITMAP64 Default Value"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeBitmap64WithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"Read attribute BITMAP64 Default Value Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertEqual([actualValue unsignedLongLongValue], 0ULL);
readAttributeBitmap64DefaultValue = [actualValue unsignedLongLongValue];
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTestSaveAs_000025_WriteAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Write attribute BITMAP64 Not Default Value"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
id bitmap64Argument;
bitmap64Argument = [NSNumber numberWithUnsignedLongLong:1ULL];
[cluster writeAttributeBitmap64WithValue:bitmap64Argument
completionHandler:^(NSError * _Nullable err) {
NSLog(@"Write attribute BITMAP64 Not Default Value Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTestSaveAs_000026_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute BITMAP64 Default Value"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeBitmap64WithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"Read attribute BITMAP64 Default Value Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertNotEqual([actualValue unsignedLongLongValue], readAttributeBitmap64DefaultValue);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTestSaveAs_000027_WriteAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Write attribute BITMAP64 Default Value"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
id bitmap64Argument;
bitmap64Argument = [NSNumber numberWithUnsignedLongLong:readAttributeBitmap64DefaultValue];
[cluster writeAttributeBitmap64WithValue:bitmap64Argument
completionHandler:^(NSError * _Nullable err) {
NSLog(@"Write attribute BITMAP64 Default Value Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTestSaveAs_000028_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute BITMAP64 Default Value"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeBitmap64WithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"Read attribute BITMAP64 Default Value Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertEqual([actualValue unsignedLongLongValue], readAttributeBitmap64DefaultValue);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
uint8_t readAttributeInt8uDefaultValue;
- (void)testSendClusterTestSaveAs_000029_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute INT8U Default Value"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeInt8uWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"Read attribute INT8U Default Value Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertEqual([actualValue unsignedCharValue], 0);
readAttributeInt8uDefaultValue = [actualValue unsignedCharValue];
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTestSaveAs_000030_WriteAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Write attribute INT8U Not Default Value"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
id int8uArgument;
int8uArgument = [NSNumber numberWithUnsignedChar:1];
[cluster writeAttributeInt8uWithValue:int8uArgument
completionHandler:^(NSError * _Nullable err) {
NSLog(@"Write attribute INT8U Not Default Value Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTestSaveAs_000031_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute INT8U Not Default Value"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeInt8uWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"Read attribute INT8U Not Default Value Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertNotEqual([actualValue unsignedCharValue], readAttributeInt8uDefaultValue);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTestSaveAs_000032_WriteAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Write attribute INT8U Default Value"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
id int8uArgument;
int8uArgument = [NSNumber numberWithUnsignedChar:readAttributeInt8uDefaultValue];
[cluster writeAttributeInt8uWithValue:int8uArgument
completionHandler:^(NSError * _Nullable err) {
NSLog(@"Write attribute INT8U Default Value Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTestSaveAs_000033_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute INT8U Default Value"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeInt8uWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"Read attribute INT8U Default Value Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertEqual([actualValue unsignedCharValue], readAttributeInt8uDefaultValue);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
uint16_t readAttributeInt16uDefaultValue;
- (void)testSendClusterTestSaveAs_000034_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute INT16U Default Value"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeInt16uWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"Read attribute INT16U Default Value Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertEqual([actualValue unsignedShortValue], 0U);
readAttributeInt16uDefaultValue = [actualValue unsignedShortValue];
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTestSaveAs_000035_WriteAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Write attribute INT16U Not Default Value"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
id int16uArgument;
int16uArgument = [NSNumber numberWithUnsignedShort:1U];
[cluster writeAttributeInt16uWithValue:int16uArgument
completionHandler:^(NSError * _Nullable err) {
NSLog(@"Write attribute INT16U Not Default Value Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTestSaveAs_000036_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute INT16U Not Default Value"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeInt16uWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"Read attribute INT16U Not Default Value Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertNotEqual([actualValue unsignedShortValue], readAttributeInt16uDefaultValue);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTestSaveAs_000037_WriteAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Write attribute INT16U Default Value"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
id int16uArgument;
int16uArgument = [NSNumber numberWithUnsignedShort:readAttributeInt16uDefaultValue];
[cluster writeAttributeInt16uWithValue:int16uArgument
completionHandler:^(NSError * _Nullable err) {
NSLog(@"Write attribute INT16U Default Value Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTestSaveAs_000038_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute INT16U Default Value"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeInt16uWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"Read attribute INT16U Default Value Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertEqual([actualValue unsignedShortValue], readAttributeInt16uDefaultValue);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
uint32_t readAttributeInt32uDefaultValue;
- (void)testSendClusterTestSaveAs_000039_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute INT32U Default Value"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeInt32uWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"Read attribute INT32U Default Value Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertEqual([actualValue unsignedIntValue], 0UL);
readAttributeInt32uDefaultValue = [actualValue unsignedIntValue];
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTestSaveAs_000040_WriteAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Write attribute INT32U Not Default Value"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
id int32uArgument;
int32uArgument = [NSNumber numberWithUnsignedInt:1UL];
[cluster writeAttributeInt32uWithValue:int32uArgument
completionHandler:^(NSError * _Nullable err) {
NSLog(@"Write attribute INT32U Not Default Value Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTestSaveAs_000041_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute INT32U Not Default Value"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeInt32uWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"Read attribute INT32U Not Default Value Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertNotEqual([actualValue unsignedIntValue], readAttributeInt32uDefaultValue);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTestSaveAs_000042_WriteAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Write attribute INT32U Default Value"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
id int32uArgument;
int32uArgument = [NSNumber numberWithUnsignedInt:readAttributeInt32uDefaultValue];
[cluster writeAttributeInt32uWithValue:int32uArgument
completionHandler:^(NSError * _Nullable err) {
NSLog(@"Write attribute INT32U Default Value Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTestSaveAs_000043_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute INT32U Default Value"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeInt32uWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"Read attribute INT32U Default Value Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertEqual([actualValue unsignedIntValue], readAttributeInt32uDefaultValue);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
uint64_t readAttributeInt64uDefaultValue;
- (void)testSendClusterTestSaveAs_000044_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute INT64U Default Value"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeInt64uWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"Read attribute INT64U Default Value Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertEqual([actualValue unsignedLongLongValue], 0ULL);
readAttributeInt64uDefaultValue = [actualValue unsignedLongLongValue];
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTestSaveAs_000045_WriteAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Write attribute INT64U Not Default Value"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
id int64uArgument;
int64uArgument = [NSNumber numberWithUnsignedLongLong:1ULL];
[cluster writeAttributeInt64uWithValue:int64uArgument
completionHandler:^(NSError * _Nullable err) {
NSLog(@"Write attribute INT64U Not Default Value Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTestSaveAs_000046_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute INT64U Not Default Value"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeInt64uWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"Read attribute INT64U Not Default Value Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertNotEqual([actualValue unsignedLongLongValue], readAttributeInt64uDefaultValue);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTestSaveAs_000047_WriteAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Write attribute INT64U Default Value"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
id int64uArgument;
int64uArgument = [NSNumber numberWithUnsignedLongLong:readAttributeInt64uDefaultValue];
[cluster writeAttributeInt64uWithValue:int64uArgument
completionHandler:^(NSError * _Nullable err) {
NSLog(@"Write attribute INT64U Default Value Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTestSaveAs_000048_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute INT64U Default Value"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeInt64uWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"Read attribute INT64U Default Value Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertEqual([actualValue unsignedLongLongValue], readAttributeInt64uDefaultValue);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
int8_t readAttributeInt8sDefaultValue;
- (void)testSendClusterTestSaveAs_000049_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute INT8S Default Value"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeInt8sWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"Read attribute INT8S Default Value Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertEqual([actualValue charValue], 0);
readAttributeInt8sDefaultValue = [actualValue charValue];
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTestSaveAs_000050_WriteAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Write attribute INT8S Not Default Value"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
id int8sArgument;
int8sArgument = [NSNumber numberWithChar:1];
[cluster writeAttributeInt8sWithValue:int8sArgument
completionHandler:^(NSError * _Nullable err) {
NSLog(@"Write attribute INT8S Not Default Value Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTestSaveAs_000051_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute INT8S Not Default Value"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeInt8sWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"Read attribute INT8S Not Default Value Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertNotEqual([actualValue charValue], readAttributeInt8sDefaultValue);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTestSaveAs_000052_WriteAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Write attribute INT8S Default Value"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
id int8sArgument;
int8sArgument = [NSNumber numberWithChar:readAttributeInt8sDefaultValue];
[cluster writeAttributeInt8sWithValue:int8sArgument
completionHandler:^(NSError * _Nullable err) {
NSLog(@"Write attribute INT8S Default Value Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTestSaveAs_000053_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute INT8S Default Value"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeInt8sWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"Read attribute INT8S Default Value Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertEqual([actualValue charValue], readAttributeInt8sDefaultValue);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
int16_t readAttributeInt16sDefaultValue;
- (void)testSendClusterTestSaveAs_000054_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute INT16S Default Value"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeInt16sWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"Read attribute INT16S Default Value Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertEqual([actualValue shortValue], 0);
readAttributeInt16sDefaultValue = [actualValue shortValue];
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTestSaveAs_000055_WriteAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Write attribute INT16S Not Default Value"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
id int16sArgument;
int16sArgument = [NSNumber numberWithShort:1];
[cluster writeAttributeInt16sWithValue:int16sArgument
completionHandler:^(NSError * _Nullable err) {
NSLog(@"Write attribute INT16S Not Default Value Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTestSaveAs_000056_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute INT16S Not Default Value"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeInt16sWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"Read attribute INT16S Not Default Value Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertNotEqual([actualValue shortValue], readAttributeInt16sDefaultValue);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTestSaveAs_000057_WriteAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Write attribute INT16S Default Value"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
id int16sArgument;
int16sArgument = [NSNumber numberWithShort:readAttributeInt16sDefaultValue];
[cluster writeAttributeInt16sWithValue:int16sArgument
completionHandler:^(NSError * _Nullable err) {
NSLog(@"Write attribute INT16S Default Value Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTestSaveAs_000058_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute INT16S Default Value"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeInt16sWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"Read attribute INT16S Default Value Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertEqual([actualValue shortValue], readAttributeInt16sDefaultValue);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
int32_t readAttributeInt32sDefaultValue;
- (void)testSendClusterTestSaveAs_000059_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute INT32S Default Value"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeInt32sWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"Read attribute INT32S Default Value Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertEqual([actualValue intValue], 0L);
readAttributeInt32sDefaultValue = [actualValue intValue];
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTestSaveAs_000060_WriteAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Write attribute INT32S Not Default Value"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
id int32sArgument;
int32sArgument = [NSNumber numberWithInt:1L];
[cluster writeAttributeInt32sWithValue:int32sArgument
completionHandler:^(NSError * _Nullable err) {
NSLog(@"Write attribute INT32S Not Default Value Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTestSaveAs_000061_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute INT32S Not Default Value"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeInt32sWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"Read attribute INT32S Not Default Value Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertNotEqual([actualValue intValue], readAttributeInt32sDefaultValue);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTestSaveAs_000062_WriteAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Write attribute INT32S Default Value"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
id int32sArgument;
int32sArgument = [NSNumber numberWithInt:readAttributeInt32sDefaultValue];
[cluster writeAttributeInt32sWithValue:int32sArgument
completionHandler:^(NSError * _Nullable err) {
NSLog(@"Write attribute INT32S Default Value Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTestSaveAs_000063_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute INT32S Default Value"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeInt32sWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"Read attribute INT32S Default Value Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertEqual([actualValue intValue], readAttributeInt32sDefaultValue);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
int64_t readAttributeInt64sDefaultValue;
- (void)testSendClusterTestSaveAs_000064_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute INT64S Default Value"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeInt64sWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"Read attribute INT64S Default Value Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertEqual([actualValue longLongValue], 0LL);
readAttributeInt64sDefaultValue = [actualValue longLongValue];
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTestSaveAs_000065_WriteAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Write attribute INTS Not Default Value"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
id int64sArgument;
int64sArgument = [NSNumber numberWithLongLong:1LL];
[cluster writeAttributeInt64sWithValue:int64sArgument
completionHandler:^(NSError * _Nullable err) {
NSLog(@"Write attribute INTS Not Default Value Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTestSaveAs_000066_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute INT64S Not Default Value"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeInt64sWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"Read attribute INT64S Not Default Value Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertNotEqual([actualValue longLongValue], readAttributeInt64sDefaultValue);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTestSaveAs_000067_WriteAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Write attribute INT64S Default Value"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
id int64sArgument;
int64sArgument = [NSNumber numberWithLongLong:readAttributeInt64sDefaultValue];
[cluster writeAttributeInt64sWithValue:int64sArgument
completionHandler:^(NSError * _Nullable err) {
NSLog(@"Write attribute INT64S Default Value Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTestSaveAs_000068_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute INT64S Default Value"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeInt64sWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"Read attribute INT64S Default Value Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertEqual([actualValue longLongValue], readAttributeInt64sDefaultValue);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
uint8_t readAttributeEnum8DefaultValue;
- (void)testSendClusterTestSaveAs_000069_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute ENUM8 Default Value"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeEnum8WithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"Read attribute ENUM8 Default Value Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertEqual([actualValue unsignedCharValue], 0);
readAttributeEnum8DefaultValue = [actualValue unsignedCharValue];
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTestSaveAs_000070_WriteAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Write attribute ENUM8 Not Default Value"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
id enum8Argument;
enum8Argument = [NSNumber numberWithUnsignedChar:1];
[cluster writeAttributeEnum8WithValue:enum8Argument
completionHandler:^(NSError * _Nullable err) {
NSLog(@"Write attribute ENUM8 Not Default Value Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTestSaveAs_000071_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute ENUM8 Not Default Value"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeEnum8WithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"Read attribute ENUM8 Not Default Value Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertNotEqual([actualValue unsignedCharValue], readAttributeEnum8DefaultValue);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTestSaveAs_000072_WriteAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Write attribute ENUM8 Default Value"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
id enum8Argument;
enum8Argument = [NSNumber numberWithUnsignedChar:readAttributeEnum8DefaultValue];
[cluster writeAttributeEnum8WithValue:enum8Argument
completionHandler:^(NSError * _Nullable err) {
NSLog(@"Write attribute ENUM8 Default Value Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTestSaveAs_000073_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute ENUM8 Default Value"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeEnum8WithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"Read attribute ENUM8 Default Value Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertEqual([actualValue unsignedCharValue], readAttributeEnum8DefaultValue);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
uint16_t readAttributeEnum16DefaultValue;
- (void)testSendClusterTestSaveAs_000074_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute ENUM16 Default Value"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeEnum16WithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"Read attribute ENUM16 Default Value Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertEqual([actualValue unsignedShortValue], 0U);
readAttributeEnum16DefaultValue = [actualValue unsignedShortValue];
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTestSaveAs_000075_WriteAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Write attribute ENUM16 Not Default Value"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
id enum16Argument;
enum16Argument = [NSNumber numberWithUnsignedShort:1U];
[cluster writeAttributeEnum16WithValue:enum16Argument
completionHandler:^(NSError * _Nullable err) {
NSLog(@"Write attribute ENUM16 Not Default Value Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTestSaveAs_000076_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute ENUM16 Not Default Value"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeEnum16WithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"Read attribute ENUM16 Not Default Value Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertNotEqual([actualValue unsignedShortValue], readAttributeEnum16DefaultValue);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTestSaveAs_000077_WriteAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Write attribute ENUM16 Default Value"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
id enum16Argument;
enum16Argument = [NSNumber numberWithUnsignedShort:readAttributeEnum16DefaultValue];
[cluster writeAttributeEnum16WithValue:enum16Argument
completionHandler:^(NSError * _Nullable err) {
NSLog(@"Write attribute ENUM16 Default Value Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTestSaveAs_000078_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute ENUM16 Default Value"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeEnum16WithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"Read attribute ENUM16 Default Value Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertEqual([actualValue unsignedShortValue], readAttributeEnum16DefaultValue);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
uint64_t readAttributeEpochUSDefaultValue;
- (void)testSendClusterTestSaveAs_000079_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute EPOCH_US Default Value"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeEpochUsWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"Read attribute EPOCH_US Default Value Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertEqual([actualValue unsignedLongLongValue], 0ULL);
readAttributeEpochUSDefaultValue = [actualValue unsignedLongLongValue];
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTestSaveAs_000080_WriteAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Write attribute EPOCH_US Not Default Value"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
id epochUsArgument;
epochUsArgument = [NSNumber numberWithUnsignedLongLong:1ULL];
[cluster writeAttributeEpochUsWithValue:epochUsArgument
completionHandler:^(NSError * _Nullable err) {
NSLog(@"Write attribute EPOCH_US Not Default Value Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTestSaveAs_000081_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute EPOCH_US Not Default Value"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeEpochUsWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"Read attribute EPOCH_US Not Default Value Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertNotEqual([actualValue unsignedLongLongValue], readAttributeEpochUSDefaultValue);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTestSaveAs_000082_WriteAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Write attribute EPOCH_US Default Value"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
id epochUsArgument;
epochUsArgument = [NSNumber numberWithUnsignedLongLong:readAttributeEpochUSDefaultValue];
[cluster writeAttributeEpochUsWithValue:epochUsArgument
completionHandler:^(NSError * _Nullable err) {
NSLog(@"Write attribute EPOCH_US Default Value Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTestSaveAs_000083_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute EPOCH_US Default Value"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeEpochUsWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"Read attribute EPOCH_US Default Value Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertEqual([actualValue unsignedLongLongValue], readAttributeEpochUSDefaultValue);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
uint32_t readAttributeEpochSDefaultValue;
- (void)testSendClusterTestSaveAs_000084_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute EPOCH_S Default Value"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeEpochSWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"Read attribute EPOCH_S Default Value Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertEqual([actualValue unsignedIntValue], 0UL);
readAttributeEpochSDefaultValue = [actualValue unsignedIntValue];
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTestSaveAs_000085_WriteAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Write attribute EPOCH_S Not Default Value"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
id epochSArgument;
epochSArgument = [NSNumber numberWithUnsignedInt:1UL];
[cluster writeAttributeEpochSWithValue:epochSArgument
completionHandler:^(NSError * _Nullable err) {
NSLog(@"Write attribute EPOCH_S Not Default Value Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTestSaveAs_000086_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute EPOCH_S Not Default Value"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeEpochSWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"Read attribute EPOCH_S Not Default Value Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertNotEqual([actualValue unsignedIntValue], readAttributeEpochSDefaultValue);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTestSaveAs_000087_WriteAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Write attribute EPOCH_S Default Value"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
id epochSArgument;
epochSArgument = [NSNumber numberWithUnsignedInt:readAttributeEpochSDefaultValue];
[cluster writeAttributeEpochSWithValue:epochSArgument
completionHandler:^(NSError * _Nullable err) {
NSLog(@"Write attribute EPOCH_S Default Value Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTestSaveAs_000088_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute EPOCH_S Default Value"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeEpochSWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"Read attribute EPOCH_S Default Value Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertEqual([actualValue unsignedIntValue], readAttributeEpochSDefaultValue);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
uint16_t readAttributeVendorIdDefaultValue;
- (void)testSendClusterTestSaveAs_000089_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute vendor_id Default Value"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeVendorIdWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"Read attribute vendor_id Default Value Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertEqual([actualValue unsignedShortValue], 0U);
readAttributeVendorIdDefaultValue = [actualValue unsignedShortValue];
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTestSaveAs_000090_WriteAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Write attribute vendor_id Not Default Value"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
id vendorIdArgument;
vendorIdArgument = [NSNumber numberWithUnsignedShort:1U];
[cluster writeAttributeVendorIdWithValue:vendorIdArgument
completionHandler:^(NSError * _Nullable err) {
NSLog(@"Write attribute vendor_id Not Default Value Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTestSaveAs_000091_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute vendor_id Not Default Value"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeVendorIdWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"Read attribute vendor_id Not Default Value Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertNotEqual([actualValue unsignedShortValue], readAttributeVendorIdDefaultValue);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTestSaveAs_000092_WriteAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Write attribute vendor_id Default Value"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
id vendorIdArgument;
vendorIdArgument = [NSNumber numberWithUnsignedShort:readAttributeVendorIdDefaultValue];
[cluster writeAttributeVendorIdWithValue:vendorIdArgument
completionHandler:^(NSError * _Nullable err) {
NSLog(@"Write attribute vendor_id Default Value Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTestSaveAs_000093_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute vendor_id Default Value"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeVendorIdWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"Read attribute vendor_id Default Value Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertEqual([actualValue unsignedShortValue], readAttributeVendorIdDefaultValue);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTestConstraints_000000_WaitForCommissionee
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"];
dispatch_queue_t queue = dispatch_get_main_queue();
WaitForCommissionee(expectation, queue);
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTestConstraints_000001_WriteAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Write attribute INT32U Value"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
id int32uArgument;
int32uArgument = [NSNumber numberWithUnsignedInt:5UL];
[cluster writeAttributeInt32uWithValue:int32uArgument
completionHandler:^(NSError * _Nullable err) {
NSLog(@"Write attribute INT32U Value Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTestConstraints_000002_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute INT32U Value MinValue Constraints"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeInt32uWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"Read attribute INT32U Value MinValue Constraints Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertGreaterThanOrEqual([actualValue unsignedIntValue], 5);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTestConstraints_000003_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute INT32U Value MaxValue Constraints"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeInt32uWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"Read attribute INT32U Value MaxValue Constraints Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertLessThanOrEqual([actualValue unsignedIntValue], 5);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTestConstraints_000004_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute INT32U Value NotValue Constraints"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeInt32uWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"Read attribute INT32U Value NotValue Constraints Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertNotEqual([actualValue unsignedIntValue], 6);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTestConstraints_000005_WriteAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Write attribute INT32U Value Back to Default Value"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
id int32uArgument;
int32uArgument = [NSNumber numberWithUnsignedInt:0UL];
[cluster writeAttributeInt32uWithValue:int32uArgument
completionHandler:^(NSError * _Nullable err) {
NSLog(@"Write attribute INT32U Value Back to Default Value Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTestConstraints_000006_WriteAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Write attribute CHAR_STRING Value"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
id charStringArgument;
charStringArgument = @"** Test **";
[cluster writeAttributeCharStringWithValue:charStringArgument
completionHandler:^(NSError * _Nullable err) {
NSLog(@"Write attribute CHAR_STRING Value Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTestConstraints_000007_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute CHAR_STRING Value MinLength Constraints"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeCharStringWithCompletionHandler:^(NSString * _Nullable value, NSError * _Nullable err) {
NSLog(@"Read attribute CHAR_STRING Value MinLength Constraints Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertGreaterThanOrEqual([actualValue length], 5);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTestConstraints_000008_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute CHAR_STRING Value MaxLength Constraints"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeCharStringWithCompletionHandler:^(NSString * _Nullable value, NSError * _Nullable err) {
NSLog(@"Read attribute CHAR_STRING Value MaxLength Constraints Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertLessThanOrEqual([actualValue length], 20);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTestConstraints_000009_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute CHAR_STRING Value StartsWith Constraints"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeCharStringWithCompletionHandler:^(NSString * _Nullable value, NSError * _Nullable err) {
NSLog(@"Read attribute CHAR_STRING Value StartsWith Constraints Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertTrue([actualValue hasPrefix:@"**"]);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTestConstraints_000010_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute CHAR_STRING Value EndsWith Constraints"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeCharStringWithCompletionHandler:^(NSString * _Nullable value, NSError * _Nullable err) {
NSLog(@"Read attribute CHAR_STRING Value EndsWith Constraints Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertTrue([actualValue hasSuffix:@"**"]);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTestConstraints_000011_WriteAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Write attribute CHAR_STRING Value Back to Default Value"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
id charStringArgument;
charStringArgument = @"";
[cluster writeAttributeCharStringWithValue:charStringArgument
completionHandler:^(NSError * _Nullable err) {
NSLog(@"Write attribute CHAR_STRING Value Back to Default Value Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTestDelayCommands_000000_WaitForCommissionee
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"];
dispatch_queue_t queue = dispatch_get_main_queue();
WaitForCommissionee(expectation, queue);
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTestDelayCommands_000001_WaitForMs
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Wait 100ms"];
dispatch_queue_t queue = dispatch_get_main_queue();
WaitForMs(expectation, queue, 100);
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTestDescriptorCluster_000000_WaitForCommissionee
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"];
dispatch_queue_t queue = dispatch_get_main_queue();
WaitForCommissionee(expectation, queue);
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTestDescriptorCluster_000001_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute Device list"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestDescriptor * cluster = [[CHIPTestDescriptor alloc] initWithDevice:device endpoint:0 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeDeviceListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) {
NSLog(@"Read attribute Device list Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertEqual([actualValue count], 1);
XCTAssertEqual([((CHIPDescriptorClusterDeviceType *) actualValue[0]).type unsignedIntValue], 22UL);
XCTAssertEqual([((CHIPDescriptorClusterDeviceType *) actualValue[0]).revision unsignedShortValue], 1U);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTestDescriptorCluster_000002_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute Server list"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestDescriptor * cluster = [[CHIPTestDescriptor alloc] initWithDevice:device endpoint:0 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeServerListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) {
NSLog(@"Read attribute Server list Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertEqual([actualValue count], 23);
XCTAssertEqual([actualValue[0] unsignedIntValue], 3UL);
XCTAssertEqual([actualValue[1] unsignedIntValue], 4UL);
XCTAssertEqual([actualValue[2] unsignedIntValue], 29UL);
XCTAssertEqual([actualValue[3] unsignedIntValue], 30UL);
XCTAssertEqual([actualValue[4] unsignedIntValue], 31UL);
XCTAssertEqual([actualValue[5] unsignedIntValue], 40UL);
XCTAssertEqual([actualValue[6] unsignedIntValue], 41UL);
XCTAssertEqual([actualValue[7] unsignedIntValue], 42UL);
XCTAssertEqual([actualValue[8] unsignedIntValue], 46UL);
XCTAssertEqual([actualValue[9] unsignedIntValue], 48UL);
XCTAssertEqual([actualValue[10] unsignedIntValue], 49UL);
XCTAssertEqual([actualValue[11] unsignedIntValue], 50UL);
XCTAssertEqual([actualValue[12] unsignedIntValue], 51UL);
XCTAssertEqual([actualValue[13] unsignedIntValue], 52UL);
XCTAssertEqual([actualValue[14] unsignedIntValue], 53UL);
XCTAssertEqual([actualValue[15] unsignedIntValue], 54UL);
XCTAssertEqual([actualValue[16] unsignedIntValue], 55UL);
XCTAssertEqual([actualValue[17] unsignedIntValue], 60UL);
XCTAssertEqual([actualValue[18] unsignedIntValue], 62UL);
XCTAssertEqual([actualValue[19] unsignedIntValue], 63UL);
XCTAssertEqual([actualValue[20] unsignedIntValue], 64UL);
XCTAssertEqual([actualValue[21] unsignedIntValue], 65UL);
XCTAssertEqual([actualValue[22] unsignedIntValue], 1029UL);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTestDescriptorCluster_000003_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute Client list"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestDescriptor * cluster = [[CHIPTestDescriptor alloc] initWithDevice:device endpoint:0 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeClientListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) {
NSLog(@"Read attribute Client list Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertEqual([actualValue count], 0);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTestDescriptorCluster_000004_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute Parts list"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestDescriptor * cluster = [[CHIPTestDescriptor alloc] initWithDevice:device endpoint:0 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributePartsListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) {
NSLog(@"Read attribute Parts list Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertEqual([actualValue count], 2);
XCTAssertEqual([actualValue[0] unsignedShortValue], 1U);
XCTAssertEqual([actualValue[1] unsignedShortValue], 2U);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTestBasicInformation_000000_WaitForCommissionee
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"];
dispatch_queue_t queue = dispatch_get_main_queue();
WaitForCommissionee(expectation, queue);
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTestBasicInformation_000001_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Read location"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestBasic * cluster = [[CHIPTestBasic alloc] initWithDevice:device endpoint:0 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeLocationWithCompletionHandler:^(NSString * _Nullable value, NSError * _Nullable err) {
NSLog(@"Read location Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertTrue([actualValue isEqualToString:@"XX"]);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTestBasicInformation_000002_WriteAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Write location"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestBasic * cluster = [[CHIPTestBasic alloc] initWithDevice:device endpoint:0 queue:queue];
XCTAssertNotNil(cluster);
id locationArgument;
locationArgument = @"us";
[cluster writeAttributeLocationWithValue:locationArgument
completionHandler:^(NSError * _Nullable err) {
NSLog(@"Write location Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTestBasicInformation_000003_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Read back location"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestBasic * cluster = [[CHIPTestBasic alloc] initWithDevice:device endpoint:0 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeLocationWithCompletionHandler:^(NSString * _Nullable value, NSError * _Nullable err) {
NSLog(@"Read back location Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertTrue([actualValue isEqualToString:@"us"]);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTestBasicInformation_000004_WriteAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Restore initial location value"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestBasic * cluster = [[CHIPTestBasic alloc] initWithDevice:device endpoint:0 queue:queue];
XCTAssertNotNil(cluster);
id locationArgument;
locationArgument = @"";
[cluster writeAttributeLocationWithValue:locationArgument
completionHandler:^(NSError * _Nullable err) {
NSLog(@"Restore initial location value Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTestBasicInformation_000005_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Read AttributeList value"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestBasic * cluster = [[CHIPTestBasic alloc] initWithDevice:device endpoint:0 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeAttributeListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) {
NSLog(@"Read AttributeList value Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertEqual([actualValue count], 21);
XCTAssertEqual([actualValue[0] unsignedIntValue], 0UL);
XCTAssertEqual([actualValue[1] unsignedIntValue], 1UL);
XCTAssertEqual([actualValue[2] unsignedIntValue], 2UL);
XCTAssertEqual([actualValue[3] unsignedIntValue], 3UL);
XCTAssertEqual([actualValue[4] unsignedIntValue], 4UL);
XCTAssertEqual([actualValue[5] unsignedIntValue], 5UL);
XCTAssertEqual([actualValue[6] unsignedIntValue], 6UL);
XCTAssertEqual([actualValue[7] unsignedIntValue], 7UL);
XCTAssertEqual([actualValue[8] unsignedIntValue], 8UL);
XCTAssertEqual([actualValue[9] unsignedIntValue], 9UL);
XCTAssertEqual([actualValue[10] unsignedIntValue], 10UL);
XCTAssertEqual([actualValue[11] unsignedIntValue], 11UL);
XCTAssertEqual([actualValue[12] unsignedIntValue], 12UL);
XCTAssertEqual([actualValue[13] unsignedIntValue], 13UL);
XCTAssertEqual([actualValue[14] unsignedIntValue], 14UL);
XCTAssertEqual([actualValue[15] unsignedIntValue], 15UL);
XCTAssertEqual([actualValue[16] unsignedIntValue], 16UL);
XCTAssertEqual([actualValue[17] unsignedIntValue], 17UL);
XCTAssertEqual([actualValue[18] unsignedIntValue], 18UL);
XCTAssertEqual([actualValue[19] unsignedIntValue], 65531UL);
XCTAssertEqual([actualValue[20] unsignedIntValue], 65533UL);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTestGroupsCluster_000000_WaitForCommissionee
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"];
dispatch_queue_t queue = dispatch_get_main_queue();
WaitForCommissionee(expectation, queue);
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTestGroupsCluster_000001_ViewGroup
{
XCTestExpectation * expectation = [self expectationWithDescription:@"View Group 0 (invalid)"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestGroups * cluster = [[CHIPTestGroups alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
__auto_type * params = [[CHIPGroupsClusterViewGroupParams alloc] init];
params.groupId = [NSNumber numberWithUnsignedShort:0U];
[cluster viewGroupWithParams:params
completionHandler:^(CHIPGroupsClusterViewGroupResponseParams * _Nullable values, NSError * _Nullable err) {
NSLog(@"View Group 0 (invalid) Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = values.status;
XCTAssertEqual([actualValue unsignedCharValue], 135);
}
{
id actualValue = values.groupId;
XCTAssertEqual([actualValue unsignedShortValue], 0U);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTestGroupsCluster_000002_ViewGroup
{
XCTestExpectation * expectation = [self expectationWithDescription:@"View Group 1 (not found)"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestGroups * cluster = [[CHIPTestGroups alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
__auto_type * params = [[CHIPGroupsClusterViewGroupParams alloc] init];
params.groupId = [NSNumber numberWithUnsignedShort:1U];
[cluster viewGroupWithParams:params
completionHandler:^(CHIPGroupsClusterViewGroupResponseParams * _Nullable values, NSError * _Nullable err) {
NSLog(@"View Group 1 (not found) Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = values.status;
XCTAssertEqual([actualValue unsignedCharValue], 139);
}
{
id actualValue = values.groupId;
XCTAssertEqual([actualValue unsignedShortValue], 1U);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTestGroupsCluster_000003_AddGroup
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Add Group 1 (new)"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestGroups * cluster = [[CHIPTestGroups alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
__auto_type * params = [[CHIPGroupsClusterAddGroupParams alloc] init];
params.groupId = [NSNumber numberWithUnsignedShort:1U];
params.groupName = @"Group #1";
[cluster addGroupWithParams:params
completionHandler:^(CHIPGroupsClusterAddGroupResponseParams * _Nullable values, NSError * _Nullable err) {
NSLog(@"Add Group 1 (new) Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = values.status;
XCTAssertEqual([actualValue unsignedCharValue], 0);
}
{
id actualValue = values.groupId;
XCTAssertEqual([actualValue unsignedShortValue], 1U);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTestGroupsCluster_000004_ViewGroup
{
XCTestExpectation * expectation = [self expectationWithDescription:@"View Group 1 (new)"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestGroups * cluster = [[CHIPTestGroups alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
__auto_type * params = [[CHIPGroupsClusterViewGroupParams alloc] init];
params.groupId = [NSNumber numberWithUnsignedShort:1U];
[cluster viewGroupWithParams:params
completionHandler:^(CHIPGroupsClusterViewGroupResponseParams * _Nullable values, NSError * _Nullable err) {
NSLog(@"View Group 1 (new) Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = values.status;
XCTAssertEqual([actualValue unsignedCharValue], 0);
}
{
id actualValue = values.groupId;
XCTAssertEqual([actualValue unsignedShortValue], 1U);
}
{
id actualValue = values.groupName;
XCTAssertTrue([actualValue isEqualToString:@"Group #1"]);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTestGroupsCluster_000005_ViewGroup
{
XCTestExpectation * expectation = [self expectationWithDescription:@"View Group 2 (not found)"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestGroups * cluster = [[CHIPTestGroups alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
__auto_type * params = [[CHIPGroupsClusterViewGroupParams alloc] init];
params.groupId = [NSNumber numberWithUnsignedShort:4369U];
[cluster viewGroupWithParams:params
completionHandler:^(CHIPGroupsClusterViewGroupResponseParams * _Nullable values, NSError * _Nullable err) {
NSLog(@"View Group 2 (not found) Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = values.status;
XCTAssertEqual([actualValue unsignedCharValue], 139);
}
{
id actualValue = values.groupId;
XCTAssertEqual([actualValue unsignedShortValue], 4369U);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTestGroupsCluster_000006_GetGroupMembership
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Get Group Membership 1 (all)"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestGroups * cluster = [[CHIPTestGroups alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
__auto_type * params = [[CHIPGroupsClusterGetGroupMembershipParams alloc] init];
{
NSMutableArray * temp_0 = [[NSMutableArray alloc] init];
params.groupList = temp_0;
}
[cluster getGroupMembershipWithParams:params
completionHandler:^(
CHIPGroupsClusterGetGroupMembershipResponseParams * _Nullable values, NSError * _Nullable err) {
NSLog(@"Get Group Membership 1 (all) Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = values.capacity;
XCTAssertEqual([actualValue unsignedCharValue], 255);
}
{
id actualValue = values.groupList;
XCTAssertEqual([actualValue count], 1);
XCTAssertEqual([actualValue[0] unsignedShortValue], 1U);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTestGroupsCluster_000007_AddGroup
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Add Group 2 (new)"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestGroups * cluster = [[CHIPTestGroups alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
__auto_type * params = [[CHIPGroupsClusterAddGroupParams alloc] init];
params.groupId = [NSNumber numberWithUnsignedShort:4369U];
params.groupName = @"Group #2";
[cluster addGroupWithParams:params
completionHandler:^(CHIPGroupsClusterAddGroupResponseParams * _Nullable values, NSError * _Nullable err) {
NSLog(@"Add Group 2 (new) Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = values.status;
XCTAssertEqual([actualValue unsignedCharValue], 0);
}
{
id actualValue = values.groupId;
XCTAssertEqual([actualValue unsignedShortValue], 4369U);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTestGroupsCluster_000008_ViewGroup
{
XCTestExpectation * expectation = [self expectationWithDescription:@"View Group 2 (new)"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestGroups * cluster = [[CHIPTestGroups alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
__auto_type * params = [[CHIPGroupsClusterViewGroupParams alloc] init];
params.groupId = [NSNumber numberWithUnsignedShort:4369U];
[cluster viewGroupWithParams:params
completionHandler:^(CHIPGroupsClusterViewGroupResponseParams * _Nullable values, NSError * _Nullable err) {
NSLog(@"View Group 2 (new) Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = values.status;
XCTAssertEqual([actualValue unsignedCharValue], 0);
}
{
id actualValue = values.groupId;
XCTAssertEqual([actualValue unsignedShortValue], 4369U);
}
{
id actualValue = values.groupName;
XCTAssertTrue([actualValue isEqualToString:@"Group #2"]);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTestGroupsCluster_000009_ViewGroup
{
XCTestExpectation * expectation = [self expectationWithDescription:@"View Group 3 (not found)"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestGroups * cluster = [[CHIPTestGroups alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
__auto_type * params = [[CHIPGroupsClusterViewGroupParams alloc] init];
params.groupId = [NSNumber numberWithUnsignedShort:32767U];
[cluster viewGroupWithParams:params
completionHandler:^(CHIPGroupsClusterViewGroupResponseParams * _Nullable values, NSError * _Nullable err) {
NSLog(@"View Group 3 (not found) Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = values.status;
XCTAssertEqual([actualValue unsignedCharValue], 139);
}
{
id actualValue = values.groupId;
XCTAssertEqual([actualValue unsignedShortValue], 32767U);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTestGroupsCluster_000010_AddGroup
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Add Group 3 (new)"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestGroups * cluster = [[CHIPTestGroups alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
__auto_type * params = [[CHIPGroupsClusterAddGroupParams alloc] init];
params.groupId = [NSNumber numberWithUnsignedShort:32767U];
params.groupName = @"Group #3";
[cluster addGroupWithParams:params
completionHandler:^(CHIPGroupsClusterAddGroupResponseParams * _Nullable values, NSError * _Nullable err) {
NSLog(@"Add Group 3 (new) Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = values.status;
XCTAssertEqual([actualValue unsignedCharValue], 0);
}
{
id actualValue = values.groupId;
XCTAssertEqual([actualValue unsignedShortValue], 32767U);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTestGroupsCluster_000011_ViewGroup
{
XCTestExpectation * expectation = [self expectationWithDescription:@"View Group 1 (existing)"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestGroups * cluster = [[CHIPTestGroups alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
__auto_type * params = [[CHIPGroupsClusterViewGroupParams alloc] init];
params.groupId = [NSNumber numberWithUnsignedShort:1U];
[cluster viewGroupWithParams:params
completionHandler:^(CHIPGroupsClusterViewGroupResponseParams * _Nullable values, NSError * _Nullable err) {
NSLog(@"View Group 1 (existing) Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = values.status;
XCTAssertEqual([actualValue unsignedCharValue], 0);
}
{
id actualValue = values.groupId;
XCTAssertEqual([actualValue unsignedShortValue], 1U);
}
{
id actualValue = values.groupName;
XCTAssertTrue([actualValue isEqualToString:@"Group #1"]);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTestGroupsCluster_000012_ViewGroup
{
XCTestExpectation * expectation = [self expectationWithDescription:@"View Group 2 (existing)"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestGroups * cluster = [[CHIPTestGroups alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
__auto_type * params = [[CHIPGroupsClusterViewGroupParams alloc] init];
params.groupId = [NSNumber numberWithUnsignedShort:4369U];
[cluster viewGroupWithParams:params
completionHandler:^(CHIPGroupsClusterViewGroupResponseParams * _Nullable values, NSError * _Nullable err) {
NSLog(@"View Group 2 (existing) Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = values.status;
XCTAssertEqual([actualValue unsignedCharValue], 0);
}
{
id actualValue = values.groupId;
XCTAssertEqual([actualValue unsignedShortValue], 4369U);
}
{
id actualValue = values.groupName;
XCTAssertTrue([actualValue isEqualToString:@"Group #2"]);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTestGroupsCluster_000013_GetGroupMembership
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Get Group Membership 2"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestGroups * cluster = [[CHIPTestGroups alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
__auto_type * params = [[CHIPGroupsClusterGetGroupMembershipParams alloc] init];
{
NSMutableArray * temp_0 = [[NSMutableArray alloc] init];
temp_0[0] = [NSNumber numberWithUnsignedShort:2U];
temp_0[1] = [NSNumber numberWithUnsignedShort:3U];
temp_0[2] = [NSNumber numberWithUnsignedShort:32767U];
params.groupList = temp_0;
}
[cluster getGroupMembershipWithParams:params
completionHandler:^(
CHIPGroupsClusterGetGroupMembershipResponseParams * _Nullable values, NSError * _Nullable err) {
NSLog(@"Get Group Membership 2 Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = values.capacity;
XCTAssertEqual([actualValue unsignedCharValue], 255);
}
{
id actualValue = values.groupList;
XCTAssertEqual([actualValue count], 1);
XCTAssertEqual([actualValue[0] unsignedShortValue], 32767U);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTestGroupsCluster_000014_ViewGroup
{
XCTestExpectation * expectation = [self expectationWithDescription:@"View Group 3 (new)"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestGroups * cluster = [[CHIPTestGroups alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
__auto_type * params = [[CHIPGroupsClusterViewGroupParams alloc] init];
params.groupId = [NSNumber numberWithUnsignedShort:32767U];
[cluster viewGroupWithParams:params
completionHandler:^(CHIPGroupsClusterViewGroupResponseParams * _Nullable values, NSError * _Nullable err) {
NSLog(@"View Group 3 (new) Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = values.status;
XCTAssertEqual([actualValue unsignedCharValue], 0);
}
{
id actualValue = values.groupId;
XCTAssertEqual([actualValue unsignedShortValue], 32767U);
}
{
id actualValue = values.groupName;
XCTAssertTrue([actualValue isEqualToString:@"Group #3"]);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTestGroupsCluster_000015_RemoveGroup
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Remove Group 0 (invalid)"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestGroups * cluster = [[CHIPTestGroups alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
__auto_type * params = [[CHIPGroupsClusterRemoveGroupParams alloc] init];
params.groupId = [NSNumber numberWithUnsignedShort:0U];
[cluster removeGroupWithParams:params
completionHandler:^(CHIPGroupsClusterRemoveGroupResponseParams * _Nullable values, NSError * _Nullable err) {
NSLog(@"Remove Group 0 (invalid) Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = values.status;
XCTAssertEqual([actualValue unsignedCharValue], 135);
}
{
id actualValue = values.groupId;
XCTAssertEqual([actualValue unsignedShortValue], 0U);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTestGroupsCluster_000016_RemoveGroup
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Remove Group 4 (not found)"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestGroups * cluster = [[CHIPTestGroups alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
__auto_type * params = [[CHIPGroupsClusterRemoveGroupParams alloc] init];
params.groupId = [NSNumber numberWithUnsignedShort:4U];
[cluster removeGroupWithParams:params
completionHandler:^(CHIPGroupsClusterRemoveGroupResponseParams * _Nullable values, NSError * _Nullable err) {
NSLog(@"Remove Group 4 (not found) Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = values.status;
XCTAssertEqual([actualValue unsignedCharValue], 139);
}
{
id actualValue = values.groupId;
XCTAssertEqual([actualValue unsignedShortValue], 4U);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTestGroupsCluster_000017_RemoveGroup
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Remove Group 2 (existing)"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestGroups * cluster = [[CHIPTestGroups alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
__auto_type * params = [[CHIPGroupsClusterRemoveGroupParams alloc] init];
params.groupId = [NSNumber numberWithUnsignedShort:4369U];
[cluster removeGroupWithParams:params
completionHandler:^(CHIPGroupsClusterRemoveGroupResponseParams * _Nullable values, NSError * _Nullable err) {
NSLog(@"Remove Group 2 (existing) Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = values.status;
XCTAssertEqual([actualValue unsignedCharValue], 0);
}
{
id actualValue = values.groupId;
XCTAssertEqual([actualValue unsignedShortValue], 4369U);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTestGroupsCluster_000018_ViewGroup
{
XCTestExpectation * expectation = [self expectationWithDescription:@"View Group 1 (not removed)"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestGroups * cluster = [[CHIPTestGroups alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
__auto_type * params = [[CHIPGroupsClusterViewGroupParams alloc] init];
params.groupId = [NSNumber numberWithUnsignedShort:1U];
[cluster viewGroupWithParams:params
completionHandler:^(CHIPGroupsClusterViewGroupResponseParams * _Nullable values, NSError * _Nullable err) {
NSLog(@"View Group 1 (not removed) Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = values.status;
XCTAssertEqual([actualValue unsignedCharValue], 0);
}
{
id actualValue = values.groupId;
XCTAssertEqual([actualValue unsignedShortValue], 1U);
}
{
id actualValue = values.groupName;
XCTAssertTrue([actualValue isEqualToString:@"Group #1"]);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTestGroupsCluster_000019_ViewGroup
{
XCTestExpectation * expectation = [self expectationWithDescription:@"View Group 2 (removed)"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestGroups * cluster = [[CHIPTestGroups alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
__auto_type * params = [[CHIPGroupsClusterViewGroupParams alloc] init];
params.groupId = [NSNumber numberWithUnsignedShort:4369U];
[cluster viewGroupWithParams:params
completionHandler:^(CHIPGroupsClusterViewGroupResponseParams * _Nullable values, NSError * _Nullable err) {
NSLog(@"View Group 2 (removed) Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = values.status;
XCTAssertEqual([actualValue unsignedCharValue], 139);
}
{
id actualValue = values.groupId;
XCTAssertEqual([actualValue unsignedShortValue], 4369U);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTestGroupsCluster_000020_ViewGroup
{
XCTestExpectation * expectation = [self expectationWithDescription:@"View Group 3 (not removed)"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestGroups * cluster = [[CHIPTestGroups alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
__auto_type * params = [[CHIPGroupsClusterViewGroupParams alloc] init];
params.groupId = [NSNumber numberWithUnsignedShort:32767U];
[cluster viewGroupWithParams:params
completionHandler:^(CHIPGroupsClusterViewGroupResponseParams * _Nullable values, NSError * _Nullable err) {
NSLog(@"View Group 3 (not removed) Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = values.status;
XCTAssertEqual([actualValue unsignedCharValue], 0);
}
{
id actualValue = values.groupId;
XCTAssertEqual([actualValue unsignedShortValue], 32767U);
}
{
id actualValue = values.groupName;
XCTAssertTrue([actualValue isEqualToString:@"Group #3"]);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTestGroupsCluster_000021_GetGroupMembership
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Get Group Membership 3"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestGroups * cluster = [[CHIPTestGroups alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
__auto_type * params = [[CHIPGroupsClusterGetGroupMembershipParams alloc] init];
{
NSMutableArray * temp_0 = [[NSMutableArray alloc] init];
temp_0[0] = [NSNumber numberWithUnsignedShort:1U];
temp_0[1] = [NSNumber numberWithUnsignedShort:2U];
temp_0[2] = [NSNumber numberWithUnsignedShort:4369U];
temp_0[3] = [NSNumber numberWithUnsignedShort:3U];
params.groupList = temp_0;
}
[cluster getGroupMembershipWithParams:params
completionHandler:^(
CHIPGroupsClusterGetGroupMembershipResponseParams * _Nullable values, NSError * _Nullable err) {
NSLog(@"Get Group Membership 3 Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = values.capacity;
XCTAssertEqual([actualValue unsignedCharValue], 255);
}
{
id actualValue = values.groupList;
XCTAssertEqual([actualValue count], 1);
XCTAssertEqual([actualValue[0] unsignedShortValue], 1U);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTestGroupsCluster_000022_RemoveAllGroups
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Remove All"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestGroups * cluster = [[CHIPTestGroups alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster removeAllGroupsWithCompletionHandler:^(NSError * _Nullable err) {
NSLog(@"Remove All Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTestGroupsCluster_000023_ViewGroup
{
XCTestExpectation * expectation = [self expectationWithDescription:@"View Group 1 (removed)"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestGroups * cluster = [[CHIPTestGroups alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
__auto_type * params = [[CHIPGroupsClusterViewGroupParams alloc] init];
params.groupId = [NSNumber numberWithUnsignedShort:1U];
[cluster viewGroupWithParams:params
completionHandler:^(CHIPGroupsClusterViewGroupResponseParams * _Nullable values, NSError * _Nullable err) {
NSLog(@"View Group 1 (removed) Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = values.status;
XCTAssertEqual([actualValue unsignedCharValue], 139);
}
{
id actualValue = values.groupId;
XCTAssertEqual([actualValue unsignedShortValue], 1U);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTestGroupsCluster_000024_ViewGroup
{
XCTestExpectation * expectation = [self expectationWithDescription:@"View Group 2 (still removed)"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestGroups * cluster = [[CHIPTestGroups alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
__auto_type * params = [[CHIPGroupsClusterViewGroupParams alloc] init];
params.groupId = [NSNumber numberWithUnsignedShort:4369U];
[cluster viewGroupWithParams:params
completionHandler:^(CHIPGroupsClusterViewGroupResponseParams * _Nullable values, NSError * _Nullable err) {
NSLog(@"View Group 2 (still removed) Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = values.status;
XCTAssertEqual([actualValue unsignedCharValue], 139);
}
{
id actualValue = values.groupId;
XCTAssertEqual([actualValue unsignedShortValue], 4369U);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTestGroupsCluster_000025_ViewGroup
{
XCTestExpectation * expectation = [self expectationWithDescription:@"View Group 3 (removed)"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestGroups * cluster = [[CHIPTestGroups alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
__auto_type * params = [[CHIPGroupsClusterViewGroupParams alloc] init];
params.groupId = [NSNumber numberWithUnsignedShort:32767U];
[cluster viewGroupWithParams:params
completionHandler:^(CHIPGroupsClusterViewGroupResponseParams * _Nullable values, NSError * _Nullable err) {
NSLog(@"View Group 3 (removed) Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = values.status;
XCTAssertEqual([actualValue unsignedCharValue], 139);
}
{
id actualValue = values.groupId;
XCTAssertEqual([actualValue unsignedShortValue], 32767U);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTestGroupsCluster_000026_GetGroupMembership
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Get Group Membership 4"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestGroups * cluster = [[CHIPTestGroups alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
__auto_type * params = [[CHIPGroupsClusterGetGroupMembershipParams alloc] init];
{
NSMutableArray * temp_0 = [[NSMutableArray alloc] init];
temp_0[0] = [NSNumber numberWithUnsignedShort:1U];
temp_0[1] = [NSNumber numberWithUnsignedShort:2U];
temp_0[2] = [NSNumber numberWithUnsignedShort:4369U];
temp_0[3] = [NSNumber numberWithUnsignedShort:3U];
temp_0[4] = [NSNumber numberWithUnsignedShort:32767U];
params.groupList = temp_0;
}
[cluster getGroupMembershipWithParams:params
completionHandler:^(
CHIPGroupsClusterGetGroupMembershipResponseParams * _Nullable values, NSError * _Nullable err) {
NSLog(@"Get Group Membership 4 Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = values.capacity;
XCTAssertEqual([actualValue unsignedCharValue], 255);
}
{
id actualValue = values.groupList;
XCTAssertEqual([actualValue count], 0);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTestIdentifyCluster_000000_WaitForCommissionee
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"];
dispatch_queue_t queue = dispatch_get_main_queue();
WaitForCommissionee(expectation, queue);
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTestIdentifyCluster_000001_Identify
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Send Identify command and expect success response"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestIdentify * cluster = [[CHIPTestIdentify alloc] initWithDevice:device endpoint:0 queue:queue];
XCTAssertNotNil(cluster);
__auto_type * params = [[CHIPIdentifyClusterIdentifyParams alloc] init];
params.identifyTime = [NSNumber numberWithUnsignedShort:0U];
[cluster identifyWithParams:params
completionHandler:^(NSError * _Nullable err) {
NSLog(@"Send Identify command and expect success response Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTestOperationalCredentialsCluster_000000_WaitForCommissionee
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"];
dispatch_queue_t queue = dispatch_get_main_queue();
WaitForCommissionee(expectation, queue);
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTestOperationalCredentialsCluster_000001_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Read number of supported fabrics"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestOperationalCredentials * cluster = [[CHIPTestOperationalCredentials alloc] initWithDevice:device
endpoint:0
queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeSupportedFabricsWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"Read number of supported fabrics Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertGreaterThanOrEqual([actualValue unsignedCharValue], 4);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTestOperationalCredentialsCluster_000002_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Read number of commissioned fabrics"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestOperationalCredentials * cluster = [[CHIPTestOperationalCredentials alloc] initWithDevice:device
endpoint:0
queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeCommissionedFabricsWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"Read number of commissioned fabrics Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertGreaterThanOrEqual([actualValue unsignedCharValue], 1);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTestOperationalCredentialsCluster_000003_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Read current fabric index"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestOperationalCredentials * cluster = [[CHIPTestOperationalCredentials alloc] initWithDevice:device
endpoint:0
queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeCurrentFabricIndexWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"Read current fabric index Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertGreaterThanOrEqual([actualValue unsignedCharValue], 1);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTestModeSelectCluster_000000_WaitForCommissionee
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"];
dispatch_queue_t queue = dispatch_get_main_queue();
WaitForCommissionee(expectation, queue);
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTestModeSelectCluster_000001_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Read CurrentMode"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestModeSelect * cluster = [[CHIPTestModeSelect alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeCurrentModeWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"Read CurrentMode Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertEqual([actualValue unsignedCharValue], 0);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTestModeSelectCluster_000002_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Read OnMode"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestModeSelect * cluster = [[CHIPTestModeSelect alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeOnModeWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"Read OnMode Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertEqual([actualValue unsignedCharValue], 0);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTestModeSelectCluster_000003_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Read StartUpMode"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestModeSelect * cluster = [[CHIPTestModeSelect alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeStartUpModeWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"Read StartUpMode Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertEqual([actualValue unsignedCharValue], 0);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTestModeSelectCluster_000004_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Read Description"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestModeSelect * cluster = [[CHIPTestModeSelect alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeDescriptionWithCompletionHandler:^(NSString * _Nullable value, NSError * _Nullable err) {
NSLog(@"Read Description Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertTrue([actualValue isEqualToString:@"Coffee"]);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTestModeSelectCluster_000005_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Read SupportedModes"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestModeSelect * cluster = [[CHIPTestModeSelect alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeSupportedModesWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) {
NSLog(@"Read SupportedModes Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertEqual([actualValue count], 3);
XCTAssertTrue([((CHIPModeSelectClusterModeOptionStruct *) actualValue[0]).label isEqualToString:@"Black"]);
XCTAssertEqual([((CHIPModeSelectClusterModeOptionStruct *) actualValue[0]).mode unsignedCharValue], 0);
XCTAssertEqual([((CHIPModeSelectClusterModeOptionStruct *) actualValue[0]).semanticTag unsignedIntValue], 0UL);
XCTAssertTrue([((CHIPModeSelectClusterModeOptionStruct *) actualValue[1]).label isEqualToString:@"Cappuccino"]);
XCTAssertEqual([((CHIPModeSelectClusterModeOptionStruct *) actualValue[1]).mode unsignedCharValue], 4);
XCTAssertEqual([((CHIPModeSelectClusterModeOptionStruct *) actualValue[1]).semanticTag unsignedIntValue], 0UL);
XCTAssertTrue([((CHIPModeSelectClusterModeOptionStruct *) actualValue[2]).label isEqualToString:@"Espresso"]);
XCTAssertEqual([((CHIPModeSelectClusterModeOptionStruct *) actualValue[2]).mode unsignedCharValue], 7);
XCTAssertEqual([((CHIPModeSelectClusterModeOptionStruct *) actualValue[2]).semanticTag unsignedIntValue], 0UL);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTestModeSelectCluster_000006_ChangeToMode
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Change to Supported Mode"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestModeSelect * cluster = [[CHIPTestModeSelect alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
__auto_type * params = [[CHIPModeSelectClusterChangeToModeParams alloc] init];
params.newMode = [NSNumber numberWithUnsignedChar:4];
[cluster changeToModeWithParams:params
completionHandler:^(NSError * _Nullable err) {
NSLog(@"Change to Supported Mode Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTestModeSelectCluster_000007_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Verify Current Mode Change"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestModeSelect * cluster = [[CHIPTestModeSelect alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeCurrentModeWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"Verify Current Mode Change Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertEqual([actualValue unsignedCharValue], 4);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTestModeSelectCluster_000008_ChangeToMode
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Change to Unsupported Mode"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestModeSelect * cluster = [[CHIPTestModeSelect alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
__auto_type * params = [[CHIPModeSelectClusterChangeToModeParams alloc] init];
params.newMode = [NSNumber numberWithUnsignedChar:2];
[cluster changeToModeWithParams:params
completionHandler:^(NSError * _Nullable err) {
NSLog(@"Change to Unsupported Mode Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], EMBER_ZCL_STATUS_CONSTRAINT_ERROR);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_DIAGSW_1_1_000000_WaitForCommissionee
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"];
dispatch_queue_t queue = dispatch_get_main_queue();
WaitForCommissionee(expectation, queue);
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_DIAGSW_1_1_000001_ReadAttribute
{
XCTestExpectation * expectation =
[self expectationWithDescription:@"Reads CurrentHeapFree non-global attribute value from DUT"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestSoftwareDiagnostics * cluster = [[CHIPTestSoftwareDiagnostics alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeCurrentHeapFreeWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"Reads CurrentHeapFree non-global attribute value from DUT Error: %@", err);
if (err.code == CHIPErrorCodeUnsupportedAttribute) {
[expectation fulfill];
return;
}
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_DIAGSW_1_1_000002_ReadAttribute
{
XCTestExpectation * expectation =
[self expectationWithDescription:@"Reads CurrentHeapUsed non-global attribute value from DUT"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestSoftwareDiagnostics * cluster = [[CHIPTestSoftwareDiagnostics alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeCurrentHeapUsedWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"Reads CurrentHeapUsed non-global attribute value from DUT Error: %@", err);
if (err.code == CHIPErrorCodeUnsupportedAttribute) {
[expectation fulfill];
return;
}
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_DIAGSW_1_1_000003_ReadAttribute
{
XCTestExpectation * expectation =
[self expectationWithDescription:@"Reads CurrentHeapHighWaterMark non-global attribute value from DUT"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestSoftwareDiagnostics * cluster = [[CHIPTestSoftwareDiagnostics alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeCurrentHeapHighWatermarkWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"Reads CurrentHeapHighWaterMark non-global attribute value from DUT Error: %@", err);
if (err.code == CHIPErrorCodeUnsupportedAttribute) {
[expectation fulfill];
return;
}
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_DIAGSW_3_2_000000_WaitForCommissionee
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"];
dispatch_queue_t queue = dispatch_get_main_queue();
WaitForCommissionee(expectation, queue);
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTestSubscribe_OnOff_000000_WaitForCommissionee
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"];
dispatch_queue_t queue = dispatch_get_main_queue();
WaitForCommissionee(expectation, queue);
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTestSubscribe_OnOff_000001_Off
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Set OnOff Attribute to false"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster offWithCompletionHandler:^(NSError * _Nullable err) {
NSLog(@"Set OnOff Attribute to false Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
bool testSendClusterTestSubscribe_OnOff_000002_WaitForReport_Fulfilled = false;
ResponseHandler test_TestSubscribe_OnOff_OnOff_Reported = nil;
- (void)testSendClusterTestSubscribe_OnOff_000002_WaitForReport
{
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
test_TestSubscribe_OnOff_OnOff_Reported = ^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"Report: Subscribe OnOff Attribute Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertEqual([actualValue boolValue], false);
}
testSendClusterTestSubscribe_OnOff_000002_WaitForReport_Fulfilled = true;
};
}
- (void)testSendClusterTestSubscribe_OnOff_000003_SubscribeAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Subscribe OnOff Attribute"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
uint16_t minIntervalArgument = 2U;
uint16_t maxIntervalArgument = 10U;
[cluster subscribeAttributeOnOffWithMinInterval:minIntervalArgument
maxInterval:maxIntervalArgument
subscriptionEstablished:^{
XCTAssertEqual(testSendClusterTestSubscribe_OnOff_000002_WaitForReport_Fulfilled, true);
[expectation fulfill];
}
reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"Subscribe OnOff Attribute Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
if (test_TestSubscribe_OnOff_OnOff_Reported != nil) {
ResponseHandler callback = test_TestSubscribe_OnOff_OnOff_Reported;
test_TestSubscribe_OnOff_OnOff_Reported = nil;
callback(value, err);
}
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTestSubscribe_OnOff_000004_On
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Turn On the light to see attribute change"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster onWithCompletionHandler:^(NSError * _Nullable err) {
NSLog(@"Turn On the light to see attribute change Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTestSubscribe_OnOff_000005_WaitForReport
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Check for attribute report"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
test_TestSubscribe_OnOff_OnOff_Reported = ^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"Check for attribute report Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertEqual([actualValue boolValue], true);
}
[expectation fulfill];
};
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTestSubscribe_OnOff_000006_Off
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Turn Off the light to see attribute change"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster offWithCompletionHandler:^(NSError * _Nullable err) {
NSLog(@"Turn Off the light to see attribute change Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTestSubscribe_OnOff_000007_WaitForReport
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Check for attribute report"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
test_TestSubscribe_OnOff_OnOff_Reported = ^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"Check for attribute report Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertEqual([actualValue boolValue], false);
}
[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)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)testSendClusterApplicationBasicReadAttributeVendorNameWithCompletionHandler
{
dispatch_queue_t queue = dispatch_get_main_queue();
XCTestExpectation * connectedExpectation =
[self expectationWithDescription:@"Wait for the commissioned device to be retrieved"];
WaitForCommissionee(connectedExpectation, queue);
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
CHIPDevice * device = GetConnectedDevice();
CHIPApplicationBasic * cluster = [[CHIPApplicationBasic alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
XCTestExpectation * expectation =
[self expectationWithDescription:@"ApplicationBasicReadAttributeVendorNameWithCompletionHandler"];
[cluster readAttributeVendorNameWithCompletionHandler:^(NSString * _Nullable value, NSError * _Nullable err) {
NSLog(@"ApplicationBasic VendorName Error: %@", err);
XCTAssertEqual(err.code, 0);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterApplicationBasicReadAttributeVendorIdWithCompletionHandler
{
dispatch_queue_t queue = dispatch_get_main_queue();
XCTestExpectation * connectedExpectation =
[self expectationWithDescription:@"Wait for the commissioned device to be retrieved"];
WaitForCommissionee(connectedExpectation, queue);
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
CHIPDevice * device = GetConnectedDevice();
CHIPApplicationBasic * cluster = [[CHIPApplicationBasic alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
XCTestExpectation * expectation =
[self expectationWithDescription:@"ApplicationBasicReadAttributeVendorIdWithCompletionHandler"];
[cluster readAttributeVendorIdWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"ApplicationBasic VendorId Error: %@", err);
XCTAssertEqual(err.code, 0);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterApplicationBasicReadAttributeApplicationNameWithCompletionHandler
{
dispatch_queue_t queue = dispatch_get_main_queue();
XCTestExpectation * connectedExpectation =
[self expectationWithDescription:@"Wait for the commissioned device to be retrieved"];
WaitForCommissionee(connectedExpectation, queue);
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
CHIPDevice * device = GetConnectedDevice();
CHIPApplicationBasic * cluster = [[CHIPApplicationBasic alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
XCTestExpectation * expectation =
[self expectationWithDescription:@"ApplicationBasicReadAttributeApplicationNameWithCompletionHandler"];
[cluster readAttributeApplicationNameWithCompletionHandler:^(NSString * _Nullable value, NSError * _Nullable err) {
NSLog(@"ApplicationBasic ApplicationName Error: %@", err);
XCTAssertEqual(err.code, 0);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterApplicationBasicReadAttributeProductIdWithCompletionHandler
{
dispatch_queue_t queue = dispatch_get_main_queue();
XCTestExpectation * connectedExpectation =
[self expectationWithDescription:@"Wait for the commissioned device to be retrieved"];
WaitForCommissionee(connectedExpectation, queue);
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
CHIPDevice * device = GetConnectedDevice();
CHIPApplicationBasic * cluster = [[CHIPApplicationBasic alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
XCTestExpectation * expectation =
[self expectationWithDescription:@"ApplicationBasicReadAttributeProductIdWithCompletionHandler"];
[cluster readAttributeProductIdWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"ApplicationBasic ProductId Error: %@", err);
XCTAssertEqual(err.code, 0);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterApplicationBasicReadAttributeApplicationStatusWithCompletionHandler
{
dispatch_queue_t queue = dispatch_get_main_queue();
XCTestExpectation * connectedExpectation =
[self expectationWithDescription:@"Wait for the commissioned device to be retrieved"];
WaitForCommissionee(connectedExpectation, queue);
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
CHIPDevice * device = GetConnectedDevice();
CHIPApplicationBasic * cluster = [[CHIPApplicationBasic alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
XCTestExpectation * expectation =
[self expectationWithDescription:@"ApplicationBasicReadAttributeApplicationStatusWithCompletionHandler"];
[cluster readAttributeApplicationStatusWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"ApplicationBasic ApplicationStatus Error: %@", err);
XCTAssertEqual(err.code, 0);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterApplicationBasicReadAttributeApplicationVersionWithCompletionHandler
{
dispatch_queue_t queue = dispatch_get_main_queue();
XCTestExpectation * connectedExpectation =
[self expectationWithDescription:@"Wait for the commissioned device to be retrieved"];
WaitForCommissionee(connectedExpectation, queue);
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
CHIPDevice * device = GetConnectedDevice();
CHIPApplicationBasic * cluster = [[CHIPApplicationBasic alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
XCTestExpectation * expectation =
[self expectationWithDescription:@"ApplicationBasicReadAttributeApplicationVersionWithCompletionHandler"];
[cluster readAttributeApplicationVersionWithCompletionHandler:^(NSString * _Nullable value, NSError * _Nullable err) {
NSLog(@"ApplicationBasic ApplicationVersion Error: %@", err);
XCTAssertEqual(err.code, 0);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterApplicationBasicReadAttributeAttributeListWithCompletionHandler
{
dispatch_queue_t queue = dispatch_get_main_queue();
XCTestExpectation * connectedExpectation =
[self expectationWithDescription:@"Wait for the commissioned device to be retrieved"];
WaitForCommissionee(connectedExpectation, queue);
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
CHIPDevice * device = GetConnectedDevice();
CHIPApplicationBasic * cluster = [[CHIPApplicationBasic alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
XCTestExpectation * expectation =
[self expectationWithDescription:@"ApplicationBasicReadAttributeAttributeListWithCompletionHandler"];
[cluster readAttributeAttributeListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) {
NSLog(@"ApplicationBasic AttributeList Error: %@", err);
XCTAssertEqual(err.code, 0);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterApplicationBasicReadAttributeClusterRevisionWithCompletionHandler
{
dispatch_queue_t queue = dispatch_get_main_queue();
XCTestExpectation * connectedExpectation =
[self expectationWithDescription:@"Wait for the commissioned device to be retrieved"];
WaitForCommissionee(connectedExpectation, queue);
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
CHIPDevice * device = GetConnectedDevice();
CHIPApplicationBasic * cluster = [[CHIPApplicationBasic alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
XCTestExpectation * expectation =
[self expectationWithDescription:@"ApplicationBasicReadAttributeClusterRevisionWithCompletionHandler"];
[cluster readAttributeClusterRevisionWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"ApplicationBasic 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)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)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)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)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)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)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)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)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)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)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)testSendClusterContentLauncherReadAttributeAcceptsHeaderListWithCompletionHandler
{
dispatch_queue_t queue = dispatch_get_main_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:@"ContentLauncherReadAttributeAcceptsHeaderListWithCompletionHandler"];
[cluster readAttributeAcceptsHeaderListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) {
NSLog(@"ContentLauncher AcceptsHeaderList 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)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)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)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)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)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)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)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)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)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)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)testSendClusterGeneralCommissioningReadAttributeBasicCommissioningInfoListWithCompletionHandler
{
dispatch_queue_t queue = dispatch_get_main_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:@"GeneralCommissioningReadAttributeBasicCommissioningInfoListWithCompletionHandler"];
[cluster readAttributeBasicCommissioningInfoListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) {
NSLog(@"GeneralCommissioning BasicCommissioningInfoList 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)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)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)testSendClusterGroupKeyManagementReadAttributeGroupsWithCompletionHandler
{
dispatch_queue_t queue = dispatch_get_main_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:@"GroupKeyManagementReadAttributeGroupsWithCompletionHandler"];
[cluster readAttributeGroupsWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) {
NSLog(@"GroupKeyManagement Groups Error: %@", err);
XCTAssertEqual(err.code, 0);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterGroupKeyManagementReadAttributeGroupKeysWithCompletionHandler
{
dispatch_queue_t queue = dispatch_get_main_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:@"GroupKeyManagementReadAttributeGroupKeysWithCompletionHandler"];
[cluster readAttributeGroupKeysWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) {
NSLog(@"GroupKeyManagement GroupKeys 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)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)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)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)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 * _Nonnull 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)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)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)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)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)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)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)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)testSendClusterNetworkCommissioningReadAttributeMaxNetworksWithCompletionHandler
{
dispatch_queue_t queue = dispatch_get_main_queue();
XCTestExpectation * connectedExpectation =
[self expectationWithDescription:@"Wait for the commissioned device to be retrieved"];
WaitForCommissionee(connectedExpectation, queue);
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
CHIPDevice * device = GetConnectedDevice();
CHIPNetworkCommissioning * cluster = [[CHIPNetworkCommissioning alloc] initWithDevice:device endpoint:0 queue:queue];
XCTAssertNotNil(cluster);
XCTestExpectation * expectation =
[self expectationWithDescription:@"NetworkCommissioningReadAttributeMaxNetworksWithCompletionHandler"];
[cluster readAttributeMaxNetworksWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"NetworkCommissioning MaxNetworks Error: %@", err);
XCTAssertEqual(err.code, 0);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterNetworkCommissioningReadAttributeNetworksWithCompletionHandler
{
dispatch_queue_t queue = dispatch_get_main_queue();
XCTestExpectation * connectedExpectation =
[self expectationWithDescription:@"Wait for the commissioned device to be retrieved"];
WaitForCommissionee(connectedExpectation, queue);
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
CHIPDevice * device = GetConnectedDevice();
CHIPNetworkCommissioning * cluster = [[CHIPNetworkCommissioning alloc] initWithDevice:device endpoint:0 queue:queue];
XCTAssertNotNil(cluster);
XCTestExpectation * expectation =
[self expectationWithDescription:@"NetworkCommissioningReadAttributeNetworksWithCompletionHandler"];
[cluster readAttributeNetworksWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) {
NSLog(@"NetworkCommissioning Networks Error: %@", err);
XCTAssertEqual(err.code, 0);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterNetworkCommissioningReadAttributeScanMaxTimeSecondsWithCompletionHandler
{
dispatch_queue_t queue = dispatch_get_main_queue();
XCTestExpectation * connectedExpectation =
[self expectationWithDescription:@"Wait for the commissioned device to be retrieved"];
WaitForCommissionee(connectedExpectation, queue);
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
CHIPDevice * device = GetConnectedDevice();
CHIPNetworkCommissioning * cluster = [[CHIPNetworkCommissioning alloc] initWithDevice:device endpoint:0 queue:queue];
XCTAssertNotNil(cluster);
XCTestExpectation * expectation =
[self expectationWithDescription:@"NetworkCommissioningReadAttributeScanMaxTimeSecondsWithCompletionHandler"];
[cluster readAttributeScanMaxTimeSecondsWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"NetworkCommissioning ScanMaxTimeSeconds Error: %@", err);
XCTAssertEqual(err.code, 0);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterNetworkCommissioningReadAttributeConnectMaxTimeSecondsWithCompletionHandler
{
dispatch_queue_t queue = dispatch_get_main_queue();
XCTestExpectation * connectedExpectation =
[self expectationWithDescription:@"Wait for the commissioned device to be retrieved"];
WaitForCommissionee(connectedExpectation, queue);
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
CHIPDevice * device = GetConnectedDevice();
CHIPNetworkCommissioning * cluster = [[CHIPNetworkCommissioning alloc] initWithDevice:device endpoint:0 queue:queue];
XCTAssertNotNil(cluster);
XCTestExpectation * expectation =
[self expectationWithDescription:@"NetworkCommissioningReadAttributeConnectMaxTimeSecondsWithCompletionHandler"];
[cluster readAttributeConnectMaxTimeSecondsWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"NetworkCommissioning ConnectMaxTimeSeconds Error: %@", err);
XCTAssertEqual(err.code, 0);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterNetworkCommissioningReadAttributeInterfaceEnabledWithCompletionHandler
{
dispatch_queue_t queue = dispatch_get_main_queue();
XCTestExpectation * connectedExpectation =
[self expectationWithDescription:@"Wait for the commissioned device to be retrieved"];
WaitForCommissionee(connectedExpectation, queue);
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
CHIPDevice * device = GetConnectedDevice();
CHIPNetworkCommissioning * cluster = [[CHIPNetworkCommissioning alloc] initWithDevice:device endpoint:0 queue:queue];
XCTAssertNotNil(cluster);
XCTestExpectation * expectation =
[self expectationWithDescription:@"NetworkCommissioningReadAttributeInterfaceEnabledWithCompletionHandler"];
[cluster readAttributeInterfaceEnabledWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"NetworkCommissioning InterfaceEnabled Error: %@", err);
XCTAssertEqual(err.code, 0);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterNetworkCommissioningWriteAttributeInterfaceEnabledWithValue
{
dispatch_queue_t queue = dispatch_get_main_queue();
XCTestExpectation * connectedExpectation =
[self expectationWithDescription:@"Wait for the commissioned device to be retrieved"];
WaitForCommissionee(connectedExpectation, queue);
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
CHIPDevice * device = GetConnectedDevice();
CHIPNetworkCommissioning * cluster = [[CHIPNetworkCommissioning alloc] initWithDevice:device endpoint:0 queue:queue];
XCTAssertNotNil(cluster);
XCTestExpectation * expectation =
[self expectationWithDescription:@"NetworkCommissioningWriteAttributeInterfaceEnabledWithValue"];
NSNumber * _Nonnull value = @(0);
[cluster writeAttributeInterfaceEnabledWithValue:value
completionHandler:^(NSError * _Nullable err) {
NSLog(@"NetworkCommissioning InterfaceEnabled Error: %@", err);
XCTAssertEqual(err.code, 0);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterNetworkCommissioningReadAttributeLastNetworkingStatusWithCompletionHandler
{
dispatch_queue_t queue = dispatch_get_main_queue();
XCTestExpectation * connectedExpectation =
[self expectationWithDescription:@"Wait for the commissioned device to be retrieved"];
WaitForCommissionee(connectedExpectation, queue);
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
CHIPDevice * device = GetConnectedDevice();
CHIPNetworkCommissioning * cluster = [[CHIPNetworkCommissioning alloc] initWithDevice:device endpoint:0 queue:queue];
XCTAssertNotNil(cluster);
XCTestExpectation * expectation =
[self expectationWithDescription:@"NetworkCommissioningReadAttributeLastNetworkingStatusWithCompletionHandler"];
[cluster readAttributeLastNetworkingStatusWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"NetworkCommissioning LastNetworkingStatus Error: %@", err);
XCTAssertEqual(err.code, 0);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterNetworkCommissioningReadAttributeLastNetworkIDWithCompletionHandler
{
dispatch_queue_t queue = dispatch_get_main_queue();
XCTestExpectation * connectedExpectation =
[self expectationWithDescription:@"Wait for the commissioned device to be retrieved"];
WaitForCommissionee(connectedExpectation, queue);
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
CHIPDevice * device = GetConnectedDevice();
CHIPNetworkCommissioning * cluster = [[CHIPNetworkCommissioning alloc] initWithDevice:device endpoint:0 queue:queue];
XCTAssertNotNil(cluster);
XCTestExpectation * expectation =
[self expectationWithDescription:@"NetworkCommissioningReadAttributeLastNetworkIDWithCompletionHandler"];
[cluster readAttributeLastNetworkIDWithCompletionHandler:^(NSData * _Nullable value, NSError * _Nullable err) {
NSLog(@"NetworkCommissioning LastNetworkID Error: %@", err);
XCTAssertEqual(err.code, 0);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterNetworkCommissioningReadAttributeLastConnectErrorValueWithCompletionHandler
{
dispatch_queue_t queue = dispatch_get_main_queue();
XCTestExpectation * connectedExpectation =
[self expectationWithDescription:@"Wait for the commissioned device to be retrieved"];
WaitForCommissionee(connectedExpectation, queue);
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
CHIPDevice * device = GetConnectedDevice();
CHIPNetworkCommissioning * cluster = [[CHIPNetworkCommissioning alloc] initWithDevice:device endpoint:0 queue:queue];
XCTAssertNotNil(cluster);
XCTestExpectation * expectation =
[self expectationWithDescription:@"NetworkCommissioningReadAttributeLastConnectErrorValueWithCompletionHandler"];
[cluster readAttributeLastConnectErrorValueWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"NetworkCommissioning LastConnectErrorValue Error: %@", err);
XCTAssertEqual(err.code, 0);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterNetworkCommissioningReadAttributeFeatureMapWithCompletionHandler
{
dispatch_queue_t queue = dispatch_get_main_queue();
XCTestExpectation * connectedExpectation =
[self expectationWithDescription:@"Wait for the commissioned device to be retrieved"];
WaitForCommissionee(connectedExpectation, queue);
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
CHIPDevice * device = GetConnectedDevice();
CHIPNetworkCommissioning * cluster = [[CHIPNetworkCommissioning alloc] initWithDevice:device endpoint:0 queue:queue];
XCTAssertNotNil(cluster);
XCTestExpectation * expectation =
[self expectationWithDescription:@"NetworkCommissioningReadAttributeFeatureMapWithCompletionHandler"];
[cluster readAttributeFeatureMapWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"NetworkCommissioning FeatureMap Error: %@", err);
XCTAssertEqual(err.code, 0);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterNetworkCommissioningReadAttributeClusterRevisionWithCompletionHandler
{
dispatch_queue_t queue = dispatch_get_main_queue();
XCTestExpectation * connectedExpectation =
[self expectationWithDescription:@"Wait for the commissioned device to be retrieved"];
WaitForCommissionee(connectedExpectation, queue);
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
CHIPDevice * device = GetConnectedDevice();
CHIPNetworkCommissioning * cluster = [[CHIPNetworkCommissioning alloc] initWithDevice:device endpoint:0 queue:queue];
XCTAssertNotNil(cluster);
XCTestExpectation * expectation =
[self expectationWithDescription:@"NetworkCommissioningReadAttributeClusterRevisionWithCompletionHandler"];
[cluster readAttributeClusterRevisionWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"NetworkCommissioning ClusterRevision Error: %@", err);
XCTAssertEqual(err.code, 0);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterOtaSoftwareUpdateProviderReadAttributeAttributeListWithCompletionHandler
{
dispatch_queue_t queue = dispatch_get_main_queue();
XCTestExpectation * connectedExpectation =
[self expectationWithDescription:@"Wait for the commissioned device to be retrieved"];
WaitForCommissionee(connectedExpectation, queue);
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
CHIPDevice * device = GetConnectedDevice();
CHIPOtaSoftwareUpdateProvider * cluster = [[CHIPOtaSoftwareUpdateProvider alloc] initWithDevice:device endpoint:0 queue:queue];
XCTAssertNotNil(cluster);
XCTestExpectation * expectation =
[self expectationWithDescription:@"OtaSoftwareUpdateProviderReadAttributeAttributeListWithCompletionHandler"];
[cluster readAttributeAttributeListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) {
NSLog(@"OtaSoftwareUpdateProvider AttributeList Error: %@", err);
XCTAssertEqual(err.code, 0);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterOtaSoftwareUpdateProviderReadAttributeClusterRevisionWithCompletionHandler
{
dispatch_queue_t queue = dispatch_get_main_queue();
XCTestExpectation * connectedExpectation =
[self expectationWithDescription:@"Wait for the commissioned device to be retrieved"];
WaitForCommissionee(connectedExpectation, queue);
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
CHIPDevice * device = GetConnectedDevice();
CHIPOtaSoftwareUpdateProvider * cluster = [[CHIPOtaSoftwareUpdateProvider alloc] initWithDevice:device endpoint:0 queue:queue];
XCTAssertNotNil(cluster);
XCTestExpectation * expectation =
[self expectationWithDescription:@"OtaSoftwareUpdateProviderReadAttributeClusterRevisionWithCompletionHandler"];
[cluster readAttributeClusterRevisionWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"OtaSoftwareUpdateProvider ClusterRevision Error: %@", err);
XCTAssertEqual(err.code, 0);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterOtaSoftwareUpdateRequestorReadAttributeDefaultOtaProviderWithCompletionHandler
{
dispatch_queue_t queue = dispatch_get_main_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:@"OtaSoftwareUpdateRequestorReadAttributeDefaultOtaProviderWithCompletionHandler"];
[cluster readAttributeDefaultOtaProviderWithCompletionHandler:^(NSData * _Nullable value, NSError * _Nullable err) {
NSLog(@"OtaSoftwareUpdateRequestor DefaultOtaProvider Error: %@", err);
XCTAssertEqual(err.code, 0);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterOtaSoftwareUpdateRequestorWriteAttributeDefaultOtaProviderWithValue
{
dispatch_queue_t queue = dispatch_get_main_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:@"OtaSoftwareUpdateRequestorWriteAttributeDefaultOtaProviderWithValue"];
NSData * _Nonnull value = [@"Test" dataUsingEncoding:NSUTF8StringEncoding];
[cluster writeAttributeDefaultOtaProviderWithValue:value
completionHandler:^(NSError * _Nullable err) {
NSLog(@"OtaSoftwareUpdateRequestor DefaultOtaProvider 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)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)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)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)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)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)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)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)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)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)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)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)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)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)testSendClusterTvChannelReadAttributeChannelListWithCompletionHandler
{
dispatch_queue_t queue = dispatch_get_main_queue();
XCTestExpectation * connectedExpectation =
[self expectationWithDescription:@"Wait for the commissioned device to be retrieved"];
WaitForCommissionee(connectedExpectation, queue);
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
CHIPDevice * device = GetConnectedDevice();
CHIPTvChannel * cluster = [[CHIPTvChannel alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
XCTestExpectation * expectation = [self expectationWithDescription:@"TvChannelReadAttributeChannelListWithCompletionHandler"];
[cluster readAttributeChannelListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) {
NSLog(@"TvChannel ChannelList Error: %@", err);
XCTAssertEqual(err.code, 0);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTvChannelReadAttributeAttributeListWithCompletionHandler
{
dispatch_queue_t queue = dispatch_get_main_queue();
XCTestExpectation * connectedExpectation =
[self expectationWithDescription:@"Wait for the commissioned device to be retrieved"];
WaitForCommissionee(connectedExpectation, queue);
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
CHIPDevice * device = GetConnectedDevice();
CHIPTvChannel * cluster = [[CHIPTvChannel alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
XCTestExpectation * expectation = [self expectationWithDescription:@"TvChannelReadAttributeAttributeListWithCompletionHandler"];
[cluster readAttributeAttributeListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) {
NSLog(@"TvChannel AttributeList Error: %@", err);
XCTAssertEqual(err.code, 0);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTvChannelReadAttributeClusterRevisionWithCompletionHandler
{
dispatch_queue_t queue = dispatch_get_main_queue();
XCTestExpectation * connectedExpectation =
[self expectationWithDescription:@"Wait for the commissioned device to be retrieved"];
WaitForCommissionee(connectedExpectation, queue);
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
CHIPDevice * device = GetConnectedDevice();
CHIPTvChannel * cluster = [[CHIPTvChannel alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
XCTestExpectation * expectation =
[self expectationWithDescription:@"TvChannelReadAttributeClusterRevisionWithCompletionHandler"];
[cluster readAttributeClusterRevisionWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"TvChannel 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)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)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:^(NSData * _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)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)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)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)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)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)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