blob: d202049ebdfb1932bfabb02709b256403fc9adbc [file] [log] [blame]
//
// CHIPClustersTests.m
// CHIPClustersTests
/*
*
* Copyright (c) 2022 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 = 20;
const uint64_t nodeId = 0x12344321;
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 Log(XCTestExpectation * expectation, dispatch_queue_t queue, NSString * message)
{
NSLog(@"%@", message);
[expectation fulfill];
}
// Stub for User Prompts for XCTests to run.
void UserPrompt(XCTestExpectation * expectation, dispatch_queue_t queue, NSString * message) { [expectation fulfill]; }
void WaitForCommissionee(XCTestExpectation * expectation, dispatch_queue_t queue, uint64_t deviceId)
{
CHIPDeviceController * controller = [CHIPDeviceController sharedController];
XCTAssertNotNil(controller);
[controller getConnectedDevice:deviceId
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)onCommissioningComplete:(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:nodeId
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:nodeId
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);
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:nodeId
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)testSendClusterTestAccessControlCluster_000000_WaitForCommissionee
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Wait for commissionee"];
dispatch_queue_t queue = dispatch_get_main_queue();
WaitForCommissionee(expectation, queue, 305414945);
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTestAccessControlCluster_000001_WriteAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Write three entries"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestAccessControl * cluster = [[CHIPTestAccessControl alloc] initWithDevice:device endpoint:0 queue:queue];
XCTAssertNotNil(cluster);
id aclArgument;
{
NSMutableArray * temp_0 = [[NSMutableArray alloc] init];
temp_0[0] = [[CHIPAccessControlClusterAccessControlEntry alloc] init];
((CHIPAccessControlClusterAccessControlEntry *) temp_0[0]).fabricIndex = [NSNumber numberWithUnsignedChar:0];
((CHIPAccessControlClusterAccessControlEntry *) temp_0[0]).privilege = [NSNumber numberWithUnsignedChar:5];
((CHIPAccessControlClusterAccessControlEntry *) temp_0[0]).authMode = [NSNumber numberWithUnsignedChar:2];
((CHIPAccessControlClusterAccessControlEntry *) temp_0[0]).subjects = nil;
{
NSMutableArray * temp_3 = [[NSMutableArray alloc] init];
temp_3[0] = [[CHIPAccessControlClusterTarget alloc] init];
((CHIPAccessControlClusterTarget *) temp_3[0]).cluster = nil;
((CHIPAccessControlClusterTarget *) temp_3[0]).endpoint = [NSNumber numberWithUnsignedShort:0U];
((CHIPAccessControlClusterTarget *) temp_3[0]).deviceType = nil;
temp_3[1] = [[CHIPAccessControlClusterTarget alloc] init];
((CHIPAccessControlClusterTarget *) temp_3[1]).cluster = [NSNumber numberWithUnsignedInt:1UL];
((CHIPAccessControlClusterTarget *) temp_3[1]).endpoint = nil;
((CHIPAccessControlClusterTarget *) temp_3[1]).deviceType = nil;
temp_3[2] = [[CHIPAccessControlClusterTarget alloc] init];
((CHIPAccessControlClusterTarget *) temp_3[2]).cluster = [NSNumber numberWithUnsignedInt:2UL];
((CHIPAccessControlClusterTarget *) temp_3[2]).endpoint = [NSNumber numberWithUnsignedShort:3U];
((CHIPAccessControlClusterTarget *) temp_3[2]).deviceType = nil;
((CHIPAccessControlClusterAccessControlEntry *) temp_0[0]).targets = temp_3;
}
temp_0[1] = [[CHIPAccessControlClusterAccessControlEntry alloc] init];
((CHIPAccessControlClusterAccessControlEntry *) temp_0[1]).fabricIndex = [NSNumber numberWithUnsignedChar:0];
((CHIPAccessControlClusterAccessControlEntry *) temp_0[1]).privilege = [NSNumber numberWithUnsignedChar:1];
((CHIPAccessControlClusterAccessControlEntry *) temp_0[1]).authMode = [NSNumber numberWithUnsignedChar:2];
{
NSMutableArray * temp_3 = [[NSMutableArray alloc] init];
temp_3[0] = [NSNumber numberWithUnsignedLongLong:1234ULL];
temp_3[1] = [NSNumber numberWithUnsignedLongLong:5678ULL];
temp_3[2] = [NSNumber numberWithUnsignedLongLong:32896ULL];
temp_3[3] = [NSNumber numberWithUnsignedLongLong:65535ULL];
((CHIPAccessControlClusterAccessControlEntry *) temp_0[1]).subjects = temp_3;
}
{
NSMutableArray * temp_3 = [[NSMutableArray alloc] init];
temp_3[0] = [[CHIPAccessControlClusterTarget alloc] init];
((CHIPAccessControlClusterTarget *) temp_3[0]).cluster = nil;
((CHIPAccessControlClusterTarget *) temp_3[0]).endpoint = [NSNumber numberWithUnsignedShort:1U];
((CHIPAccessControlClusterTarget *) temp_3[0]).deviceType = nil;
temp_3[1] = [[CHIPAccessControlClusterTarget alloc] init];
((CHIPAccessControlClusterTarget *) temp_3[1]).cluster = [NSNumber numberWithUnsignedInt:2UL];
((CHIPAccessControlClusterTarget *) temp_3[1]).endpoint = nil;
((CHIPAccessControlClusterTarget *) temp_3[1]).deviceType = nil;
temp_3[2] = [[CHIPAccessControlClusterTarget alloc] init];
((CHIPAccessControlClusterTarget *) temp_3[2]).cluster = [NSNumber numberWithUnsignedInt:3UL];
((CHIPAccessControlClusterTarget *) temp_3[2]).endpoint = [NSNumber numberWithUnsignedShort:4U];
((CHIPAccessControlClusterTarget *) temp_3[2]).deviceType = nil;
((CHIPAccessControlClusterAccessControlEntry *) temp_0[1]).targets = temp_3;
}
temp_0[2] = [[CHIPAccessControlClusterAccessControlEntry alloc] init];
((CHIPAccessControlClusterAccessControlEntry *) temp_0[2]).fabricIndex = [NSNumber numberWithUnsignedChar:0];
((CHIPAccessControlClusterAccessControlEntry *) temp_0[2]).privilege = [NSNumber numberWithUnsignedChar:3];
((CHIPAccessControlClusterAccessControlEntry *) temp_0[2]).authMode = [NSNumber numberWithUnsignedChar:3];
{
NSMutableArray * temp_3 = [[NSMutableArray alloc] init];
temp_3[0] = [NSNumber numberWithUnsignedLongLong:257ULL];
temp_3[1] = [NSNumber numberWithUnsignedLongLong:258ULL];
temp_3[2] = [NSNumber numberWithUnsignedLongLong:43690ULL];
temp_3[3] = [NSNumber numberWithUnsignedLongLong:48059ULL];
((CHIPAccessControlClusterAccessControlEntry *) temp_0[2]).subjects = temp_3;
}
{
NSMutableArray * temp_3 = [[NSMutableArray alloc] init];
temp_3[0] = [[CHIPAccessControlClusterTarget alloc] init];
((CHIPAccessControlClusterTarget *) temp_3[0]).cluster = nil;
((CHIPAccessControlClusterTarget *) temp_3[0]).endpoint = [NSNumber numberWithUnsignedShort:2U];
((CHIPAccessControlClusterTarget *) temp_3[0]).deviceType = nil;
temp_3[1] = [[CHIPAccessControlClusterTarget alloc] init];
((CHIPAccessControlClusterTarget *) temp_3[1]).cluster = [NSNumber numberWithUnsignedInt:3UL];
((CHIPAccessControlClusterTarget *) temp_3[1]).endpoint = nil;
((CHIPAccessControlClusterTarget *) temp_3[1]).deviceType = nil;
temp_3[2] = [[CHIPAccessControlClusterTarget alloc] init];
((CHIPAccessControlClusterTarget *) temp_3[2]).cluster = [NSNumber numberWithUnsignedInt:4UL];
((CHIPAccessControlClusterTarget *) temp_3[2]).endpoint = [NSNumber numberWithUnsignedShort:5U];
((CHIPAccessControlClusterTarget *) temp_3[2]).deviceType = nil;
((CHIPAccessControlClusterAccessControlEntry *) temp_0[2]).targets = temp_3;
}
aclArgument = temp_0;
}
[cluster writeAttributeAclWithValue:aclArgument
completionHandler:^(NSError * _Nullable err) {
NSLog(@"Write three entries Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTestAccessControlCluster_000002_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Read three entries"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestAccessControl * cluster = [[CHIPTestAccessControl alloc] initWithDevice:device endpoint:0 queue:queue];
XCTAssertNotNil(cluster);
CHIPReadParams * params = [[CHIPReadParams alloc] init];
params.fabricFiltered = [NSNumber numberWithBool:true];
[cluster
readAttributeAclWithParams:params
completionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) {
NSLog(@"Read three entries Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertEqual([actualValue count], 3);
XCTAssertEqual(
[((CHIPAccessControlClusterAccessControlEntry *) actualValue[0]).fabricIndex unsignedCharValue], 1);
XCTAssertEqual(
[((CHIPAccessControlClusterAccessControlEntry *) actualValue[0]).privilege unsignedCharValue], 5);
XCTAssertEqual(
[((CHIPAccessControlClusterAccessControlEntry *) actualValue[0]).authMode unsignedCharValue], 2);
XCTAssertTrue(((CHIPAccessControlClusterAccessControlEntry *) actualValue[0]).subjects == nil);
XCTAssertFalse(((CHIPAccessControlClusterAccessControlEntry *) actualValue[0]).targets == nil);
XCTAssertEqual([((CHIPAccessControlClusterAccessControlEntry *) actualValue[0]).targets count], 3);
XCTAssertTrue(
((CHIPAccessControlClusterTarget *) ((CHIPAccessControlClusterAccessControlEntry *) actualValue[0])
.targets[0])
.cluster
== nil);
XCTAssertFalse(
((CHIPAccessControlClusterTarget *) ((CHIPAccessControlClusterAccessControlEntry *) actualValue[0])
.targets[0])
.endpoint
== nil);
XCTAssertEqual(
[((CHIPAccessControlClusterTarget *) ((CHIPAccessControlClusterAccessControlEntry *) actualValue[0])
.targets[0]).endpoint unsignedShortValue],
0U);
XCTAssertTrue(
((CHIPAccessControlClusterTarget *) ((CHIPAccessControlClusterAccessControlEntry *) actualValue[0])
.targets[0])
.deviceType
== nil);
XCTAssertFalse(
((CHIPAccessControlClusterTarget *) ((CHIPAccessControlClusterAccessControlEntry *) actualValue[0])
.targets[1])
.cluster
== nil);
XCTAssertEqual(
[((CHIPAccessControlClusterTarget *) ((CHIPAccessControlClusterAccessControlEntry *) actualValue[0])
.targets[1]).cluster unsignedIntValue],
1UL);
XCTAssertTrue(
((CHIPAccessControlClusterTarget *) ((CHIPAccessControlClusterAccessControlEntry *) actualValue[0])
.targets[1])
.endpoint
== nil);
XCTAssertTrue(
((CHIPAccessControlClusterTarget *) ((CHIPAccessControlClusterAccessControlEntry *) actualValue[0])
.targets[1])
.deviceType
== nil);
XCTAssertFalse(
((CHIPAccessControlClusterTarget *) ((CHIPAccessControlClusterAccessControlEntry *) actualValue[0])
.targets[2])
.cluster
== nil);
XCTAssertEqual(
[((CHIPAccessControlClusterTarget *) ((CHIPAccessControlClusterAccessControlEntry *) actualValue[0])
.targets[2]).cluster unsignedIntValue],
2UL);
XCTAssertFalse(
((CHIPAccessControlClusterTarget *) ((CHIPAccessControlClusterAccessControlEntry *) actualValue[0])
.targets[2])
.endpoint
== nil);
XCTAssertEqual(
[((CHIPAccessControlClusterTarget *) ((CHIPAccessControlClusterAccessControlEntry *) actualValue[0])
.targets[2]).endpoint unsignedShortValue],
3U);
XCTAssertTrue(
((CHIPAccessControlClusterTarget *) ((CHIPAccessControlClusterAccessControlEntry *) actualValue[0])
.targets[2])
.deviceType
== nil);
XCTAssertEqual(
[((CHIPAccessControlClusterAccessControlEntry *) actualValue[1]).fabricIndex unsignedCharValue], 1);
XCTAssertEqual(
[((CHIPAccessControlClusterAccessControlEntry *) actualValue[1]).privilege unsignedCharValue], 1);
XCTAssertEqual(
[((CHIPAccessControlClusterAccessControlEntry *) actualValue[1]).authMode unsignedCharValue], 2);
XCTAssertFalse(((CHIPAccessControlClusterAccessControlEntry *) actualValue[1]).subjects == nil);
XCTAssertEqual([((CHIPAccessControlClusterAccessControlEntry *) actualValue[1]).subjects count], 4);
XCTAssertEqual(
[((CHIPAccessControlClusterAccessControlEntry *) actualValue[1]).subjects[0] unsignedLongLongValue],
1234ULL);
XCTAssertEqual(
[((CHIPAccessControlClusterAccessControlEntry *) actualValue[1]).subjects[1] unsignedLongLongValue],
5678ULL);
XCTAssertEqual(
[((CHIPAccessControlClusterAccessControlEntry *) actualValue[1]).subjects[2] unsignedLongLongValue],
32896ULL);
XCTAssertEqual(
[((CHIPAccessControlClusterAccessControlEntry *) actualValue[1]).subjects[3] unsignedLongLongValue],
65535ULL);
XCTAssertFalse(((CHIPAccessControlClusterAccessControlEntry *) actualValue[1]).targets == nil);
XCTAssertEqual([((CHIPAccessControlClusterAccessControlEntry *) actualValue[1]).targets count], 3);
XCTAssertTrue(
((CHIPAccessControlClusterTarget *) ((CHIPAccessControlClusterAccessControlEntry *) actualValue[1])
.targets[0])
.cluster
== nil);
XCTAssertFalse(
((CHIPAccessControlClusterTarget *) ((CHIPAccessControlClusterAccessControlEntry *) actualValue[1])
.targets[0])
.endpoint
== nil);
XCTAssertEqual(
[((CHIPAccessControlClusterTarget *) ((CHIPAccessControlClusterAccessControlEntry *) actualValue[1])
.targets[0]).endpoint unsignedShortValue],
1U);
XCTAssertTrue(
((CHIPAccessControlClusterTarget *) ((CHIPAccessControlClusterAccessControlEntry *) actualValue[1])
.targets[0])
.deviceType
== nil);
XCTAssertFalse(
((CHIPAccessControlClusterTarget *) ((CHIPAccessControlClusterAccessControlEntry *) actualValue[1])
.targets[1])
.cluster
== nil);
XCTAssertEqual(
[((CHIPAccessControlClusterTarget *) ((CHIPAccessControlClusterAccessControlEntry *) actualValue[1])
.targets[1]).cluster unsignedIntValue],
2UL);
XCTAssertTrue(
((CHIPAccessControlClusterTarget *) ((CHIPAccessControlClusterAccessControlEntry *) actualValue[1])
.targets[1])
.endpoint
== nil);
XCTAssertTrue(
((CHIPAccessControlClusterTarget *) ((CHIPAccessControlClusterAccessControlEntry *) actualValue[1])
.targets[1])
.deviceType
== nil);
XCTAssertFalse(
((CHIPAccessControlClusterTarget *) ((CHIPAccessControlClusterAccessControlEntry *) actualValue[1])
.targets[2])
.cluster
== nil);
XCTAssertEqual(
[((CHIPAccessControlClusterTarget *) ((CHIPAccessControlClusterAccessControlEntry *) actualValue[1])
.targets[2]).cluster unsignedIntValue],
3UL);
XCTAssertFalse(
((CHIPAccessControlClusterTarget *) ((CHIPAccessControlClusterAccessControlEntry *) actualValue[1])
.targets[2])
.endpoint
== nil);
XCTAssertEqual(
[((CHIPAccessControlClusterTarget *) ((CHIPAccessControlClusterAccessControlEntry *) actualValue[1])
.targets[2]).endpoint unsignedShortValue],
4U);
XCTAssertTrue(
((CHIPAccessControlClusterTarget *) ((CHIPAccessControlClusterAccessControlEntry *) actualValue[1])
.targets[2])
.deviceType
== nil);
XCTAssertEqual(
[((CHIPAccessControlClusterAccessControlEntry *) actualValue[2]).fabricIndex unsignedCharValue], 1);
XCTAssertEqual(
[((CHIPAccessControlClusterAccessControlEntry *) actualValue[2]).privilege unsignedCharValue], 3);
XCTAssertEqual(
[((CHIPAccessControlClusterAccessControlEntry *) actualValue[2]).authMode unsignedCharValue], 3);
XCTAssertFalse(((CHIPAccessControlClusterAccessControlEntry *) actualValue[2]).subjects == nil);
XCTAssertEqual([((CHIPAccessControlClusterAccessControlEntry *) actualValue[2]).subjects count], 4);
XCTAssertEqual(
[((CHIPAccessControlClusterAccessControlEntry *) actualValue[2]).subjects[0] unsignedLongLongValue],
257ULL);
XCTAssertEqual(
[((CHIPAccessControlClusterAccessControlEntry *) actualValue[2]).subjects[1] unsignedLongLongValue],
258ULL);
XCTAssertEqual(
[((CHIPAccessControlClusterAccessControlEntry *) actualValue[2]).subjects[2] unsignedLongLongValue],
43690ULL);
XCTAssertEqual(
[((CHIPAccessControlClusterAccessControlEntry *) actualValue[2]).subjects[3] unsignedLongLongValue],
48059ULL);
XCTAssertFalse(((CHIPAccessControlClusterAccessControlEntry *) actualValue[2]).targets == nil);
XCTAssertEqual([((CHIPAccessControlClusterAccessControlEntry *) actualValue[2]).targets count], 3);
XCTAssertTrue(
((CHIPAccessControlClusterTarget *) ((CHIPAccessControlClusterAccessControlEntry *) actualValue[2])
.targets[0])
.cluster
== nil);
XCTAssertFalse(
((CHIPAccessControlClusterTarget *) ((CHIPAccessControlClusterAccessControlEntry *) actualValue[2])
.targets[0])
.endpoint
== nil);
XCTAssertEqual(
[((CHIPAccessControlClusterTarget *) ((CHIPAccessControlClusterAccessControlEntry *) actualValue[2])
.targets[0]).endpoint unsignedShortValue],
2U);
XCTAssertTrue(
((CHIPAccessControlClusterTarget *) ((CHIPAccessControlClusterAccessControlEntry *) actualValue[2])
.targets[0])
.deviceType
== nil);
XCTAssertFalse(
((CHIPAccessControlClusterTarget *) ((CHIPAccessControlClusterAccessControlEntry *) actualValue[2])
.targets[1])
.cluster
== nil);
XCTAssertEqual(
[((CHIPAccessControlClusterTarget *) ((CHIPAccessControlClusterAccessControlEntry *) actualValue[2])
.targets[1]).cluster unsignedIntValue],
3UL);
XCTAssertTrue(
((CHIPAccessControlClusterTarget *) ((CHIPAccessControlClusterAccessControlEntry *) actualValue[2])
.targets[1])
.endpoint
== nil);
XCTAssertTrue(
((CHIPAccessControlClusterTarget *) ((CHIPAccessControlClusterAccessControlEntry *) actualValue[2])
.targets[1])
.deviceType
== nil);
XCTAssertFalse(
((CHIPAccessControlClusterTarget *) ((CHIPAccessControlClusterAccessControlEntry *) actualValue[2])
.targets[2])
.cluster
== nil);
XCTAssertEqual(
[((CHIPAccessControlClusterTarget *) ((CHIPAccessControlClusterAccessControlEntry *) actualValue[2])
.targets[2]).cluster unsignedIntValue],
4UL);
XCTAssertFalse(
((CHIPAccessControlClusterTarget *) ((CHIPAccessControlClusterAccessControlEntry *) actualValue[2])
.targets[2])
.endpoint
== nil);
XCTAssertEqual(
[((CHIPAccessControlClusterTarget *) ((CHIPAccessControlClusterAccessControlEntry *) actualValue[2])
.targets[2]).endpoint unsignedShortValue],
5U);
XCTAssertTrue(
((CHIPAccessControlClusterTarget *) ((CHIPAccessControlClusterAccessControlEntry *) actualValue[2])
.targets[2])
.deviceType
== nil);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTestAccessControlCluster_000003_WriteAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Write two entries"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestAccessControl * cluster = [[CHIPTestAccessControl alloc] initWithDevice:device endpoint:0 queue:queue];
XCTAssertNotNil(cluster);
id aclArgument;
{
NSMutableArray * temp_0 = [[NSMutableArray alloc] init];
temp_0[0] = [[CHIPAccessControlClusterAccessControlEntry alloc] init];
((CHIPAccessControlClusterAccessControlEntry *) temp_0[0]).fabricIndex = [NSNumber numberWithUnsignedChar:0];
((CHIPAccessControlClusterAccessControlEntry *) temp_0[0]).privilege = [NSNumber numberWithUnsignedChar:5];
((CHIPAccessControlClusterAccessControlEntry *) temp_0[0]).authMode = [NSNumber numberWithUnsignedChar:2];
((CHIPAccessControlClusterAccessControlEntry *) temp_0[0]).subjects = nil;
{
NSMutableArray * temp_3 = [[NSMutableArray alloc] init];
temp_3[0] = [[CHIPAccessControlClusterTarget alloc] init];
((CHIPAccessControlClusterTarget *) temp_3[0]).cluster = nil;
((CHIPAccessControlClusterTarget *) temp_3[0]).endpoint = [NSNumber numberWithUnsignedShort:0U];
((CHIPAccessControlClusterTarget *) temp_3[0]).deviceType = nil;
temp_3[1] = [[CHIPAccessControlClusterTarget alloc] init];
((CHIPAccessControlClusterTarget *) temp_3[1]).cluster = [NSNumber numberWithUnsignedInt:1UL];
((CHIPAccessControlClusterTarget *) temp_3[1]).endpoint = nil;
((CHIPAccessControlClusterTarget *) temp_3[1]).deviceType = nil;
temp_3[2] = [[CHIPAccessControlClusterTarget alloc] init];
((CHIPAccessControlClusterTarget *) temp_3[2]).cluster = [NSNumber numberWithUnsignedInt:2UL];
((CHIPAccessControlClusterTarget *) temp_3[2]).endpoint = [NSNumber numberWithUnsignedShort:3U];
((CHIPAccessControlClusterTarget *) temp_3[2]).deviceType = nil;
((CHIPAccessControlClusterAccessControlEntry *) temp_0[0]).targets = temp_3;
}
temp_0[1] = [[CHIPAccessControlClusterAccessControlEntry alloc] init];
((CHIPAccessControlClusterAccessControlEntry *) temp_0[1]).fabricIndex = [NSNumber numberWithUnsignedChar:0];
((CHIPAccessControlClusterAccessControlEntry *) temp_0[1]).privilege = [NSNumber numberWithUnsignedChar:1];
((CHIPAccessControlClusterAccessControlEntry *) temp_0[1]).authMode = [NSNumber numberWithUnsignedChar:2];
{
NSMutableArray * temp_3 = [[NSMutableArray alloc] init];
temp_3[0] = [NSNumber numberWithUnsignedLongLong:52428ULL];
temp_3[1] = [NSNumber numberWithUnsignedLongLong:56797ULL];
((CHIPAccessControlClusterAccessControlEntry *) temp_0[1]).subjects = temp_3;
}
{
NSMutableArray * temp_3 = [[NSMutableArray alloc] init];
temp_3[0] = [[CHIPAccessControlClusterTarget alloc] init];
((CHIPAccessControlClusterTarget *) temp_3[0]).cluster = [NSNumber numberWithUnsignedInt:5UL];
((CHIPAccessControlClusterTarget *) temp_3[0]).endpoint = [NSNumber numberWithUnsignedShort:6U];
((CHIPAccessControlClusterTarget *) temp_3[0]).deviceType = nil;
((CHIPAccessControlClusterAccessControlEntry *) temp_0[1]).targets = temp_3;
}
aclArgument = temp_0;
}
[cluster writeAttributeAclWithValue:aclArgument
completionHandler:^(NSError * _Nullable err) {
NSLog(@"Write two entries Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTestAccessControlCluster_000004_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Read two entries"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestAccessControl * cluster = [[CHIPTestAccessControl alloc] initWithDevice:device endpoint:0 queue:queue];
XCTAssertNotNil(cluster);
CHIPReadParams * params = [[CHIPReadParams alloc] init];
params.fabricFiltered = [NSNumber numberWithBool:true];
[cluster
readAttributeAclWithParams:params
completionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) {
NSLog(@"Read two entries Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertEqual([actualValue count], 2);
XCTAssertEqual(
[((CHIPAccessControlClusterAccessControlEntry *) actualValue[0]).fabricIndex unsignedCharValue], 1);
XCTAssertEqual(
[((CHIPAccessControlClusterAccessControlEntry *) actualValue[0]).privilege unsignedCharValue], 5);
XCTAssertEqual(
[((CHIPAccessControlClusterAccessControlEntry *) actualValue[0]).authMode unsignedCharValue], 2);
XCTAssertTrue(((CHIPAccessControlClusterAccessControlEntry *) actualValue[0]).subjects == nil);
XCTAssertFalse(((CHIPAccessControlClusterAccessControlEntry *) actualValue[0]).targets == nil);
XCTAssertEqual([((CHIPAccessControlClusterAccessControlEntry *) actualValue[0]).targets count], 3);
XCTAssertTrue(
((CHIPAccessControlClusterTarget *) ((CHIPAccessControlClusterAccessControlEntry *) actualValue[0])
.targets[0])
.cluster
== nil);
XCTAssertFalse(
((CHIPAccessControlClusterTarget *) ((CHIPAccessControlClusterAccessControlEntry *) actualValue[0])
.targets[0])
.endpoint
== nil);
XCTAssertEqual(
[((CHIPAccessControlClusterTarget *) ((CHIPAccessControlClusterAccessControlEntry *) actualValue[0])
.targets[0]).endpoint unsignedShortValue],
0U);
XCTAssertTrue(
((CHIPAccessControlClusterTarget *) ((CHIPAccessControlClusterAccessControlEntry *) actualValue[0])
.targets[0])
.deviceType
== nil);
XCTAssertFalse(
((CHIPAccessControlClusterTarget *) ((CHIPAccessControlClusterAccessControlEntry *) actualValue[0])
.targets[1])
.cluster
== nil);
XCTAssertEqual(
[((CHIPAccessControlClusterTarget *) ((CHIPAccessControlClusterAccessControlEntry *) actualValue[0])
.targets[1]).cluster unsignedIntValue],
1UL);
XCTAssertTrue(
((CHIPAccessControlClusterTarget *) ((CHIPAccessControlClusterAccessControlEntry *) actualValue[0])
.targets[1])
.endpoint
== nil);
XCTAssertTrue(
((CHIPAccessControlClusterTarget *) ((CHIPAccessControlClusterAccessControlEntry *) actualValue[0])
.targets[1])
.deviceType
== nil);
XCTAssertFalse(
((CHIPAccessControlClusterTarget *) ((CHIPAccessControlClusterAccessControlEntry *) actualValue[0])
.targets[2])
.cluster
== nil);
XCTAssertEqual(
[((CHIPAccessControlClusterTarget *) ((CHIPAccessControlClusterAccessControlEntry *) actualValue[0])
.targets[2]).cluster unsignedIntValue],
2UL);
XCTAssertFalse(
((CHIPAccessControlClusterTarget *) ((CHIPAccessControlClusterAccessControlEntry *) actualValue[0])
.targets[2])
.endpoint
== nil);
XCTAssertEqual(
[((CHIPAccessControlClusterTarget *) ((CHIPAccessControlClusterAccessControlEntry *) actualValue[0])
.targets[2]).endpoint unsignedShortValue],
3U);
XCTAssertTrue(
((CHIPAccessControlClusterTarget *) ((CHIPAccessControlClusterAccessControlEntry *) actualValue[0])
.targets[2])
.deviceType
== nil);
XCTAssertEqual(
[((CHIPAccessControlClusterAccessControlEntry *) actualValue[1]).fabricIndex unsignedCharValue], 1);
XCTAssertEqual(
[((CHIPAccessControlClusterAccessControlEntry *) actualValue[1]).privilege unsignedCharValue], 1);
XCTAssertEqual(
[((CHIPAccessControlClusterAccessControlEntry *) actualValue[1]).authMode unsignedCharValue], 2);
XCTAssertFalse(((CHIPAccessControlClusterAccessControlEntry *) actualValue[1]).subjects == nil);
XCTAssertEqual([((CHIPAccessControlClusterAccessControlEntry *) actualValue[1]).subjects count], 2);
XCTAssertEqual(
[((CHIPAccessControlClusterAccessControlEntry *) actualValue[1]).subjects[0] unsignedLongLongValue],
52428ULL);
XCTAssertEqual(
[((CHIPAccessControlClusterAccessControlEntry *) actualValue[1]).subjects[1] unsignedLongLongValue],
56797ULL);
XCTAssertFalse(((CHIPAccessControlClusterAccessControlEntry *) actualValue[1]).targets == nil);
XCTAssertEqual([((CHIPAccessControlClusterAccessControlEntry *) actualValue[1]).targets count], 1);
XCTAssertFalse(
((CHIPAccessControlClusterTarget *) ((CHIPAccessControlClusterAccessControlEntry *) actualValue[1])
.targets[0])
.cluster
== nil);
XCTAssertEqual(
[((CHIPAccessControlClusterTarget *) ((CHIPAccessControlClusterAccessControlEntry *) actualValue[1])
.targets[0]).cluster unsignedIntValue],
5UL);
XCTAssertFalse(
((CHIPAccessControlClusterTarget *) ((CHIPAccessControlClusterAccessControlEntry *) actualValue[1])
.targets[0])
.endpoint
== nil);
XCTAssertEqual(
[((CHIPAccessControlClusterTarget *) ((CHIPAccessControlClusterAccessControlEntry *) actualValue[1])
.targets[0]).endpoint unsignedShortValue],
6U);
XCTAssertTrue(
((CHIPAccessControlClusterTarget *) ((CHIPAccessControlClusterAccessControlEntry *) actualValue[1])
.targets[0])
.deviceType
== nil);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTestAccessControlCluster_000005_WriteAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Write one entry"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestAccessControl * cluster = [[CHIPTestAccessControl alloc] initWithDevice:device endpoint:0 queue:queue];
XCTAssertNotNil(cluster);
id aclArgument;
{
NSMutableArray * temp_0 = [[NSMutableArray alloc] init];
temp_0[0] = [[CHIPAccessControlClusterAccessControlEntry alloc] init];
((CHIPAccessControlClusterAccessControlEntry *) temp_0[0]).fabricIndex = [NSNumber numberWithUnsignedChar:0];
((CHIPAccessControlClusterAccessControlEntry *) temp_0[0]).privilege = [NSNumber numberWithUnsignedChar:5];
((CHIPAccessControlClusterAccessControlEntry *) temp_0[0]).authMode = [NSNumber numberWithUnsignedChar:2];
((CHIPAccessControlClusterAccessControlEntry *) temp_0[0]).subjects = nil;
((CHIPAccessControlClusterAccessControlEntry *) temp_0[0]).targets = nil;
aclArgument = temp_0;
}
[cluster writeAttributeAclWithValue:aclArgument
completionHandler:^(NSError * _Nullable err) {
NSLog(@"Write one entry Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTestAccessControlCluster_000006_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Read one entry"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestAccessControl * cluster = [[CHIPTestAccessControl alloc] initWithDevice:device endpoint:0 queue:queue];
XCTAssertNotNil(cluster);
CHIPReadParams * params = [[CHIPReadParams alloc] init];
params.fabricFiltered = [NSNumber numberWithBool:true];
[cluster
readAttributeAclWithParams:params
completionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) {
NSLog(@"Read one entry Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertEqual([actualValue count], 1);
XCTAssertEqual(
[((CHIPAccessControlClusterAccessControlEntry *) actualValue[0]).fabricIndex unsignedCharValue], 1);
XCTAssertEqual(
[((CHIPAccessControlClusterAccessControlEntry *) actualValue[0]).privilege unsignedCharValue], 5);
XCTAssertEqual(
[((CHIPAccessControlClusterAccessControlEntry *) actualValue[0]).authMode unsignedCharValue], 2);
XCTAssertTrue(((CHIPAccessControlClusterAccessControlEntry *) actualValue[0]).subjects == nil);
XCTAssertTrue(((CHIPAccessControlClusterAccessControlEntry *) actualValue[0]).targets == nil);
}
[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, 305414945);
[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_1_1_000005_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Read the global attribute: AttributeList"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestBinaryInputBasic * cluster = [[CHIPTestBinaryInputBasic alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeAttributeListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) {
NSLog(@"Read the global attribute: AttributeList Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
[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, 305414945);
[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;
if (actualValue != nil) {
XCTAssertGreaterThanOrEqual([actualValue unsignedCharValue], 0);
}
}
{
id actualValue = value;
if (actualValue != nil) {
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, 305414945);
[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, 305414945);
[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_1_1_000005_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Read the global attribute: AttributeList"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestBooleanState * cluster = [[CHIPTestBooleanState alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeAttributeListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) {
NSLog(@"Read the global attribute: AttributeList Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
[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, 305414945);
[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_BRAC_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, 305414945);
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_BRAC_1_1_000001_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Read the global attribute: ClusterRevision"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestBridgedActions * cluster = [[CHIPTestBridgedActions 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_BRAC_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();
CHIPTestBridgedActions * cluster = [[CHIPTestBridgedActions 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_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, 305414945);
[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_1_1_000003_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Read the global attribute: AttributeList"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeAttributeListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) {
NSLog(@"Read the global attribute: AttributeList Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
[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, 305414945);
[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;
if (actualValue != nil) {
XCTAssertGreaterThanOrEqual([actualValue unsignedCharValue], 0);
}
}
{
id actualValue = value;
if (actualValue != nil) {
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;
if (actualValue != nil) {
XCTAssertGreaterThanOrEqual([actualValue unsignedCharValue], 0);
}
}
{
id actualValue = value;
if (actualValue != nil) {
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;
if (actualValue != nil) {
XCTAssertGreaterThanOrEqual([actualValue unsignedShortValue], 0U);
}
}
{
id actualValue = value;
if (actualValue != nil) {
XCTAssertLessThanOrEqual([actualValue unsignedShortValue], 65279U);
}
}
[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;
if (actualValue != nil) {
XCTAssertGreaterThanOrEqual([actualValue unsignedShortValue], 0U);
}
}
{
id actualValue = value;
if (actualValue != nil) {
XCTAssertLessThanOrEqual([actualValue unsignedShortValue], 65279U);
}
}
[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;
if (actualValue != nil) {
XCTAssertGreaterThanOrEqual([actualValue unsignedShortValue], 0U);
}
}
{
id actualValue = value;
if (actualValue != nil) {
XCTAssertLessThanOrEqual([actualValue unsignedShortValue], 65279U);
}
}
[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;
if (actualValue != nil) {
XCTAssertGreaterThanOrEqual([actualValue unsignedCharValue], 0);
}
}
{
id actualValue = value;
if (actualValue != nil) {
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;
if (actualValue != nil) {
XCTAssertGreaterThanOrEqual([actualValue unsignedShortValue], 0U);
}
}
{
id actualValue = value;
if (actualValue != nil) {
XCTAssertLessThanOrEqual([actualValue unsignedShortValue], 65279U);
}
}
[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;
if (actualValue != nil) {
XCTAssertGreaterThanOrEqual([actualValue unsignedShortValue], 0U);
}
}
{
id actualValue = value;
if (actualValue != nil) {
XCTAssertLessThanOrEqual([actualValue unsignedShortValue], 65279U);
}
}
[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;
if (actualValue != nil) {
XCTAssertGreaterThanOrEqual([actualValue unsignedShortValue], 0U);
}
}
{
id actualValue = value;
if (actualValue != nil) {
XCTAssertLessThanOrEqual([actualValue unsignedShortValue], 65279U);
}
}
[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);
if (err.domain == MatterInteractionErrorDomain && err.code == MatterInteractionErrorCodeUnsupportedAttribute) {
[expectation fulfill];
return;
}
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);
if (err.domain == MatterInteractionErrorDomain
&& err.code == MatterInteractionErrorCodeUnsupportedAttribute) {
[expectation fulfill];
return;
}
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);
if (err.domain == MatterInteractionErrorDomain && err.code == MatterInteractionErrorCodeUnsupportedAttribute) {
[expectation fulfill];
return;
}
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);
if (err.domain == MatterInteractionErrorDomain && err.code == MatterInteractionErrorCodeUnsupportedAttribute) {
[expectation fulfill];
return;
}
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
if (actualValue != nil) {
XCTAssertGreaterThanOrEqual([actualValue unsignedShortValue], 0U);
}
}
{
id actualValue = value;
if (actualValue != nil) {
XCTAssertLessThanOrEqual([actualValue unsignedShortValue], 65279U);
}
}
[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);
if (err.domain == MatterInteractionErrorDomain
&& err.code == MatterInteractionErrorCodeUnsupportedAttribute) {
[expectation fulfill];
return;
}
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);
if (err.domain == MatterInteractionErrorDomain && err.code == MatterInteractionErrorCodeUnsupportedAttribute) {
[expectation fulfill];
return;
}
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);
if (err.domain == MatterInteractionErrorDomain && err.code == MatterInteractionErrorCodeUnsupportedAttribute) {
[expectation fulfill];
return;
}
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);
if (err.domain == MatterInteractionErrorDomain && err.code == MatterInteractionErrorCodeUnsupportedAttribute) {
[expectation fulfill];
return;
}
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
if (actualValue != nil) {
XCTAssertGreaterThanOrEqual([actualValue unsignedShortValue], 0U);
}
}
{
id actualValue = value;
if (actualValue != nil) {
XCTAssertLessThanOrEqual([actualValue unsignedShortValue], 254U);
}
}
[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);
if (err.domain == MatterInteractionErrorDomain
&& err.code == MatterInteractionErrorCodeUnsupportedAttribute) {
[expectation fulfill];
return;
}
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);
if (err.domain == MatterInteractionErrorDomain && err.code == MatterInteractionErrorCodeUnsupportedAttribute) {
[expectation fulfill];
return;
}
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);
if (err.domain == MatterInteractionErrorDomain && err.code == MatterInteractionErrorCodeUnsupportedAttribute) {
[expectation fulfill];
return;
}
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
if (actualValue != nil) {
XCTAssertGreaterThanOrEqual([actualValue unsignedCharValue], 0);
}
}
{
id actualValue = value;
if (actualValue != nil) {
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);
if (err.domain == MatterInteractionErrorDomain
&& err.code == MatterInteractionErrorCodeUnsupportedAttribute) {
[expectation fulfill];
return;
}
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);
if (err.domain == MatterInteractionErrorDomain && err.code == MatterInteractionErrorCodeUnsupportedAttribute) {
[expectation fulfill];
return;
}
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);
if (err.domain == MatterInteractionErrorDomain && err.code == MatterInteractionErrorCodeUnsupportedAttribute) {
[expectation fulfill];
return;
}
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_WriteAttribute
{
XCTestExpectation * expectation =
[self expectationWithDescription:@"Write the default values to 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);
id compensationTextArgument;
compensationTextArgument = @"";
[cluster
writeAttributeCompensationTextWithValue:compensationTextArgument
completionHandler:^(NSError * _Nullable err) {
NSLog(@"Write the default values to optional attribute: CompensationText Error: %@", err);
if (err.domain == MatterInteractionErrorDomain
&& err.code == MatterInteractionErrorCodeUnsupportedAttribute) {
[expectation fulfill];
return;
}
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], EMBER_ZCL_STATUS_UNSUPPORTED_WRITE);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_CC_2_1_000075_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Reads back 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(@"Reads back optional attribute: CompensationText Error: %@", err);
if (err.domain == MatterInteractionErrorDomain && err.code == MatterInteractionErrorCodeUnsupportedAttribute) {
[expectation fulfill];
return;
}
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertTrue([actualValue isEqualToString:@""]);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_CC_2_1_000076_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;
if (actualValue != nil) {
XCTAssertGreaterThanOrEqual([actualValue unsignedCharValue], 0);
}
}
{
id actualValue = value;
if (actualValue != nil) {
XCTAssertLessThanOrEqual([actualValue unsignedCharValue], 6);
}
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_CC_2_1_000077_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_000078_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_000079_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;
if (actualValue != nil) {
XCTAssertGreaterThanOrEqual([actualValue unsignedShortValue], 0U);
}
}
{
id actualValue = value;
if (actualValue != nil) {
XCTAssertLessThanOrEqual([actualValue unsignedShortValue], 65279U);
}
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_CC_2_1_000080_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_000081_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_000082_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;
if (actualValue != nil) {
XCTAssertGreaterThanOrEqual([actualValue unsignedShortValue], 0U);
}
}
{
id actualValue = value;
if (actualValue != nil) {
XCTAssertLessThanOrEqual([actualValue unsignedShortValue], 65279U);
}
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_CC_2_1_000083_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_000084_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_000085_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_000086_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;
if (actualValue != nil) {
XCTAssertGreaterThanOrEqual([actualValue unsignedShortValue], 0U);
}
}
{
id actualValue = value;
if (actualValue != nil) {
XCTAssertLessThanOrEqual([actualValue unsignedShortValue], 65279U);
}
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_CC_2_1_000087_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_000088_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_000089_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;
if (actualValue != nil) {
XCTAssertGreaterThanOrEqual([actualValue unsignedShortValue], 0U);
}
}
{
id actualValue = value;
if (actualValue != nil) {
XCTAssertLessThanOrEqual([actualValue unsignedShortValue], 65279U);
}
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_CC_2_1_000090_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_000091_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_000092_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_000093_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;
if (actualValue != nil) {
XCTAssertGreaterThanOrEqual([actualValue unsignedShortValue], 0U);
}
}
{
id actualValue = value;
if (actualValue != nil) {
XCTAssertLessThanOrEqual([actualValue unsignedShortValue], 65279U);
}
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_CC_2_1_000094_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_000095_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_000096_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;
if (actualValue != nil) {
XCTAssertGreaterThanOrEqual([actualValue unsignedShortValue], 0U);
}
}
{
id actualValue = value;
if (actualValue != nil) {
XCTAssertLessThanOrEqual([actualValue unsignedShortValue], 65279U);
}
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_CC_2_1_000097_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_000098_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_000099_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_000100_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;
if (actualValue != nil) {
XCTAssertGreaterThanOrEqual([actualValue unsignedShortValue], 0U);
}
}
{
id actualValue = value;
if (actualValue != nil) {
XCTAssertLessThanOrEqual([actualValue unsignedShortValue], 65279U);
}
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_CC_2_1_000101_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_000102_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_000103_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;
if (actualValue != nil) {
XCTAssertGreaterThanOrEqual([actualValue unsignedShortValue], 0U);
}
}
{
id actualValue = value;
if (actualValue != nil) {
XCTAssertLessThanOrEqual([actualValue unsignedShortValue], 65279U);
}
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_CC_2_1_000104_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_000105_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_000106_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_000107_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;
if (actualValue != nil) {
XCTAssertGreaterThanOrEqual([actualValue unsignedShortValue], 0U);
}
}
{
id actualValue = value;
if (actualValue != nil) {
XCTAssertLessThanOrEqual([actualValue unsignedShortValue], 65279U);
}
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_CC_2_1_000108_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_000109_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_000110_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;
if (actualValue != nil) {
XCTAssertGreaterThanOrEqual([actualValue unsignedShortValue], 0U);
}
}
{
id actualValue = value;
if (actualValue != nil) {
XCTAssertLessThanOrEqual([actualValue unsignedShortValue], 65279U);
}
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_CC_2_1_000111_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_000112_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_000113_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_000114_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;
if (actualValue != nil) {
XCTAssertGreaterThanOrEqual([actualValue unsignedShortValue], 0U);
}
}
{
id actualValue = value;
if (actualValue != nil) {
XCTAssertLessThanOrEqual([actualValue unsignedShortValue], 65279U);
}
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_CC_2_1_000115_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_000116_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_000117_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;
if (actualValue != nil) {
XCTAssertGreaterThanOrEqual([actualValue unsignedShortValue], 0U);
}
}
{
id actualValue = value;
if (actualValue != nil) {
XCTAssertLessThanOrEqual([actualValue unsignedShortValue], 65279U);
}
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_CC_2_1_000118_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_000119_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_000120_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_000121_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);
if (err.domain == MatterInteractionErrorDomain && err.code == MatterInteractionErrorCodeUnsupportedAttribute) {
[expectation fulfill];
return;
}
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
if (actualValue != nil) {
XCTAssertGreaterThanOrEqual([actualValue unsignedShortValue], 0U);
}
}
{
id actualValue = value;
if (actualValue != nil) {
XCTAssertLessThanOrEqual([actualValue unsignedShortValue], 65279U);
}
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_CC_2_1_000122_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);
if (err.domain == MatterInteractionErrorDomain
&& err.code == MatterInteractionErrorCodeUnsupportedAttribute) {
[expectation fulfill];
return;
}
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_CC_2_1_000123_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);
if (err.domain == MatterInteractionErrorDomain && err.code == MatterInteractionErrorCodeUnsupportedAttribute) {
[expectation fulfill];
return;
}
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_000124_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);
if (err.domain == MatterInteractionErrorDomain && err.code == MatterInteractionErrorCodeUnsupportedAttribute) {
[expectation fulfill];
return;
}
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
if (actualValue != nil) {
XCTAssertGreaterThanOrEqual([actualValue unsignedShortValue], 0U);
}
}
{
id actualValue = value;
if (actualValue != nil) {
XCTAssertLessThanOrEqual([actualValue unsignedShortValue], 65279U);
}
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_CC_2_1_000125_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);
if (err.domain == MatterInteractionErrorDomain
&& err.code == MatterInteractionErrorCodeUnsupportedAttribute) {
[expectation fulfill];
return;
}
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_CC_2_1_000126_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);
if (err.domain == MatterInteractionErrorDomain && err.code == MatterInteractionErrorCodeUnsupportedAttribute) {
[expectation fulfill];
return;
}
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_000127_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);
if (err.domain == MatterInteractionErrorDomain && err.code == MatterInteractionErrorCodeUnsupportedAttribute) {
[expectation fulfill];
return;
}
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
if (actualValue != nil) {
XCTAssertGreaterThanOrEqual([actualValue unsignedShortValue], 0U);
}
}
{
id actualValue = value;
if (actualValue != nil) {
XCTAssertLessThanOrEqual([actualValue unsignedShortValue], 65279U);
}
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_CC_2_1_000128_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);
if (err.domain == MatterInteractionErrorDomain
&& err.code == MatterInteractionErrorCodeUnsupportedAttribute) {
[expectation fulfill];
return;
}
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_CC_2_1_000129_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);
if (err.domain == MatterInteractionErrorDomain && err.code == MatterInteractionErrorCodeUnsupportedAttribute) {
[expectation fulfill];
return;
}
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_000130_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);
if (err.domain == MatterInteractionErrorDomain && err.code == MatterInteractionErrorCodeUnsupportedAttribute) {
[expectation fulfill];
return;
}
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
if (actualValue != nil) {
XCTAssertGreaterThanOrEqual([actualValue unsignedShortValue], 0U);
}
}
{
id actualValue = value;
if (actualValue != nil) {
XCTAssertLessThanOrEqual([actualValue unsignedShortValue], 65279U);
}
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_CC_2_1_000131_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);
if (err.domain == MatterInteractionErrorDomain
&& err.code == MatterInteractionErrorCodeUnsupportedAttribute) {
[expectation fulfill];
return;
}
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 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);
if (err.domain == MatterInteractionErrorDomain && err.code == MatterInteractionErrorCodeUnsupportedAttribute) {
[expectation fulfill];
return;
}
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_000133_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);
if (err.domain == MatterInteractionErrorDomain && err.code == MatterInteractionErrorCodeUnsupportedAttribute) {
[expectation fulfill];
return;
}
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_CC_2_1_000134_WriteAttribute
{
XCTestExpectation * expectation =
[self expectationWithDescription:@"Write the default 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);
id colorPointRIntensityArgument;
colorPointRIntensityArgument = [NSNumber numberWithUnsignedChar:0];
[cluster writeAttributeColorPointRIntensityWithValue:colorPointRIntensityArgument
completionHandler:^(NSError * _Nullable err) {
NSLog(@"Write the default optional attribute: ColorPointRIntensity Error: %@", err);
if (err.domain == MatterInteractionErrorDomain
&& err.code == MatterInteractionErrorCodeUnsupportedAttribute) {
[expectation fulfill];
return;
}
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_CC_2_1_000135_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Read back 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 back the optional attribute: ColorPointRIntensity Error: %@", err);
if (err.domain == MatterInteractionErrorDomain && err.code == MatterInteractionErrorCodeUnsupportedAttribute) {
[expectation fulfill];
return;
}
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_000136_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);
if (err.domain == MatterInteractionErrorDomain && err.code == MatterInteractionErrorCodeUnsupportedAttribute) {
[expectation fulfill];
return;
}
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
if (actualValue != nil) {
XCTAssertGreaterThanOrEqual([actualValue unsignedShortValue], 0U);
}
}
{
id actualValue = value;
if (actualValue != nil) {
XCTAssertLessThanOrEqual([actualValue unsignedShortValue], 65279U);
}
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_CC_2_1_000137_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);
if (err.domain == MatterInteractionErrorDomain
&& err.code == MatterInteractionErrorCodeUnsupportedAttribute) {
[expectation fulfill];
return;
}
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_CC_2_1_000138_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);
if (err.domain == MatterInteractionErrorDomain && err.code == MatterInteractionErrorCodeUnsupportedAttribute) {
[expectation fulfill];
return;
}
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_000139_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);
if (err.domain == MatterInteractionErrorDomain && err.code == MatterInteractionErrorCodeUnsupportedAttribute) {
[expectation fulfill];
return;
}
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
if (actualValue != nil) {
XCTAssertGreaterThanOrEqual([actualValue unsignedShortValue], 0U);
}
}
{
id actualValue = value;
if (actualValue != nil) {
XCTAssertLessThanOrEqual([actualValue unsignedShortValue], 65279U);
}
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_CC_2_1_000140_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);
if (err.domain == MatterInteractionErrorDomain
&& err.code == MatterInteractionErrorCodeUnsupportedAttribute) {
[expectation fulfill];
return;
}
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: 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);
if (err.domain == MatterInteractionErrorDomain && err.code == MatterInteractionErrorCodeUnsupportedAttribute) {
[expectation fulfill];
return;
}
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: 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);
if (err.domain == MatterInteractionErrorDomain && err.code == MatterInteractionErrorCodeUnsupportedAttribute) {
[expectation fulfill];
return;
}
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_CC_2_1_000143_WriteAttribute
{
XCTestExpectation * expectation =
[self expectationWithDescription:@"Write the default 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);
id colorPointGIntensityArgument;
colorPointGIntensityArgument = [NSNumber numberWithUnsignedChar:0];
[cluster writeAttributeColorPointGIntensityWithValue:colorPointGIntensityArgument
completionHandler:^(NSError * _Nullable err) {
NSLog(@"Write the default optional attribute: ColorPointGIntensity Error: %@", err);
if (err.domain == MatterInteractionErrorDomain
&& err.code == MatterInteractionErrorCodeUnsupportedAttribute) {
[expectation fulfill];
return;
}
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: 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 back the optional attribute: ColorPointGIntensity Error: %@", err);
if (err.domain == MatterInteractionErrorDomain && err.code == MatterInteractionErrorCodeUnsupportedAttribute) {
[expectation fulfill];
return;
}
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_000145_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);
if (err.domain == MatterInteractionErrorDomain && err.code == MatterInteractionErrorCodeUnsupportedAttribute) {
[expectation fulfill];
return;
}
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
if (actualValue != nil) {
XCTAssertGreaterThanOrEqual([actualValue unsignedShortValue], 0U);
}
}
{
id actualValue = value;
if (actualValue != nil) {
XCTAssertLessThanOrEqual([actualValue unsignedShortValue], 65279U);
}
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_CC_2_1_000146_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);
if (err.domain == MatterInteractionErrorDomain
&& err.code == MatterInteractionErrorCodeUnsupportedAttribute) {
[expectation fulfill];
return;
}
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_CC_2_1_000147_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);
if (err.domain == MatterInteractionErrorDomain && err.code == MatterInteractionErrorCodeUnsupportedAttribute) {
[expectation fulfill];
return;
}
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_000148_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);
if (err.domain == MatterInteractionErrorDomain && err.code == MatterInteractionErrorCodeUnsupportedAttribute) {
[expectation fulfill];
return;
}
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
if (actualValue != nil) {
XCTAssertGreaterThanOrEqual([actualValue unsignedShortValue], 0U);
}
}
{
id actualValue = value;
if (actualValue != nil) {
XCTAssertLessThanOrEqual([actualValue unsignedShortValue], 65279U);
}
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_CC_2_1_000149_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);
if (err.domain == MatterInteractionErrorDomain
&& err.code == MatterInteractionErrorCodeUnsupportedAttribute) {
[expectation fulfill];
return;
}
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_CC_2_1_000150_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);
if (err.domain == MatterInteractionErrorDomain && err.code == MatterInteractionErrorCodeUnsupportedAttribute) {
[expectation fulfill];
return;
}
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_000151_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);
if (err.domain == MatterInteractionErrorDomain && err.code == MatterInteractionErrorCodeUnsupportedAttribute) {
[expectation fulfill];
return;
}
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_CC_2_1_000152_WriteAttribute
{
XCTestExpectation * expectation =
[self expectationWithDescription:@"Write the default 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);
id colorPointBIntensityArgument;
colorPointBIntensityArgument = [NSNumber numberWithUnsignedChar:0];
[cluster writeAttributeColorPointBIntensityWithValue:colorPointBIntensityArgument
completionHandler:^(NSError * _Nullable err) {
NSLog(@"Write the default optional attribute: ColorPointBIntensity Error: %@", err);
if (err.domain == MatterInteractionErrorDomain
&& err.code == MatterInteractionErrorCodeUnsupportedAttribute) {
[expectation fulfill];
return;
}
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_CC_2_1_000153_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Read back 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 back the optional attribute: ColorPointBIntensity Error: %@", err);
if (err.domain == MatterInteractionErrorDomain && err.code == MatterInteractionErrorCodeUnsupportedAttribute) {
[expectation fulfill];
return;
}
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertEqual([actualValue unsignedCharValue], 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, 305414945);
[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_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Reads CurrentHue 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 readAttributeCurrentHueWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"Reads CurrentHue attribute from DUT. Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
if (actualValue != nil) {
XCTAssertGreaterThanOrEqual([actualValue unsignedCharValue], 0);
}
}
{
id actualValue = value;
if (actualValue != nil) {
XCTAssertLessThanOrEqual([actualValue unsignedCharValue], 254);
}
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_CC_3_1_000004_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:300U];
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_000005_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:300U];
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_000006_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:300U];
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_000007_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:300U];
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_000008_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_000009_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, 305414945);
[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, 305414945);
[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, 305414945);
[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, 305414945);
[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, 305414945);
[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, 305414945);
[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, 305414945);
[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, 305414945);
[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, 305414945);
[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, 305414945);
[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, 305414945);
[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_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Read current color temprature"];
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(@"Read current color temprature Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
if (actualValue != nil) {
XCTAssertGreaterThanOrEqual([actualValue unsignedShortValue], 0U);
}
}
{
id actualValue = value;
if (actualValue != nil) {
XCTAssertLessThanOrEqual([actualValue unsignedShortValue], 65279U);
}
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_CC_6_2_000004_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_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_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_000007_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_000008_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_000009_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_000010_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_000011_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, 305414945);
[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, 305414945);
[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_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:1100U];
params.direction = [NSNumber numberWithUnsignedChar:0];
params.transitionTime = [NSNumber numberWithUnsignedShort:300U];
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_000005_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:1150U];
params.direction = [NSNumber numberWithUnsignedChar:1];
params.transitionTime = [NSNumber numberWithUnsignedShort:300U];
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_000006_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:1200U];
params.direction = [NSNumber numberWithUnsignedChar:2];
params.transitionTime = [NSNumber numberWithUnsignedShort:300U];
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_000007_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:1300U];
params.direction = [NSNumber numberWithUnsignedChar:3];
params.transitionTime = [NSNumber numberWithUnsignedShort:300U];
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_000008_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_000009_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, 305414945);
[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_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Check 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(@"Check EnhancedCurrentHue attribute from DUT Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
if (actualValue != nil) {
XCTAssertGreaterThanOrEqual([actualValue unsignedShortValue], 0U);
}
}
{
id actualValue = value;
if (actualValue != nil) {
XCTAssertLessThanOrEqual([actualValue unsignedShortValue], 65535U);
}
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_CC_7_2_000004_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_000005_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_000006_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_000007_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_000008_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_000009_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, 305414945);
[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, 305414945);
[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, 305414945);
[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 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: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 Attributes 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, 305414945);
[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];
}
NSNumber * _Nonnull EnhancedCurrentHueValue1;
- (void)testSendClusterTest_TC_CC_9_1_000013_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;
EnhancedCurrentHueValue1 = actualValue;
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_CC_9_1_000014_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Read ColorLoopStoredEnhancedHue 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 readAttributeColorLoopStoredEnhancedHueWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"Read ColorLoopStoredEnhancedHue attribute from DUT. Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertEqualObjects(actualValue, EnhancedCurrentHueValue1);
}
[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: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_000016_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];
}
NSNumber * _Nonnull ColorLoopStoredEnhancedHueValue1;
- (void)testSendClusterTest_TC_CC_9_1_000017_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Read ColorLoopStoredEnhancedHue 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 readAttributeColorLoopStoredEnhancedHueWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"Read ColorLoopStoredEnhancedHue attribute from DUT. Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
ColorLoopStoredEnhancedHueValue1 = actualValue;
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_CC_9_1_000018_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;
XCTAssertEqualObjects(actualValue, ColorLoopStoredEnhancedHueValue1);
}
[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: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_000020_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_000021_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_000022_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];
}
NSNumber * _Nonnull EnhancedCurrentHueValue2;
- (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;
EnhancedCurrentHueValue2 = actualValue;
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_CC_9_1_000024_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Read ColorLoopStoredEnhancedHue 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 readAttributeColorLoopStoredEnhancedHueWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"Read ColorLoopStoredEnhancedHue attribute from DUT Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertEqualObjects(actualValue, EnhancedCurrentHueValue2);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_CC_9_1_000025_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_000026_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];
}
NSNumber * _Nonnull ColorLoopStoredEnhancedHueValue2;
- (void)testSendClusterTest_TC_CC_9_1_000027_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Read ColorLoopStoredEnhancedHue 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 readAttributeColorLoopStoredEnhancedHueWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"Read ColorLoopStoredEnhancedHue attribute from DUT. Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
ColorLoopStoredEnhancedHueValue2 = actualValue;
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_CC_9_1_000028_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;
XCTAssertEqualObjects(actualValue, ColorLoopStoredEnhancedHueValue2);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_CC_9_1_000029_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: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 Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_CC_9_1_000030_WaitForMs
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Wait 2000ms"];
dispatch_queue_t queue = dispatch_get_main_queue();
WaitForMs(expectation, queue, 2000);
[self waitForExpectationsWithTimeout:(2000 / 1000) + kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_CC_9_1_000031_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_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: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_000033_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_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: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_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], 1);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
NSNumber * _Nonnull EnhancedCurrentHueValue3;
- (void)testSendClusterTest_TC_CC_9_1_000036_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;
EnhancedCurrentHueValue3 = actualValue;
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_CC_9_1_000037_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Read ColorLoopStoredEnhancedHue 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 readAttributeColorLoopStoredEnhancedHueWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"Read ColorLoopStoredEnhancedHue attribute from DUT Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertEqualObjects(actualValue, EnhancedCurrentHueValue3);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_CC_9_1_000038_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_000039_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];
}
NSNumber * _Nonnull ColorLoopStoredEnhancedHueValue3;
- (void)testSendClusterTest_TC_CC_9_1_000040_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Read ColorLoopStoredEnhancedHue 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 readAttributeColorLoopStoredEnhancedHueWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"Read ColorLoopStoredEnhancedHue attribute from DUT. Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
ColorLoopStoredEnhancedHueValue3 = actualValue;
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_CC_9_1_000041_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;
XCTAssertEqualObjects(actualValue, ColorLoopStoredEnhancedHueValue3);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_CC_9_1_000042_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_000043_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_000044_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_000045_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];
}
NSNumber * _Nonnull EnhancedCurrentHueValue4;
- (void)testSendClusterTest_TC_CC_9_1_000046_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;
EnhancedCurrentHueValue4 = actualValue;
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_CC_9_1_000047_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Read ColorLoopStoredEnhancedHue 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 readAttributeColorLoopStoredEnhancedHueWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"Read ColorLoopStoredEnhancedHue attribute from DUT Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertEqualObjects(actualValue, EnhancedCurrentHueValue4);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_CC_9_1_000048_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_000049_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];
}
NSNumber * _Nonnull ColorLoopStoredEnhancedHue4;
- (void)testSendClusterTest_TC_CC_9_1_000050_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Read ColorLoopStoredEnhancedHue 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 readAttributeColorLoopStoredEnhancedHueWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"Read ColorLoopStoredEnhancedHue attribute from DUT. Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
ColorLoopStoredEnhancedHue4 = actualValue;
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_CC_9_1_000051_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;
XCTAssertEqualObjects(actualValue, ColorLoopStoredEnhancedHue4);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_CC_9_1_000052_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_1_000053_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_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, 305414945);
[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];
}
NSNumber * _Nonnull EnhancedCurrentHueValue;
- (void)testSendClusterTest_TC_CC_9_2_000010_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;
EnhancedCurrentHueValue = actualValue;
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_CC_9_2_000011_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Read ColorLoopStoredEnhancedHue 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 readAttributeColorLoopStoredEnhancedHueWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"Read ColorLoopStoredEnhancedHue attribute from DUT. Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertEqualObjects(actualValue, EnhancedCurrentHueValue);
}
[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: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_000013_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_000014_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_000015_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];
}
NSNumber * _Nonnull ColorLoopStoredEnhancedHueValue;
- (void)testSendClusterTest_TC_CC_9_2_000016_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Read ColorLoopStoredEnhancedHue 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 readAttributeColorLoopStoredEnhancedHueWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"Read ColorLoopStoredEnhancedHue attribute from DUT. Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
ColorLoopStoredEnhancedHueValue = actualValue;
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_CC_9_2_000017_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;
XCTAssertEqualObjects(actualValue, ColorLoopStoredEnhancedHueValue);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_CC_9_2_000018_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_000019_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_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, 305414945);
[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];
}
NSNumber * _Nonnull EnhancedCurrentHueValue;
- (void)testSendClusterTest_TC_CC_9_3_000010_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;
EnhancedCurrentHueValue = actualValue;
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_CC_9_3_000011_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Read ColorLoopStoredEnhancedHue 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 readAttributeColorLoopStoredEnhancedHueWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"Read ColorLoopStoredEnhancedHue attribute from DUT. Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertEqualObjects(actualValue, EnhancedCurrentHueValue);
}
[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: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_000013_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_000014_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_000015_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];
}
NSNumber * _Nonnull ColorLoopStoredEnhancedHueValue;
- (void)testSendClusterTest_TC_CC_9_3_000016_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Read ColorLoopStoredEnhancedHue 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 readAttributeColorLoopStoredEnhancedHueWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"Read ColorLoopStoredEnhancedHue attribute from DUT. Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
ColorLoopStoredEnhancedHueValue = actualValue;
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_CC_9_3_000017_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;
XCTAssertEqualObjects(actualValue, ColorLoopStoredEnhancedHueValue);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_CC_9_3_000018_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_000019_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_DD_1_5_000000_Log
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Step 1"];
dispatch_queue_t queue = dispatch_get_main_queue();
Log(expectation, queue,
@"Verify that the onboarding payload for NFC tags SHALL use NDEF URI Record Type Definition as defined by NFC Forum in URI "
@"Record Type Definition RTD URI");
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_DD_1_6_000000_Log
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Step 1"];
dispatch_queue_t queue = dispatch_get_main_queue();
Log(expectation, queue, @"Scan the DUTs QR code using a QR code reader");
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_DD_1_6_000001_Log
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Step 1 verification"];
dispatch_queue_t queue = dispatch_get_main_queue();
Log(expectation, queue,
@"Verify the QR code gets scanned successfully and the QR code must be of sufficient size and contrast respective to "
@"surface material as to be readable with standard readers such as smartphones in normal lighting conditions");
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_DD_1_6_000002_Log
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Step 2 verificaiton"];
dispatch_queue_t queue = dispatch_get_main_queue();
Log(expectation, queue, @"Verify QR code version is 1 or higher");
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_DD_1_7_000000_Log
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Precondition"];
dispatch_queue_t queue = dispatch_get_main_queue();
Log(expectation, queue, @"Verify manual pairing code is printed on the device or in additional provided materials");
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_DD_1_7_000001_Log
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Step 1"];
dispatch_queue_t queue = dispatch_get_main_queue();
Log(expectation, queue,
@"Verify that the Manual Pairing Code should be printed using a minimum font size of 6 points typically producing a "
@"typeface height of 2.1 mm");
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_DD_1_8_000000_Log
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Step 1"];
dispatch_queue_t queue = dispatch_get_main_queue();
Log(expectation, queue, @"Scan the device QR code using DUT");
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_DD_1_8_000001_Log
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Step 1 verification"];
dispatch_queue_t queue = dispatch_get_main_queue();
Log(expectation, queue,
@"Verify the DUT is able to scan and parse the QR code successfully to onboard the device onto the CHIP network");
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_DD_1_9_000000_Log
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Precondition"];
dispatch_queue_t queue = dispatch_get_main_queue();
Log(expectation, queue, @"Verify that the manual pairing code is printed on the device or in additional provided materials");
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_DD_1_9_000001_Log
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Step 1"];
dispatch_queue_t queue = dispatch_get_main_queue();
Log(expectation, queue,
@"Provide the 11 digit or 21 digit pairing code from the Device in text speech or any format supported by DUT");
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_DD_1_9_000002_Log
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Step 1 verification"];
dispatch_queue_t queue = dispatch_get_main_queue();
Log(expectation, queue,
@"Verify that the manual pairing code can be provided to DUT and parsed to onboard the device onto the CHIP network");
[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, 305414945);
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_DM_1_1_000001_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Query Data Model Revision"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestBasic * cluster = [[CHIPTestBasic alloc] initWithDevice:device endpoint:0 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeDataModelRevisionWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"Query Data Model Revision 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.domain == MatterInteractionErrorDomain && err.code == MatterInteractionErrorCodeUnsupportedAttribute) {
[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.domain == MatterInteractionErrorDomain && err.code == MatterInteractionErrorCodeUnsupportedAttribute) {
[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.domain == MatterInteractionErrorDomain && err.code == MatterInteractionErrorCodeUnsupportedAttribute) {
[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.domain == MatterInteractionErrorDomain && err.code == MatterInteractionErrorCodeUnsupportedAttribute) {
[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.domain == MatterInteractionErrorDomain && err.code == MatterInteractionErrorCodeUnsupportedAttribute) {
[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.domain == MatterInteractionErrorDomain && err.code == MatterInteractionErrorCodeUnsupportedAttribute) {
[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.domain == MatterInteractionErrorDomain && err.code == MatterInteractionErrorCodeUnsupportedAttribute) {
[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.domain == MatterInteractionErrorDomain && err.code == MatterInteractionErrorCodeUnsupportedAttribute) {
[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, 305414945);
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_DM_3_1_000001_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Query MaxNetworks"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestNetworkCommissioning * cluster = [[CHIPTestNetworkCommissioning alloc] initWithDevice:device endpoint:0 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeMaxNetworksWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"Query MaxNetworks Error: %@", err);
if (err.domain == MatterInteractionErrorDomain && err.code == MatterInteractionErrorCodeUnsupportedAttribute) {
[expectation fulfill];
return;
}
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_DM_3_1_000002_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Query Networks"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestNetworkCommissioning * cluster = [[CHIPTestNetworkCommissioning alloc] initWithDevice:device endpoint:0 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeNetworksWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) {
NSLog(@"Query Networks Error: %@", err);
if (err.domain == MatterInteractionErrorDomain && err.code == MatterInteractionErrorCodeUnsupportedAttribute) {
[expectation fulfill];
return;
}
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
[expectation fulfill];
}];
[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, 305414945);
[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_EMR_1_1_000005_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Read the global attribute: AttributeList"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestElectricalMeasurement * cluster = [[CHIPTestElectricalMeasurement alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeAttributeListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) {
NSLog(@"Read the global attribute: AttributeList Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_ETHDIAG_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, 305414945);
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_ETHDIAG_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, 305414945);
[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, 305414945);
[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_1_1_000003_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Read the global attribute: AttributeList"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestFlowMeasurement * cluster = [[CHIPTestFlowMeasurement alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeAttributeListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) {
NSLog(@"Read the global attribute: AttributeList Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
[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, 305414945);
[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: MeasuredValue"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestFlowMeasurement * cluster = [[CHIPTestFlowMeasurement alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
id measuredValueArgument;
measuredValueArgument = [NSNumber numberWithUnsignedShort:0U];
[cluster
writeAttributeMeasuredValueWithValue:measuredValueArgument
completionHandler:^(NSError * _Nullable err) {
NSLog(@"write the default value to optional attribute: MeasuredValue 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: 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 numberWithUnsignedShort:0U];
[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_000006_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 numberWithUnsignedShort:0U];
[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_000007_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_000008_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_000009_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_000010_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"read the optional attribute: Tolerance"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestFlowMeasurement * cluster = [[CHIPTestFlowMeasurement alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeToleranceWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"read the optional attribute: Tolerance Error: %@", err);
if (err.domain == MatterInteractionErrorDomain && err.code == MatterInteractionErrorCodeUnsupportedAttribute) {
[expectation fulfill];
return;
}
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertEqual([actualValue unsignedShortValue], 0U);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_FLW_2_1_000011_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"read the optional attribute: Tolerance"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestFlowMeasurement * cluster = [[CHIPTestFlowMeasurement alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeToleranceWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"read the optional attribute: Tolerance Error: %@", err);
if (err.domain == MatterInteractionErrorDomain && err.code == MatterInteractionErrorCodeUnsupportedAttribute) {
[expectation fulfill];
return;
}
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
if (actualValue != nil) {
XCTAssertGreaterThanOrEqual([actualValue unsignedShortValue], 0U);
}
}
{
id actualValue = value;
if (actualValue != nil) {
XCTAssertLessThanOrEqual([actualValue unsignedShortValue], 2048U);
}
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_FLW_2_1_000012_WriteAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"write the default value to optional attribute: Tolerance"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestFlowMeasurement * cluster = [[CHIPTestFlowMeasurement alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
id toleranceArgument;
toleranceArgument = [NSNumber numberWithUnsignedShort:0U];
[cluster writeAttributeToleranceWithValue:toleranceArgument
completionHandler:^(NSError * _Nullable err) {
NSLog(@"write the default value to optional attribute: Tolerance Error: %@", err);
if (err.domain == MatterInteractionErrorDomain
&& err.code == MatterInteractionErrorCodeUnsupportedAttribute) {
[expectation fulfill];
return;
}
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], EMBER_ZCL_STATUS_UNSUPPORTED_WRITE);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_FLW_2_1_000013_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"read the optional attribute: Tolerance"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestFlowMeasurement * cluster = [[CHIPTestFlowMeasurement alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeToleranceWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"read the optional attribute: Tolerance Error: %@", err);
if (err.domain == MatterInteractionErrorDomain && err.code == MatterInteractionErrorCodeUnsupportedAttribute) {
[expectation fulfill];
return;
}
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertEqual([actualValue unsignedShortValue], 0U);
}
[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, 305414945);
[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, 305414945);
[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_ILL_1_1_000005_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Read the global attribute: AttributeList"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestIlluminanceMeasurement * cluster = [[CHIPTestIlluminanceMeasurement alloc] initWithDevice:device
endpoint:1
queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeAttributeListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) {
NSLog(@"Read the global attribute: AttributeList Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
[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, 305414945);
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_LVL_1_1_000001_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"read the global attribute: ClusterRevision"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestLevelControl * cluster = [[CHIPTestLevelControl alloc] initWithDevice:device endpoint:1 queue:queue];
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], 5U);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_LVL_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();
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_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();
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_1_1_000004_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"reads back 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);
[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], 5U);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_LVL_1_1_000005_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Read the global attribute: AttributeList"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestLevelControl * cluster = [[CHIPTestLevelControl alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeAttributeListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) {
NSLog(@"Read the global attribute: AttributeList Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_LVL_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();
CHIPTestLevelControl * cluster = [[CHIPTestLevelControl 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_LVL_1_1_000007_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();
CHIPTestLevelControl * cluster = [[CHIPTestLevelControl 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_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, 305414945);
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_LVL_2_1_000001_MoveToLevel
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Reset level to 254"];
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:0U];
params.optionMask = [NSNumber numberWithUnsignedChar:1];
params.optionOverride = [NSNumber numberWithUnsignedChar:1];
[cluster moveToLevelWithParams:params
completionHandler:^(NSError * _Nullable err) {
NSLog(@"Reset level to 254 Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_LVL_2_1_000002_WaitForMs
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Wait 100ms"];
dispatch_queue_t queue = dispatch_get_main_queue();
WaitForMs(expectation, queue, 100);
[self waitForExpectationsWithTimeout:(100 / 1000) + kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_LVL_2_1_000003_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Reads the CurrentLevel attribute"];
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 the CurrentLevel attribute 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_000004_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Reads the RemainingTime attribute"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestLevelControl * cluster = [[CHIPTestLevelControl alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeRemainingTimeWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"Reads the RemainingTime attribute 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_000005_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Reads the MinLevel attribute"];
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 the MinLevel attribute 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_000006_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Reads the MaxLevel attribute"];
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 the MaxLevel attribute Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_LVL_2_1_000007_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Reads the CurrentFrequency attribute"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestLevelControl * cluster = [[CHIPTestLevelControl alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeCurrentFrequencyWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"Reads the CurrentFrequency attribute 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_000008_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Reads the MinFrequency attribute"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestLevelControl * cluster = [[CHIPTestLevelControl alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeMinFrequencyWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"Reads the MinFrequency attribute 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_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Reads the MaxFrequency attribute"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestLevelControl * cluster = [[CHIPTestLevelControl alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeMaxFrequencyWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"Reads the MaxFrequency attribute 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_000010_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Reads the OnOffTransitionTime attribute"];
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 the OnOffTransitionTime attribute 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_000011_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Reads the OnLevel attribute "];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestLevelControl * cluster = [[CHIPTestLevelControl alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeOnLevelWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"Reads the OnLevel attribute Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_LVL_2_1_000012_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Reads the OnTransitionTime attribute "];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestLevelControl * cluster = [[CHIPTestLevelControl alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeOnTransitionTimeWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"Reads the OnTransitionTime attribute Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_LVL_2_1_000013_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Reads the OffTransitionTime attribute "];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestLevelControl * cluster = [[CHIPTestLevelControl alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeOffTransitionTimeWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"Reads the OffTransitionTime attribute Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_LVL_2_1_000014_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Reads the DefaultMoveRate attribute "];
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 the DefaultMoveRate attribute Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_LVL_2_1_000015_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Reads the Options attribute "];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestLevelControl * cluster = [[CHIPTestLevelControl alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeOptionsWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"Reads the Options attribute 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_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, 305414945);
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_LVL_2_2_000001_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Reads the OnOffTransitionTime attribute from the 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 the OnOffTransitionTime attribute from the 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_2_000002_WriteAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"writes the OnOffTransitionTime attribute on the 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 onOffTransitionTimeArgument;
onOffTransitionTimeArgument = [NSNumber numberWithUnsignedShort:10U];
[cluster writeAttributeOnOffTransitionTimeWithValue:onOffTransitionTimeArgument
completionHandler:^(NSError * _Nullable err) {
NSLog(@"writes the OnOffTransitionTime attribute on the DUT Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_LVL_2_2_000003_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Reads the OnOffTransitionTime attribute from the 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 the OnOffTransitionTime attribute from the DUT Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertEqual([actualValue unsignedShortValue], 10U);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_LVL_2_2_000004_WriteAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"writes default value of OnOffTransitionTime attribute"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestLevelControl * cluster = [[CHIPTestLevelControl alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
id onOffTransitionTimeArgument;
onOffTransitionTimeArgument = [NSNumber numberWithUnsignedShort:0U];
[cluster writeAttributeOnOffTransitionTimeWithValue:onOffTransitionTimeArgument
completionHandler:^(NSError * _Nullable err) {
NSLog(@"writes default value of OnOffTransitionTime attribute Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_LVL_2_2_000005_WriteAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"writes the OnLevel attribute on the 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 onLevelArgument;
onLevelArgument = [NSNumber numberWithUnsignedChar:254];
[cluster writeAttributeOnLevelWithValue:onLevelArgument
completionHandler:^(NSError * _Nullable err) {
NSLog(@"writes the OnLevel attribute on the DUT Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_LVL_2_2_000006_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Reads the OnLevel attribute from the 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 readAttributeOnLevelWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"Reads the OnLevel attribute from the DUT 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)testSendClusterTest_TC_LVL_2_2_000007_WriteAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Writes the OnTransitionTime attribute on the 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 onTransitionTimeArgument;
onTransitionTimeArgument = [NSNumber numberWithUnsignedShort:100U];
[cluster writeAttributeOnTransitionTimeWithValue:onTransitionTimeArgument
completionHandler:^(NSError * _Nullable err) {
NSLog(@"Writes the OnTransitionTime attribute on the DUT Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_LVL_2_2_000008_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Reads the OnTransitionTime attribute from the 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 readAttributeOnTransitionTimeWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"Reads the OnTransitionTime attribute from the DUT Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertFalse(actualValue == nil);
XCTAssertEqual([actualValue unsignedShortValue], 100U);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_LVL_2_2_000009_WriteAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Writes the OffTransitionTime attribute on the 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 offTransitionTimeArgument;
offTransitionTimeArgument = [NSNumber numberWithUnsignedShort:100U];
[cluster writeAttributeOffTransitionTimeWithValue:offTransitionTimeArgument
completionHandler:^(NSError * _Nullable err) {
NSLog(@"Writes the OffTransitionTime attribute on the DUT Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_LVL_2_2_000010_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Reads the OffTransitionTime attribute from the 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 readAttributeOffTransitionTimeWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"Reads the OffTransitionTime attribute from the DUT Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertFalse(actualValue == nil);
XCTAssertEqual([actualValue unsignedShortValue], 100U);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_LVL_2_2_000011_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Reads the DefaultMoveRate attribute from the 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 the DefaultMoveRate attribute from the DUT Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertFalse(actualValue == nil);
XCTAssertEqual([actualValue unsignedCharValue], 0);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_LVL_2_2_000012_WriteAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Writes the DefaultMoveRate attribute on the 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:100];
[cluster writeAttributeDefaultMoveRateWithValue:defaultMoveRateArgument
completionHandler:^(NSError * _Nullable err) {
NSLog(@"Writes the DefaultMoveRate attribute on the DUT Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_LVL_2_2_000013_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Reads the DefaultMoveRate attribute from the 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 the DefaultMoveRate attribute from the DUT Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertFalse(actualValue == nil);
XCTAssertEqual([actualValue unsignedCharValue], 100);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_LVL_2_2_000014_WriteAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"writes the StartUpCurrentLevel attribute on the 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 startUpCurrentLevelArgument;
startUpCurrentLevelArgument = [NSNumber numberWithUnsignedChar:254];
[cluster writeAttributeStartUpCurrentLevelWithValue:startUpCurrentLevelArgument
completionHandler:^(NSError * _Nullable err) {
NSLog(@"writes the StartUpCurrentLevel attribute on the DUT Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_LVL_2_2_000015_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"reads the StartUpCurrentLevel attribute from the 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 readAttributeStartUpCurrentLevelWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"reads the StartUpCurrentLevel attribute from the DUT 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)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, 305414945);
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_LVL_3_1_000001_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"reads CurrentLevel 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 CurrentLevel 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_3_1_000002_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Reads the MinLevel attribute"];
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 the MinLevel attribute 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_000003_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Reads the MaxLevel attribute"];
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 the MaxLevel attribute 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_3_1_000004_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_3_1_000005_WaitForMs
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Wait 100ms"];
dispatch_queue_t queue = dispatch_get_main_queue();
WaitForMs(expectation, queue, 100);
[self waitForExpectationsWithTimeout:(100 / 1000) + kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_LVL_3_1_000006_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"reads CurrentLevel 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 CurrentLevel 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_3_1_000007_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_3_1_000008_WaitForMs
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Wait a second"];
dispatch_queue_t queue = dispatch_get_main_queue();
WaitForMs(expectation, queue, 1000);
[self waitForExpectationsWithTimeout:(1000 / 1000) + kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_LVL_3_1_000009_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"reads CurrentLevel 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 CurrentLevel 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_3_1_000010_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_3_1_000011_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_3_1_000012_WaitForMs
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Wait 10ms"];
dispatch_queue_t queue = dispatch_get_main_queue();
WaitForMs(expectation, queue, 100);
[self waitForExpectationsWithTimeout:(100 / 1000) + kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_LVL_3_1_000013_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"reads CurrentLevel 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 CurrentLevel 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_3_1_000014_MoveToLevel
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Reset level to 254"];
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:0U];
params.optionMask = [NSNumber numberWithUnsignedChar:1];
params.optionOverride = [NSNumber numberWithUnsignedChar:1];
[cluster moveToLevelWithParams:params
completionHandler:^(NSError * _Nullable err) {
NSLog(@"Reset level to 254 Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_LVL_3_1_000015_WaitForMs
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Wait 100ms"];
dispatch_queue_t queue = dispatch_get_main_queue();
WaitForMs(expectation, queue, 100);
[self waitForExpectationsWithTimeout:(100 / 1000) + 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, 305414945);
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_LVL_4_1_000001_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"reads CurrentLevel 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 CurrentLevel 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_4_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], 254);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_LVL_4_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_4_1_000004_WaitForMs
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Wait 3000ms"];
dispatch_queue_t queue = dispatch_get_main_queue();
WaitForMs(expectation, queue, 3000);
[self waitForExpectationsWithTimeout:(3000 / 1000) + kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_LVL_4_1_000005_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"reads CurrentLevel 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 CurrentLevel 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_4_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_4_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_4_1_000008_WaitForMs
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Wait 3000ms"];
dispatch_queue_t queue = dispatch_get_main_queue();
WaitForMs(expectation, queue, 3000);
[self waitForExpectationsWithTimeout:(3000 / 1000) + kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_LVL_4_1_000009_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"reads CurrentLevel 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 CurrentLevel attribute from DUT Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
if (actualValue != nil) {
XCTAssertGreaterThanOrEqual([actualValue unsignedCharValue], 0);
}
}
{
id actualValue = value;
if (actualValue != nil) {
XCTAssertLessThanOrEqual([actualValue unsignedCharValue], 1);
}
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_LVL_4_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_4_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_4_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:0];
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_4_1_000013_WaitForMs
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Wait 100ms"];
dispatch_queue_t queue = dispatch_get_main_queue();
WaitForMs(expectation, queue, 100);
[self waitForExpectationsWithTimeout:(100 / 1000) + kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_LVL_4_1_000014_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"reads CurrentLevel 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 CurrentLevel attribute from DUT Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
if (actualValue != nil) {
XCTAssertNotEqual([actualValue unsignedCharValue], 255);
}
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_LVL_4_1_000015_MoveToLevel
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Reset level to 254"];
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:0U];
params.optionMask = [NSNumber numberWithUnsignedChar:1];
params.optionOverride = [NSNumber numberWithUnsignedChar:1];
[cluster moveToLevelWithParams:params
completionHandler:^(NSError * _Nullable err) {
NSLog(@"Reset level to 254 Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_LVL_4_1_000016_WaitForMs
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Wait 100ms"];
dispatch_queue_t queue = dispatch_get_main_queue();
WaitForMs(expectation, queue, 100);
[self waitForExpectationsWithTimeout:(100 / 1000) + 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, 305414945);
[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:1];
params.stepSize = [NSNumber numberWithUnsignedChar:126];
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 4000ms"];
dispatch_queue_t queue = dispatch_get_main_queue();
WaitForMs(expectation, queue, 4000);
[self waitForExpectationsWithTimeout:(4000 / 1000) + kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_LVL_5_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_5_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_5_1_000006_WaitForMs
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Wait 4000ms"];
dispatch_queue_t queue = dispatch_get_main_queue();
WaitForMs(expectation, queue, 4000);
[self waitForExpectationsWithTimeout:(4000 / 1000) + kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_LVL_5_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_5_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_5_1_000009_WaitForMs
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Wait 4000ms"];
dispatch_queue_t queue = dispatch_get_main_queue();
WaitForMs(expectation, queue, 4000);
[self waitForExpectationsWithTimeout:(4000 / 1000) + kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_LVL_5_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_5_1_000011_MoveToLevel
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Reset level to 254"];
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:0U];
params.optionMask = [NSNumber numberWithUnsignedChar:1];
params.optionOverride = [NSNumber numberWithUnsignedChar:1];
[cluster moveToLevelWithParams:params
completionHandler:^(NSError * _Nullable err) {
NSLog(@"Reset level to 254 Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_LVL_5_1_000012_WaitForMs
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Wait 100ms"];
dispatch_queue_t queue = dispatch_get_main_queue();
WaitForMs(expectation, queue, 100);
[self waitForExpectationsWithTimeout:(100 / 1000) + kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_LVL_5_1_000013_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_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, 305414945);
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_LVL_6_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_6_1_000002_MoveToLevel
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Precondition: set DUT to lowest point"];
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(@"Precondition: set DUT to lowest point Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_LVL_6_1_000003_WaitForMs
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Wait 100ms"];
dispatch_queue_t queue = dispatch_get_main_queue();
WaitForMs(expectation, queue, 100);
[self waitForExpectationsWithTimeout:(100 / 1000) + kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_LVL_6_1_000004_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Reads CurrentLevel 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 CurrentLevel attribute from DUT Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
if (actualValue != nil) {
XCTAssertGreaterThanOrEqual([actualValue unsignedCharValue], 0);
}
}
{
id actualValue = value;
if (actualValue != nil) {
XCTAssertLessThanOrEqual([actualValue unsignedCharValue], 1);
}
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_LVL_6_1_000005_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_6_1_000006_WaitForMs
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Wait 2000ms"];
dispatch_queue_t queue = dispatch_get_main_queue();
WaitForMs(expectation, queue, 2000);
[self waitForExpectationsWithTimeout:(2000 / 1000) + kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_LVL_6_1_000007_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_6_1_000008_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Reads CurrentLevel 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 CurrentLevel attribute from DUT Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
if (actualValue != nil) {
XCTAssertGreaterThanOrEqual([actualValue unsignedCharValue], 2);
}
}
{
id actualValue = value;
if (actualValue != nil) {
XCTAssertLessThanOrEqual([actualValue unsignedCharValue], 3);
}
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_LVL_6_1_000009_MoveToLevel
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Reset level to 254"];
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:0U];
params.optionMask = [NSNumber numberWithUnsignedChar:1];
params.optionOverride = [NSNumber numberWithUnsignedChar:1];
[cluster moveToLevelWithParams:params
completionHandler:^(NSError * _Nullable err) {
NSLog(@"Reset level to 254 Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_LVL_6_1_000010_WaitForMs
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Wait 100ms"];
dispatch_queue_t queue = dispatch_get_main_queue();
WaitForMs(expectation, queue, 100);
[self waitForExpectationsWithTimeout:(100 / 1000) + kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_LVL_6_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_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, 305414945);
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_MC_1_1_000001_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"read the 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);
[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_MC_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();
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_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();
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_1_1_000004_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"reads back 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);
[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_MC_1_1_000005_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Read the global attribute: AttributeList"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestMediaInput * cluster = [[CHIPTestMediaInput alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeAttributeListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) {
NSLog(@"Read the global attribute: AttributeList Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
[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, 305414945);
[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, 305414945);
[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, 305414945);
[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, 305414945);
[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, 305414945);
[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, 305414945);
[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, 305414945);
[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, 305414945);
[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, 305414945);
[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, 305414945);
[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, 305414945);
[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, 305414945);
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_MC_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, 305414945);
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_MC_5_1_000001_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Reads the ChannelList attribute from the DUT"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestChannel * cluster = [[CHIPTestChannel alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeChannelListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) {
NSLog(@"Reads the ChannelList attribute from the DUT Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_MC_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, 305414945);
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_MC_5_2_000001_UserPrompt
{
XCTestExpectation * expectation = [self expectationWithDescription:@"log a command"];
dispatch_queue_t queue = dispatch_get_main_queue();
UserPrompt(expectation, queue, @"verify that the channel has changed on the device.");
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_MC_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, 305414945);
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_MC_5_3_000001_UserPrompt
{
XCTestExpectation * expectation = [self expectationWithDescription:@"log a command"];
dispatch_queue_t queue = dispatch_get_main_queue();
UserPrompt(expectation, queue, @"verify that the channel has changed on the device");
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_MC_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, 305414945);
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_MC_6_1_000001_UserPrompt
{
XCTestExpectation * expectation = [self expectationWithDescription:@"log a command"];
dispatch_queue_t queue = dispatch_get_main_queue();
UserPrompt(expectation, queue, @"Verify that media is paused");
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_MC_6_1_000002_UserPrompt
{
XCTestExpectation * expectation = [self expectationWithDescription:@"log a command"];
dispatch_queue_t queue = dispatch_get_main_queue();
UserPrompt(expectation, queue, @"Physically verify that the media is playing");
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_MC_6_1_000003_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Reads the playback state attribute"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestMediaPlayback * cluster = [[CHIPTestMediaPlayback alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeCurrentStateWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"Reads the playback state attribute Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertEqual([actualValue unsignedCharValue], 0);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_MC_6_1_000004_UserPrompt
{
XCTestExpectation * expectation = [self expectationWithDescription:@"log a command"];
dispatch_queue_t queue = dispatch_get_main_queue();
UserPrompt(expectation, queue, @"Physically verify that the media is paused");
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_MC_6_1_000005_UserPrompt
{
XCTestExpectation * expectation = [self expectationWithDescription:@"log a command"];
dispatch_queue_t queue = dispatch_get_main_queue();
UserPrompt(expectation, queue, @"Physically verify that the media is stoped");
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_MC_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, 305414945);
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_MC_6_2_000001_UserPrompt
{
XCTestExpectation * expectation = [self expectationWithDescription:@"log a command"];
dispatch_queue_t queue = dispatch_get_main_queue();
UserPrompt(expectation, queue, @"Verify that media is paused");
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_MC_6_2_000002_UserPrompt
{
XCTestExpectation * expectation = [self expectationWithDescription:@"log a command"];
dispatch_queue_t queue = dispatch_get_main_queue();
UserPrompt(expectation, queue, @"Physically verify that the media is playing");
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_MC_6_2_000003_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Reads the CurrentState attribute"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestMediaPlayback * cluster = [[CHIPTestMediaPlayback alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeCurrentStateWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"Reads the CurrentState attribute Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertEqual([actualValue unsignedCharValue], 0);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_MC_6_2_000004_UserPrompt
{
XCTestExpectation * expectation = [self expectationWithDescription:@"log a command"];
dispatch_queue_t queue = dispatch_get_main_queue();
UserPrompt(expectation, queue, @"Physically verify that the media is started over");
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_MC_6_2_000005_UserPrompt
{
XCTestExpectation * expectation = [self expectationWithDescription:@"log a command"];
dispatch_queue_t queue = dispatch_get_main_queue();
UserPrompt(expectation, queue, @"Verify that the next media item in the queue has been loaded");
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_MC_6_2_000006_UserPrompt
{
XCTestExpectation * expectation = [self expectationWithDescription:@"log a command"];
dispatch_queue_t queue = dispatch_get_main_queue();
UserPrompt(expectation, queue, @"Verify that the previous media item in the queue has been loaded");
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_MC_6_2_000007_UserPrompt
{
XCTestExpectation * expectation = [self expectationWithDescription:@"log a command"];
dispatch_queue_t queue = dispatch_get_main_queue();
UserPrompt(expectation, queue, @"Verify that the media has skipped forward 10 seconds");
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_MC_6_2_000008_UserPrompt
{
XCTestExpectation * expectation = [self expectationWithDescription:@"log a command"];
dispatch_queue_t queue = dispatch_get_main_queue();
UserPrompt(expectation, queue, @"Verify that the media has skipped backward 10 seconds");
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_MC_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, 305414945);
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_MC_6_3_000001_UserPrompt
{
XCTestExpectation * expectation = [self expectationWithDescription:@"log a command"];
dispatch_queue_t queue = dispatch_get_main_queue();
UserPrompt(expectation, queue, @"Verify that media is paused");
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_MC_6_3_000002_UserPrompt
{
XCTestExpectation * expectation = [self expectationWithDescription:@"log a command"];
dispatch_queue_t queue = dispatch_get_main_queue();
UserPrompt(expectation, queue, @"Verify that the media has moved to 10 seconds from the starting point.");
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_MC_6_3_000003_UserPrompt
{
XCTestExpectation * expectation = [self expectationWithDescription:@"log a command"];
dispatch_queue_t queue = dispatch_get_main_queue();
UserPrompt(expectation, queue, @"User prompt needed to enter the value beyond the furthest valid position");
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_MC_6_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, 305414945);
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_MC_6_4_000001_UserPrompt
{
XCTestExpectation * expectation = [self expectationWithDescription:@"log a command"];
dispatch_queue_t queue = dispatch_get_main_queue();
UserPrompt(expectation, queue, @"Verify that media is paused");
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_MC_6_4_000002_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Reads the PlaybackSpeed attribute from the DUT"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestMediaPlayback * cluster = [[CHIPTestMediaPlayback alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributePlaybackSpeedWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"Reads the PlaybackSpeed attribute from the DUT Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertEqual([actualValue floatValue], 0.0f);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_MC_6_4_000003_UserPrompt
{
XCTestExpectation * expectation = [self expectationWithDescription:@"log a command"];
dispatch_queue_t queue = dispatch_get_main_queue();
UserPrompt(expectation, queue, @"Verify that the media is playing");
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_MC_6_4_000004_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Reads the CurrentState attribute"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestMediaPlayback * cluster = [[CHIPTestMediaPlayback alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeCurrentStateWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"Reads the CurrentState attribute Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertEqual([actualValue unsignedCharValue], 0);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_MC_6_4_000005_UserPrompt
{
XCTestExpectation * expectation = [self expectationWithDescription:@"log a command"];
dispatch_queue_t queue = dispatch_get_main_queue();
UserPrompt(expectation, queue, @"Verify that the media play speed has increased");
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_MC_6_4_000006_UserPrompt
{
XCTestExpectation * expectation = [self expectationWithDescription:@"log a command"];
dispatch_queue_t queue = dispatch_get_main_queue();
UserPrompt(expectation, queue, @"Verify that the media play has reversed direction");
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_MC_6_4_000007_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Reads the CurrentState attribute"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestMediaPlayback * cluster = [[CHIPTestMediaPlayback alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeCurrentStateWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"Reads the CurrentState attribute Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertEqual([actualValue unsignedCharValue], 0);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_MC_6_4_000008_UserPrompt
{
XCTestExpectation * expectation = [self expectationWithDescription:@"log a command"];
dispatch_queue_t queue = dispatch_get_main_queue();
UserPrompt(expectation, queue, @"Verify that the media play has reversed direction");
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_MC_6_4_000009_UserPrompt
{
XCTestExpectation * expectation = [self expectationWithDescription:@"log a command"];
dispatch_queue_t queue = dispatch_get_main_queue();
UserPrompt(expectation, queue, @"Verify that the media is has resumed playing forward at the default speed");
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_MC_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, 305414945);
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_MC_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, 305414945);
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_MC_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, 305414945);
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_MC_8_1_000001_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Reads the CurrentTarget attribute"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestTargetNavigator * cluster = [[CHIPTestTargetNavigator alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeCurrentTargetWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"Reads the CurrentTarget attribute Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_MC_8_1_000002_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Reads the TargetList attribute"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestTargetNavigator * cluster = [[CHIPTestTargetNavigator alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeTargetListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) {
NSLog(@"Reads the TargetList attribute Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_MC_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, 305414945);
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_MC_9_1_000001_Log
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Precondition"];
dispatch_queue_t queue = dispatch_get_main_queue();
Log(expectation, queue, @"DUT has one or more Content Apps available");
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_MC_9_1_000002_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Reads the VendorName attribute"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestApplicationBasic * cluster = [[CHIPTestApplicationBasic alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeVendorNameWithCompletionHandler:^(NSString * _Nullable value, NSError * _Nullable err) {
NSLog(@"Reads the VendorName attribute Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_MC_9_1_000003_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Reads the VendorID attribute"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestApplicationBasic * cluster = [[CHIPTestApplicationBasic alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeVendorIDWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"Reads the VendorID attribute Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertEqual([actualValue unsignedShortValue], 0U);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_MC_9_1_000004_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Reads the ApplicationName attribute"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestApplicationBasic * cluster = [[CHIPTestApplicationBasic alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeApplicationNameWithCompletionHandler:^(NSString * _Nullable value, NSError * _Nullable err) {
NSLog(@"Reads the ApplicationName attribute Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertLessThanOrEqual([actualValue length], 256);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_MC_9_1_000005_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Reads the ProductID attribute"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestApplicationBasic * cluster = [[CHIPTestApplicationBasic alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeProductIDWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"Reads the ProductID attribute Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_MC_9_1_000006_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Reads the Status attribute"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestApplicationBasic * cluster = [[CHIPTestApplicationBasic alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeStatusWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"Reads the Status attribute Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertEqual([actualValue unsignedCharValue], 0);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_MC_9_1_000007_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Reads the ApplicationVersion attribute"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestApplicationBasic * cluster = [[CHIPTestApplicationBasic alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeApplicationVersionWithCompletionHandler:^(NSString * _Nullable value, NSError * _Nullable err) {
NSLog(@"Reads the ApplicationVersion attribute Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertLessThanOrEqual([actualValue length], 32);
}
[expectation fulfill];
}];
[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, 305414945);
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_OCC_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();
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_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();
CHIPTestOccupancySensing * cluster = [[CHIPTestOccupancySensing 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_OCC_1_1_000003_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Read the global attribute: AttributeList"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestOccupancySensing * cluster = [[CHIPTestOccupancySensing alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeAttributeListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) {
NSLog(@"Read the global attribute: AttributeList Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
[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, 305414945);
[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;
if (actualValue != nil) {
XCTAssertGreaterThanOrEqual([actualValue unsignedCharValue], 0);
}
}
{
id actualValue = value;
if (actualValue != nil) {
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;
if (actualValue != nil) {
XCTAssertGreaterThanOrEqual([actualValue unsignedCharValue], 0);
}
}
{
id actualValue = value;
if (actualValue != nil) {
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;
if (actualValue != nil) {
XCTAssertGreaterThanOrEqual([actualValue unsignedCharValue], 1);
}
}
{
id actualValue = value;
if (actualValue != nil) {
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, 305414945);
[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, 305414945);
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_OO_1_1_000001_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_000002_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_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();
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_000004_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_000005_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Read the global attribute: AttributeList"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeAttributeListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) {
NSLog(@"Read the global attribute: AttributeList Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
[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], 1UL);
}
[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], 1UL);
}
[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, 305414945);
[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_WriteAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"write the default value of 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);
id onOffArgument;
onOffArgument = [NSNumber numberWithBool:0];
[cluster writeAttributeOnOffWithValue:onOffArgument
completionHandler:^(NSError * _Nullable err) {
NSLog(@"write the default value of mandatory attribute: OnOff Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], EMBER_ZCL_STATUS_UNSUPPORTED_WRITE);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_OO_2_1_000003_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_000004_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_000005_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_000006_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_000007_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_000008_WriteAttribute
{
XCTestExpectation * expectation =
[self expectationWithDescription:@"write the default value to 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);
id globalSceneControlArgument;
globalSceneControlArgument = [NSNumber numberWithBool:0];
[cluster writeAttributeGlobalSceneControlWithValue:globalSceneControlArgument
completionHandler:^(NSError * _Nullable err) {
NSLog(@"write the default value to LT attribute: GlobalSceneControl Error: %@", err);
XCTAssertEqual(
[CHIPErrorTestUtils errorToZCLErrorCode:err], EMBER_ZCL_STATUS_UNSUPPORTED_WRITE);
[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: 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_000010_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_000011_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_000012_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"reads back 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(@"reads back 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_000013_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_000014_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_000015_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, 305414945);
[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, 305414945);
[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:(1000 / 1000) + 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:(1000 / 1000) + 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:(1000 / 1000) + 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_PS_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, 305414945);
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_PS_1_1_000001_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"read the global attribute: ClusterRevision"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestPowerSource * cluster = [[CHIPTestPowerSource 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_PS_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();
CHIPTestPowerSource * cluster = [[CHIPTestPowerSource 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_PS_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();
CHIPTestPowerSource * cluster = [[CHIPTestPowerSource 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_PS_1_1_000004_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"reads back global attribute: ClusterRevision"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestPowerSource * cluster = [[CHIPTestPowerSource 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_PS_1_1_000005_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Read the global attribute: AttributeList"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestPowerSource * cluster = [[CHIPTestPowerSource alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeAttributeListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) {
NSLog(@"Read the global attribute: AttributeList 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, 305414945);
[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_1_1_000003_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Read the global attribute constraints: AttributeList"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestPressureMeasurement * cluster = [[CHIPTestPressureMeasurement alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeAttributeListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) {
NSLog(@"Read the global attribute constraints: AttributeList Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
[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, 305414945);
[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;
XCTAssertFalse(actualValue == nil);
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;
XCTAssertFalse(actualValue == nil);
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;
XCTAssertFalse(actualValue == nil);
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, 305414945);
[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 global attribute: AttributeList"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestPumpConfigurationAndControl * cluster = [[CHIPTestPumpConfigurationAndControl alloc] initWithDevice:device
endpoint:1
queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeAttributeListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) {
NSLog(@"Read the global attribute: AttributeList Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_PCC_1_1_000004_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, 305414945);
[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: MaxSpeed"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestPumpConfigurationAndControl * cluster = [[CHIPTestPumpConfigurationAndControl alloc] initWithDevice:device
endpoint:1
queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeMaxSpeedWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"read the mandatory attribute: MaxSpeed 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: MaxFlow"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestPumpConfigurationAndControl * cluster = [[CHIPTestPumpConfigurationAndControl alloc] initWithDevice:device
endpoint:1
queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeMaxFlowWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"read the mandatory attribute: MaxFlow 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: 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_000005_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_000006_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_000007_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_000008_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"read the mandatory attribute: MaxSpeed"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestPumpConfigurationAndControl * cluster = [[CHIPTestPumpConfigurationAndControl alloc] initWithDevice:device
endpoint:1
queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeMaxSpeedWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"read the mandatory attribute: MaxSpeed Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_PCC_2_1_000009_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"read the mandatory attribute: MaxFlow"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestPumpConfigurationAndControl * cluster = [[CHIPTestPumpConfigurationAndControl alloc] initWithDevice:device
endpoint:1
queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeMaxFlowWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"read the mandatory attribute: MaxFlow Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_PCC_2_1_000010_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_000011_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_000012_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_000013_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"read the optional attribute: MinConstPressure"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestPumpConfigurationAndControl * cluster = [[CHIPTestPumpConfigurationAndControl alloc] initWithDevice:device
endpoint:1
queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeMinConstPressureWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"read the optional attribute: MinConstPressure Error: %@", err);
if (err.domain == MatterInteractionErrorDomain && err.code == MatterInteractionErrorCodeUnsupportedAttribute) {
[expectation fulfill];
return;
}
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_PCC_2_1_000014_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"read the optional attribute: MaxConstPressure"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestPumpConfigurationAndControl * cluster = [[CHIPTestPumpConfigurationAndControl alloc] initWithDevice:device
endpoint:1
queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeMaxConstPressureWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"read the optional attribute: MaxConstPressure Error: %@", err);
if (err.domain == MatterInteractionErrorDomain && err.code == MatterInteractionErrorCodeUnsupportedAttribute) {
[expectation fulfill];
return;
}
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_PCC_2_1_000015_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"read the optional attribute: MinCompPressure"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestPumpConfigurationAndControl * cluster = [[CHIPTestPumpConfigurationAndControl alloc] initWithDevice:device
endpoint:1
queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeMinCompPressureWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"read the optional attribute: MinCompPressure Error: %@", err);
if (err.domain == MatterInteractionErrorDomain && err.code == MatterInteractionErrorCodeUnsupportedAttribute) {
[expectation fulfill];
return;
}
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_PCC_2_1_000016_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"read the optional attribute: MaxCompPressure"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestPumpConfigurationAndControl * cluster = [[CHIPTestPumpConfigurationAndControl alloc] initWithDevice:device
endpoint:1
queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeMaxCompPressureWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"read the optional attribute: MaxCompPressure Error: %@", err);
if (err.domain == MatterInteractionErrorDomain && err.code == MatterInteractionErrorCodeUnsupportedAttribute) {
[expectation fulfill];
return;
}
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_PCC_2_1_000017_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"read the optional attribute: MinConstSpeed"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestPumpConfigurationAndControl * cluster = [[CHIPTestPumpConfigurationAndControl alloc] initWithDevice:device
endpoint:1
queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeMinConstSpeedWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"read the optional attribute: MinConstSpeed Error: %@", err);
if (err.domain == MatterInteractionErrorDomain && err.code == MatterInteractionErrorCodeUnsupportedAttribute) {
[expectation fulfill];
return;
}
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_PCC_2_1_000018_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"read the optional attribute: MaxConstSpeed"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestPumpConfigurationAndControl * cluster = [[CHIPTestPumpConfigurationAndControl alloc] initWithDevice:device
endpoint:1
queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeMaxConstSpeedWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"read the optional attribute: MaxConstSpeed Error: %@", err);
if (err.domain == MatterInteractionErrorDomain && err.code == MatterInteractionErrorCodeUnsupportedAttribute) {
[expectation fulfill];
return;
}
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_PCC_2_1_000019_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"read the optional attribute: MinConstFlow"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestPumpConfigurationAndControl * cluster = [[CHIPTestPumpConfigurationAndControl alloc] initWithDevice:device
endpoint:1
queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeMinConstFlowWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"read the optional attribute: MinConstFlow Error: %@", err);
if (err.domain == MatterInteractionErrorDomain && err.code == MatterInteractionErrorCodeUnsupportedAttribute) {
[expectation fulfill];
return;
}
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_PCC_2_1_000020_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"read the optional attribute: MaxConstFlow"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestPumpConfigurationAndControl * cluster = [[CHIPTestPumpConfigurationAndControl alloc] initWithDevice:device
endpoint:1
queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeMaxConstFlowWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"read the optional attribute: MaxConstFlow Error: %@", err);
if (err.domain == MatterInteractionErrorDomain && err.code == MatterInteractionErrorCodeUnsupportedAttribute) {
[expectation fulfill];
return;
}
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_PCC_2_1_000021_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"read the optional attribute: MinConstTemp"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestPumpConfigurationAndControl * cluster = [[CHIPTestPumpConfigurationAndControl alloc] initWithDevice:device
endpoint:1
queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeMinConstTempWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"read the optional attribute: MinConstTemp Error: %@", err);
if (err.domain == MatterInteractionErrorDomain && err.code == MatterInteractionErrorCodeUnsupportedAttribute) {
[expectation fulfill];
return;
}
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
if (actualValue != nil) {
XCTAssertGreaterThanOrEqual([actualValue shortValue], -27315);
}
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_PCC_2_1_000022_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"read the optional attribute: MaxConstTemp"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestPumpConfigurationAndControl * cluster = [[CHIPTestPumpConfigurationAndControl alloc] initWithDevice:device
endpoint:1
queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeMaxConstTempWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"read the optional attribute: MaxConstTemp Error: %@", err);
if (err.domain == MatterInteractionErrorDomain && err.code == MatterInteractionErrorCodeUnsupportedAttribute) {
[expectation fulfill];
return;
}
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
if (actualValue != nil) {
XCTAssertGreaterThanOrEqual([actualValue shortValue], -27315);
}
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_PCC_2_1_000023_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"read the optional attribute: PumpStatus"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestPumpConfigurationAndControl * cluster = [[CHIPTestPumpConfigurationAndControl alloc] initWithDevice:device
endpoint:1
queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributePumpStatusWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"read the optional attribute: PumpStatus Error: %@", err);
if (err.domain == MatterInteractionErrorDomain && err.code == MatterInteractionErrorCodeUnsupportedAttribute) {
[expectation fulfill];
return;
}
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertEqual([actualValue unsignedShortValue], 0U);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_PCC_2_1_000024_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"read the optional attribute: PumpStatus"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestPumpConfigurationAndControl * cluster = [[CHIPTestPumpConfigurationAndControl alloc] initWithDevice:device
endpoint:1
queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributePumpStatusWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"read the optional attribute: PumpStatus Error: %@", err);
if (err.domain == MatterInteractionErrorDomain && err.code == MatterInteractionErrorCodeUnsupportedAttribute) {
[expectation fulfill];
return;
}
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_PCC_2_1_000025_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"read the optional attribute: Speed"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestPumpConfigurationAndControl * cluster = [[CHIPTestPumpConfigurationAndControl alloc] initWithDevice:device
endpoint:1
queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeSpeedWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"read the optional attribute: Speed Error: %@", err);
if (err.domain == MatterInteractionErrorDomain && err.code == MatterInteractionErrorCodeUnsupportedAttribute) {
[expectation fulfill];
return;
}
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_PCC_2_1_000026_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"read the optional attribute: LifetimeRunningHours"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestPumpConfigurationAndControl * cluster = [[CHIPTestPumpConfigurationAndControl alloc] initWithDevice:device
endpoint:1
queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeLifetimeRunningHoursWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"read the optional attribute: LifetimeRunningHours Error: %@", err);
if (err.domain == MatterInteractionErrorDomain && err.code == MatterInteractionErrorCodeUnsupportedAttribute) {
[expectation fulfill];
return;
}
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertFalse(actualValue == nil);
XCTAssertEqual([actualValue unsignedIntValue], 0UL);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_PCC_2_1_000027_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"read the optional attribute: LifetimeRunningHours"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestPumpConfigurationAndControl * cluster = [[CHIPTestPumpConfigurationAndControl alloc] initWithDevice:device
endpoint:1
queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeLifetimeRunningHoursWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"read the optional attribute: LifetimeRunningHours Error: %@", err);
if (err.domain == MatterInteractionErrorDomain && err.code == MatterInteractionErrorCodeUnsupportedAttribute) {
[expectation fulfill];
return;
}
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_PCC_2_1_000028_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"read the optional attribute: Power"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestPumpConfigurationAndControl * cluster = [[CHIPTestPumpConfigurationAndControl alloc] initWithDevice:device
endpoint:1
queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributePowerWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"read the optional attribute: Power Error: %@", err);
if (err.domain == MatterInteractionErrorDomain && err.code == MatterInteractionErrorCodeUnsupportedAttribute) {
[expectation fulfill];
return;
}
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_PCC_2_1_000029_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"read the optional attribute: LifetimeEnergyConsumed"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestPumpConfigurationAndControl * cluster = [[CHIPTestPumpConfigurationAndControl alloc] initWithDevice:device
endpoint:1
queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeLifetimeEnergyConsumedWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"read the optional attribute: LifetimeEnergyConsumed Error: %@", err);
if (err.domain == MatterInteractionErrorDomain && err.code == MatterInteractionErrorCodeUnsupportedAttribute) {
[expectation fulfill];
return;
}
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertFalse(actualValue == nil);
XCTAssertEqual([actualValue unsignedIntValue], 0UL);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_PCC_2_1_000030_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"read the optional attribute: LifetimeEnergyConsumed"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestPumpConfigurationAndControl * cluster = [[CHIPTestPumpConfigurationAndControl alloc] initWithDevice:device
endpoint:1
queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeLifetimeEnergyConsumedWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"read the optional attribute: LifetimeEnergyConsumed Error: %@", err);
if (err.domain == MatterInteractionErrorDomain && err.code == MatterInteractionErrorCodeUnsupportedAttribute) {
[expectation fulfill];
return;
}
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_PCC_2_1_000031_WriteAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"write to the optional attribute: LifetimeEnergyConsumed"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestPumpConfigurationAndControl * cluster = [[CHIPTestPumpConfigurationAndControl alloc] initWithDevice:device
endpoint:1
queue:queue];
XCTAssertNotNil(cluster);
id lifetimeEnergyConsumedArgument;
lifetimeEnergyConsumedArgument = [NSNumber numberWithUnsignedInt:0UL];
[cluster writeAttributeLifetimeEnergyConsumedWithValue:lifetimeEnergyConsumedArgument
completionHandler:^(NSError * _Nullable err) {
NSLog(@"write to the optional attribute: LifetimeEnergyConsumed Error: %@", err);
if (err.domain == MatterInteractionErrorDomain
&& err.code == MatterInteractionErrorCodeUnsupportedAttribute) {
[expectation fulfill];
return;
}
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_PCC_2_1_000032_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"read the optional attribute: MinConstPressure"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestPumpConfigurationAndControl * cluster = [[CHIPTestPumpConfigurationAndControl alloc] initWithDevice:device
endpoint:1
queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeMinConstPressureWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"read the optional attribute: MinConstPressure Error: %@", err);
if (err.domain == MatterInteractionErrorDomain && err.code == MatterInteractionErrorCodeUnsupportedAttribute) {
[expectation fulfill];
return;
}
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_PCC_2_1_000033_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"read the optional attribute: MaxConstPressure"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestPumpConfigurationAndControl * cluster = [[CHIPTestPumpConfigurationAndControl alloc] initWithDevice:device
endpoint:1
queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeMaxConstPressureWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"read the optional attribute: MaxConstPressure Error: %@", err);
if (err.domain == MatterInteractionErrorDomain && err.code == MatterInteractionErrorCodeUnsupportedAttribute) {
[expectation fulfill];
return;
}
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_PCC_2_1_000034_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"read the optional attribute: MinCompPressure"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestPumpConfigurationAndControl * cluster = [[CHIPTestPumpConfigurationAndControl alloc] initWithDevice:device
endpoint:1
queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeMinCompPressureWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"read the optional attribute: MinCompPressure Error: %@", err);
if (err.domain == MatterInteractionErrorDomain && err.code == MatterInteractionErrorCodeUnsupportedAttribute) {
[expectation fulfill];
return;
}
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_PCC_2_1_000035_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"read the optional attribute: MaxCompPressure"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestPumpConfigurationAndControl * cluster = [[CHIPTestPumpConfigurationAndControl alloc] initWithDevice:device
endpoint:1
queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeMaxCompPressureWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"read the optional attribute: MaxCompPressure Error: %@", err);
if (err.domain == MatterInteractionErrorDomain && err.code == MatterInteractionErrorCodeUnsupportedAttribute) {
[expectation fulfill];
return;
}
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_PCC_2_1_000036_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"read the optional attribute: MinConstSpeed"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestPumpConfigurationAndControl * cluster = [[CHIPTestPumpConfigurationAndControl alloc] initWithDevice:device
endpoint:1
queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeMinConstSpeedWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"read the optional attribute: MinConstSpeed Error: %@", err);
if (err.domain == MatterInteractionErrorDomain && err.code == MatterInteractionErrorCodeUnsupportedAttribute) {
[expectation fulfill];
return;
}
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_PCC_2_1_000037_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"read the optional attribute: MaxConstSpeed"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestPumpConfigurationAndControl * cluster = [[CHIPTestPumpConfigurationAndControl alloc] initWithDevice:device
endpoint:1
queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeMaxConstSpeedWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"read the optional attribute: MaxConstSpeed Error: %@", err);
if (err.domain == MatterInteractionErrorDomain && err.code == MatterInteractionErrorCodeUnsupportedAttribute) {
[expectation fulfill];
return;
}
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_PCC_2_1_000038_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"read the optional attribute: MinConstFlow"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestPumpConfigurationAndControl * cluster = [[CHIPTestPumpConfigurationAndControl alloc] initWithDevice:device
endpoint:1
queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeMinConstFlowWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"read the optional attribute: MinConstFlow Error: %@", err);
if (err.domain == MatterInteractionErrorDomain && err.code == MatterInteractionErrorCodeUnsupportedAttribute) {
[expectation fulfill];
return;
}
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_PCC_2_1_000039_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"read the optional attribute: MaxConstFlow"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestPumpConfigurationAndControl * cluster = [[CHIPTestPumpConfigurationAndControl alloc] initWithDevice:device
endpoint:1
queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeMaxConstFlowWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"read the optional attribute: MaxConstFlow Error: %@", err);
if (err.domain == MatterInteractionErrorDomain && err.code == MatterInteractionErrorCodeUnsupportedAttribute) {
[expectation fulfill];
return;
}
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_PCC_2_1_000040_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"read the optional attribute: MinConstTemp"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestPumpConfigurationAndControl * cluster = [[CHIPTestPumpConfigurationAndControl alloc] initWithDevice:device
endpoint:1
queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeMinConstTempWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"read the optional attribute: MinConstTemp Error: %@", err);
if (err.domain == MatterInteractionErrorDomain && err.code == MatterInteractionErrorCodeUnsupportedAttribute) {
[expectation fulfill];
return;
}
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
if (actualValue != nil) {
XCTAssertGreaterThanOrEqual([actualValue shortValue], -27315);
}
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_PCC_2_1_000041_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"read the optional attribute: MaxConstTemp"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestPumpConfigurationAndControl * cluster = [[CHIPTestPumpConfigurationAndControl alloc] initWithDevice:device
endpoint:1
queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeMaxConstTempWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"read the optional attribute: MaxConstTemp Error: %@", err);
if (err.domain == MatterInteractionErrorDomain && err.code == MatterInteractionErrorCodeUnsupportedAttribute) {
[expectation fulfill];
return;
}
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
if (actualValue != nil) {
XCTAssertGreaterThanOrEqual([actualValue shortValue], -27315);
}
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_PCC_2_1_000042_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"read the optional attribute: PumpStatus"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestPumpConfigurationAndControl * cluster = [[CHIPTestPumpConfigurationAndControl alloc] initWithDevice:device
endpoint:1
queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributePumpStatusWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"read the optional attribute: PumpStatus Error: %@", err);
if (err.domain == MatterInteractionErrorDomain && err.code == MatterInteractionErrorCodeUnsupportedAttribute) {
[expectation fulfill];
return;
}
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertEqual([actualValue unsignedShortValue], 0U);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_PCC_2_1_000043_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"read the optional attribute: PumpStatus"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestPumpConfigurationAndControl * cluster = [[CHIPTestPumpConfigurationAndControl alloc] initWithDevice:device
endpoint:1
queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributePumpStatusWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"read the optional attribute: PumpStatus Error: %@", err);
if (err.domain == MatterInteractionErrorDomain && err.code == MatterInteractionErrorCodeUnsupportedAttribute) {
[expectation fulfill];
return;
}
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_PCC_2_1_000044_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"read the optional attribute: Speed"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestPumpConfigurationAndControl * cluster = [[CHIPTestPumpConfigurationAndControl alloc] initWithDevice:device
endpoint:1
queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeSpeedWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"read the optional attribute: Speed Error: %@", err);
if (err.domain == MatterInteractionErrorDomain && err.code == MatterInteractionErrorCodeUnsupportedAttribute) {
[expectation fulfill];
return;
}
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_PCC_2_1_000045_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"read the optional attribute: LifetimeRunningHours"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestPumpConfigurationAndControl * cluster = [[CHIPTestPumpConfigurationAndControl alloc] initWithDevice:device
endpoint:1
queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeLifetimeRunningHoursWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"read the optional attribute: LifetimeRunningHours Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertFalse(actualValue == nil);
XCTAssertEqual([actualValue unsignedIntValue], 0UL);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_PCC_2_1_000046_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"read the optional attribute: LifetimeRunningHours"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestPumpConfigurationAndControl * cluster = [[CHIPTestPumpConfigurationAndControl alloc] initWithDevice:device
endpoint:1
queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeLifetimeRunningHoursWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"read the optional attribute: LifetimeRunningHours Error: %@", err);
if (err.domain == MatterInteractionErrorDomain && err.code == MatterInteractionErrorCodeUnsupportedAttribute) {
[expectation fulfill];
return;
}
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_PCC_2_1_000047_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"read the optional attribute: Power"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestPumpConfigurationAndControl * cluster = [[CHIPTestPumpConfigurationAndControl alloc] initWithDevice:device
endpoint:1
queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributePowerWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"read the optional attribute: Power Error: %@", err);
if (err.domain == MatterInteractionErrorDomain && err.code == MatterInteractionErrorCodeUnsupportedAttribute) {
[expectation fulfill];
return;
}
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_PCC_2_1_000048_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"read the optional attribute: LifetimeEnergyConsumed"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestPumpConfigurationAndControl * cluster = [[CHIPTestPumpConfigurationAndControl alloc] initWithDevice:device
endpoint:1
queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeLifetimeEnergyConsumedWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"read the optional attribute: LifetimeEnergyConsumed Error: %@", err);
if (err.domain == MatterInteractionErrorDomain && err.code == MatterInteractionErrorCodeUnsupportedAttribute) {
[expectation fulfill];
return;
}
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertFalse(actualValue == nil);
XCTAssertEqual([actualValue unsignedIntValue], 0UL);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_PCC_2_1_000049_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"read the optional attribute: LifetimeEnergyConsumed"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestPumpConfigurationAndControl * cluster = [[CHIPTestPumpConfigurationAndControl alloc] initWithDevice:device
endpoint:1
queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeLifetimeEnergyConsumedWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"read the optional attribute: LifetimeEnergyConsumed Error: %@", err);
if (err.domain == MatterInteractionErrorDomain && err.code == MatterInteractionErrorCodeUnsupportedAttribute) {
[expectation fulfill];
return;
}
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, 305414945);
[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, 305414945);
[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_PCC_2_3_000003_WriteAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Write 0 to the ControlMode 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 controlModeArgument;
controlModeArgument = [NSNumber numberWithUnsignedChar:0];
[cluster writeAttributeControlModeWithValue:controlModeArgument
completionHandler:^(NSError * _Nullable err) {
NSLog(@"Write 0 to the ControlMode attribute to DUT Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_PCC_2_3_000004_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Reads the 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(@"Reads the attribute: EffectiveControlMode Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertEqual([actualValue unsignedCharValue], 0);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_PCC_2_3_000005_WriteAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Write 1 to the ControlMode 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 controlModeArgument;
controlModeArgument = [NSNumber numberWithUnsignedChar:1];
[cluster writeAttributeControlModeWithValue:controlModeArgument
completionHandler:^(NSError * _Nullable err) {
NSLog(@"Write 1 to the ControlMode attribute to DUT Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_PCC_2_3_000006_WriteAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Write 2 to the ControlMode 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 controlModeArgument;
controlModeArgument = [NSNumber numberWithUnsignedChar:2];
[cluster writeAttributeControlModeWithValue:controlModeArgument
completionHandler:^(NSError * _Nullable err) {
NSLog(@"Write 2 to the ControlMode attribute to DUT Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_PCC_2_3_000007_WriteAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Write 3 to the ControlMode 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 controlModeArgument;
controlModeArgument = [NSNumber numberWithUnsignedChar:3];
[cluster writeAttributeControlModeWithValue:controlModeArgument
completionHandler:^(NSError * _Nullable err) {
NSLog(@"Write 3 to the ControlMode attribute to DUT Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_PCC_2_3_000008_WriteAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Write 5 to the ControlMode 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 controlModeArgument;
controlModeArgument = [NSNumber numberWithUnsignedChar:5];
[cluster writeAttributeControlModeWithValue:controlModeArgument
completionHandler:^(NSError * _Nullable err) {
NSLog(@"Write 5 to the ControlMode attribute to DUT Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_PCC_2_3_000009_WriteAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Write 7 to the ControlMode 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 controlModeArgument;
controlModeArgument = [NSNumber numberWithUnsignedChar:7];
[cluster writeAttributeControlModeWithValue:controlModeArgument
completionHandler:^(NSError * _Nullable err) {
NSLog(@"Write 7 to the ControlMode attribute to DUT Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 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, 305414945);
[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_1_1_000003_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Read the global attribute: AttributeList"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestRelativeHumidityMeasurement * cluster = [[CHIPTestRelativeHumidityMeasurement alloc] initWithDevice:device
endpoint:1
queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeAttributeListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) {
NSLog(@"Read the global attribute: AttributeList Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
[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, 305414945);
[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;
if (actualValue != nil) {
XCTAssertGreaterThanOrEqual([actualValue unsignedShortValue], 0U);
}
}
{
id actualValue = value;
if (actualValue != nil) {
XCTAssertLessThanOrEqual([actualValue unsignedShortValue], 9999U);
}
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_RH_2_1_000003_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Reads the optional attribute: Tolerance"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestRelativeHumidityMeasurement * cluster = [[CHIPTestRelativeHumidityMeasurement alloc] initWithDevice:device
endpoint:1
queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeToleranceWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"Reads the optional attribute: Tolerance Error: %@", err);
if (err.domain == MatterInteractionErrorDomain && err.code == MatterInteractionErrorCodeUnsupportedAttribute) {
[expectation fulfill];
return;
}
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertEqual([actualValue unsignedShortValue], 0U);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_RH_2_1_000004_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Reads constraints of attribute: Tolerance"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestRelativeHumidityMeasurement * cluster = [[CHIPTestRelativeHumidityMeasurement alloc] initWithDevice:device
endpoint:1
queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeToleranceWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"Reads constraints of attribute: Tolerance Error: %@", err);
if (err.domain == MatterInteractionErrorDomain && err.code == MatterInteractionErrorCodeUnsupportedAttribute) {
[expectation fulfill];
return;
}
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
if (actualValue != nil) {
XCTAssertGreaterThanOrEqual([actualValue unsignedShortValue], 0U);
}
}
{
id actualValue = value;
if (actualValue != nil) {
XCTAssertLessThanOrEqual([actualValue unsignedShortValue], 2048U);
}
}
[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, 305414945);
[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_SWTCH_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, 305414945);
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_SWTCH_2_1_000001_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Read NumberOfPositions attribute"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestSwitch * cluster = [[CHIPTestSwitch alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeNumberOfPositionsWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"Read NumberOfPositions attribute Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertEqual([actualValue unsignedCharValue], 2);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_SWTCH_2_1_000002_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Read NumberOfPositions attribute"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestSwitch * cluster = [[CHIPTestSwitch alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeNumberOfPositionsWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"Read NumberOfPositions attribute Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
if (actualValue != nil) {
XCTAssertGreaterThanOrEqual([actualValue unsignedCharValue], 2);
}
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_SWTCH_2_1_000003_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Read CurrentPosition attribute"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestSwitch * cluster = [[CHIPTestSwitch alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeCurrentPositionWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"Read CurrentPosition attribute Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertEqual([actualValue unsignedCharValue], 0);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_SWTCH_2_1_000004_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Read CurrentPosition attribute"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestSwitch * cluster = [[CHIPTestSwitch alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeCurrentPositionWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"Read CurrentPosition attribute Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
if (actualValue != nil) {
XCTAssertGreaterThanOrEqual([actualValue unsignedCharValue], 0);
}
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_SWTCH_2_1_000005_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Read MultiPressMax attribute"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestSwitch * cluster = [[CHIPTestSwitch alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeMultiPressMaxWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"Read MultiPressMax attribute Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertEqual([actualValue unsignedCharValue], 2);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_SWTCH_2_1_000006_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Read MultiPressMax attribute"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestSwitch * cluster = [[CHIPTestSwitch alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeMultiPressMaxWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"Read MultiPressMax attribute Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
if (actualValue != nil) {
XCTAssertGreaterThanOrEqual([actualValue unsignedCharValue], 2);
}
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_SWTCH_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, 305414945);
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_SWTCH_2_2_000001_UserPrompt
{
XCTestExpectation * expectation = [self expectationWithDescription:@"User interaction needed"];
dispatch_queue_t queue = dispatch_get_main_queue();
UserPrompt(expectation, queue, @"Set up subscription to SwitchLatched event");
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_SWTCH_2_2_000002_UserPrompt
{
XCTestExpectation * expectation = [self expectationWithDescription:@"User interaction needed"];
dispatch_queue_t queue = dispatch_get_main_queue();
UserPrompt(expectation, queue, @"Operator sets switch to first position");
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_SWTCH_2_2_000003_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Read CurrentPosition attribute"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestSwitch * cluster = [[CHIPTestSwitch alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeCurrentPositionWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"Read CurrentPosition attribute Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertEqual([actualValue unsignedCharValue], 0);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_SWTCH_2_2_000004_UserPrompt
{
XCTestExpectation * expectation = [self expectationWithDescription:@"User interaction needed"];
dispatch_queue_t queue = dispatch_get_main_queue();
UserPrompt(expectation, queue, @"Operator sets switch to second position");
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_SWTCH_2_2_000005_UserPrompt
{
XCTestExpectation * expectation = [self expectationWithDescription:@"User interaction needed"];
dispatch_queue_t queue = dispatch_get_main_queue();
UserPrompt(expectation, queue, @"Set up subscription to InitialPress event");
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_SWTCH_2_2_000006_UserPrompt
{
XCTestExpectation * expectation = [self expectationWithDescription:@"User interaction needed"];
dispatch_queue_t queue = dispatch_get_main_queue();
UserPrompt(expectation, queue, @"Operator does not operate switch");
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_SWTCH_2_2_000007_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Read CurrentPosition attribute"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestSwitch * cluster = [[CHIPTestSwitch alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeCurrentPositionWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"Read CurrentPosition attribute Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertEqual([actualValue unsignedCharValue], 0);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_SWTCH_2_2_000008_UserPrompt
{
XCTestExpectation * expectation = [self expectationWithDescription:@"User interaction needed"];
dispatch_queue_t queue = dispatch_get_main_queue();
UserPrompt(expectation, queue, @"Operator sets switch to second position");
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_SWTCH_2_2_000009_UserPrompt
{
XCTestExpectation * expectation = [self expectationWithDescription:@"User interaction needed"];
dispatch_queue_t queue = dispatch_get_main_queue();
UserPrompt(expectation, queue, @"Operator does not operate switch (release switch)");
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_SWTCH_2_2_000010_UserPrompt
{
XCTestExpectation * expectation = [self expectationWithDescription:@"User interaction needed"];
dispatch_queue_t queue = dispatch_get_main_queue();
UserPrompt(expectation, queue, @"Set up subscription to InitialPress and ShortRelease events");
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_SWTCH_2_2_000011_UserPrompt
{
XCTestExpectation * expectation = [self expectationWithDescription:@"User interaction needed"];
dispatch_queue_t queue = dispatch_get_main_queue();
UserPrompt(expectation, queue, @"Operator does not operate switch");
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_SWTCH_2_2_000012_UserPrompt
{
XCTestExpectation * expectation = [self expectationWithDescription:@"User interaction needed"];
dispatch_queue_t queue = dispatch_get_main_queue();
UserPrompt(expectation, queue, @"Operator operates switch (press briefly)");
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_SWTCH_2_2_000013_UserPrompt
{
XCTestExpectation * expectation = [self expectationWithDescription:@"User interaction needed"];
dispatch_queue_t queue = dispatch_get_main_queue();
UserPrompt(expectation, queue, @"Operator releases switch");
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_SWTCH_2_2_000014_UserPrompt
{
XCTestExpectation * expectation = [self expectationWithDescription:@"User interaction needed"];
dispatch_queue_t queue = dispatch_get_main_queue();
UserPrompt(expectation, queue, @"Operator operates switch for 5 seconds");
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_SWTCH_2_2_000015_WaitForMs
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Wait 3000ms"];
dispatch_queue_t queue = dispatch_get_main_queue();
WaitForMs(expectation, queue, 3000);
[self waitForExpectationsWithTimeout:(3000 / 1000) + kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_SWTCH_2_2_000016_UserPrompt
{
XCTestExpectation * expectation = [self expectationWithDescription:@"User interaction needed"];
dispatch_queue_t queue = dispatch_get_main_queue();
UserPrompt(expectation, queue, @"Operator releases switch");
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_SWTCH_2_2_000017_UserPrompt
{
XCTestExpectation * expectation = [self expectationWithDescription:@"User interaction needed"];
dispatch_queue_t queue = dispatch_get_main_queue();
UserPrompt(expectation, queue, @"Set up subscription to InitialPress, LongPress, ShortRelease, LongRelease events");
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_SWTCH_2_2_000018_UserPrompt
{
XCTestExpectation * expectation = [self expectationWithDescription:@"User interaction needed"];
dispatch_queue_t queue = dispatch_get_main_queue();
UserPrompt(expectation, queue, @"Operator does not operate switch");
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_SWTCH_2_2_000019_UserPrompt
{
XCTestExpectation * expectation = [self expectationWithDescription:@"User interaction needed"];
dispatch_queue_t queue = dispatch_get_main_queue();
UserPrompt(expectation, queue, @"Operator operates switch (press briefly)");
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_SWTCH_2_2_000020_UserPrompt
{
XCTestExpectation * expectation = [self expectationWithDescription:@"User interaction needed"];
dispatch_queue_t queue = dispatch_get_main_queue();
UserPrompt(expectation, queue, @"Operator releases switch");
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_SWTCH_2_2_000021_UserPrompt
{
XCTestExpectation * expectation = [self expectationWithDescription:@"User interaction needed"];
dispatch_queue_t queue = dispatch_get_main_queue();
UserPrompt(expectation, queue, @"Operator operates switch for 5 seconds");
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_SWTCH_2_2_000022_WaitForMs
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Wait 3000ms"];
dispatch_queue_t queue = dispatch_get_main_queue();
WaitForMs(expectation, queue, 3000);
[self waitForExpectationsWithTimeout:(3000 / 1000) + kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_SWTCH_2_2_000023_UserPrompt
{
XCTestExpectation * expectation = [self expectationWithDescription:@"User interaction needed"];
dispatch_queue_t queue = dispatch_get_main_queue();
UserPrompt(expectation, queue, @"Operator releases switch");
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_SWTCH_2_2_000024_UserPrompt
{
XCTestExpectation * expectation = [self expectationWithDescription:@"User interaction needed"];
dispatch_queue_t queue = dispatch_get_main_queue();
UserPrompt(
expectation, queue, @"Set up subscription to InitialPress, ShortRelease, MultiPressOngoing, MultiPressComplete events");
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_SWTCH_2_2_000025_UserPrompt
{
XCTestExpectation * expectation = [self expectationWithDescription:@"User interaction needed"];
dispatch_queue_t queue = dispatch_get_main_queue();
UserPrompt(expectation, queue, @"Operator does not operate switch");
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_SWTCH_2_2_000026_UserPrompt
{
XCTestExpectation * expectation = [self expectationWithDescription:@"User interaction needed"];
dispatch_queue_t queue = dispatch_get_main_queue();
UserPrompt(expectation, queue, @"Operator operates switch (press briefly)");
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_SWTCH_2_2_000027_UserPrompt
{
XCTestExpectation * expectation = [self expectationWithDescription:@"User interaction needed"];
dispatch_queue_t queue = dispatch_get_main_queue();
UserPrompt(expectation, queue, @"Operator releases switch");
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_SWTCH_2_2_000028_UserPrompt
{
XCTestExpectation * expectation = [self expectationWithDescription:@"User interaction needed"];
dispatch_queue_t queue = dispatch_get_main_queue();
UserPrompt(expectation, queue, @"Operator operates switch (press briefly)");
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_SWTCH_2_2_000029_UserPrompt
{
XCTestExpectation * expectation = [self expectationWithDescription:@"User interaction needed"];
dispatch_queue_t queue = dispatch_get_main_queue();
UserPrompt(expectation, queue, @"Operator releases switch");
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_SWTCH_2_2_000030_UserPrompt
{
XCTestExpectation * expectation = [self expectationWithDescription:@"User interaction needed"];
dispatch_queue_t queue = dispatch_get_main_queue();
UserPrompt(expectation, queue, @"Operator operates switch again (press briefly)");
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_SWTCH_2_2_000031_UserPrompt
{
XCTestExpectation * expectation = [self expectationWithDescription:@"User interaction needed"];
dispatch_queue_t queue = dispatch_get_main_queue();
UserPrompt(expectation, queue, @"Operator releases switch");
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_SWTCH_2_2_000032_UserPrompt
{
XCTestExpectation * expectation = [self expectationWithDescription:@"User interaction needed"];
dispatch_queue_t queue = dispatch_get_main_queue();
UserPrompt(expectation, queue, @"Operator operates switch again (press briefly)");
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_SWTCH_2_2_000033_UserPrompt
{
XCTestExpectation * expectation = [self expectationWithDescription:@"User interaction needed"];
dispatch_queue_t queue = dispatch_get_main_queue();
UserPrompt(expectation, queue, @"Operator releases switch");
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_SWTCH_2_2_000034_UserPrompt
{
XCTestExpectation * expectation = [self expectationWithDescription:@"User interaction needed"];
dispatch_queue_t queue = dispatch_get_main_queue();
UserPrompt(expectation, queue, @"Operator operates switch again (press briefly)");
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_SWTCH_2_2_000035_UserPrompt
{
XCTestExpectation * expectation = [self expectationWithDescription:@"User interaction needed"];
dispatch_queue_t queue = dispatch_get_main_queue();
UserPrompt(expectation, queue, @"Operator releases switch");
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_SWTCH_2_2_000036_UserPrompt
{
XCTestExpectation * expectation = [self expectationWithDescription:@"User interaction needed"];
dispatch_queue_t queue = dispatch_get_main_queue();
UserPrompt(expectation, queue, @"Operator operates switch again (press briefly)");
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_SWTCH_2_2_000037_UserPrompt
{
XCTestExpectation * expectation = [self expectationWithDescription:@"User interaction needed"];
dispatch_queue_t queue = dispatch_get_main_queue();
UserPrompt(expectation, queue, @"Operator releases switch");
[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, 305414945);
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_TM_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();
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_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();
CHIPTestTemperatureMeasurement * cluster = [[CHIPTestTemperatureMeasurement 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_TM_1_1_000003_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Read the global attribute: AttributeList"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestTemperatureMeasurement * cluster = [[CHIPTestTemperatureMeasurement alloc] initWithDevice:device
endpoint:1
queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeAttributeListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) {
NSLog(@"Read the global attribute: AttributeList Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
[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, 305414945);
[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_1_000002_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"read the optional attribute: Tolerance"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestTemperatureMeasurement * cluster = [[CHIPTestTemperatureMeasurement alloc] initWithDevice:device
endpoint:1
queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeToleranceWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"read the optional attribute: Tolerance Error: %@", err);
if (err.domain == MatterInteractionErrorDomain && err.code == MatterInteractionErrorCodeUnsupportedAttribute) {
[expectation fulfill];
return;
}
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
if (actualValue != nil) {
XCTAssertGreaterThanOrEqual([actualValue unsignedShortValue], 0U);
}
}
{
id actualValue = value;
if (actualValue != nil) {
XCTAssertLessThanOrEqual([actualValue unsignedShortValue], 2048U);
}
}
[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, 305414945);
[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, 305414945);
[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 global attribute: AttributeList"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestThermostat * cluster = [[CHIPTestThermostat alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeAttributeListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) {
NSLog(@"Read the global attribute: AttributeList Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_TSTAT_1_1_000004_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, 305414945);
[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;
if (actualValue != nil) {
XCTAssertGreaterThanOrEqual([actualValue shortValue], 700);
}
}
{
id actualValue = value;
if (actualValue != nil) {
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;
if (actualValue != nil) {
XCTAssertGreaterThanOrEqual([actualValue shortValue], 700);
}
}
{
id actualValue = value;
if (actualValue != nil) {
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;
if (actualValue != nil) {
XCTAssertGreaterThanOrEqual([actualValue shortValue], 1600);
}
}
{
id actualValue = value;
if (actualValue != nil) {
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;
if (actualValue != nil) {
XCTAssertGreaterThanOrEqual([actualValue shortValue], 1600);
}
}
{
id actualValue = value;
if (actualValue != nil) {
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;
if (actualValue != nil) {
XCTAssertGreaterThanOrEqual([actualValue shortValue], 1600);
}
}
{
id actualValue = value;
if (actualValue != nil) {
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;
if (actualValue != nil) {
XCTAssertGreaterThanOrEqual([actualValue shortValue], 700);
}
}
{
id actualValue = value;
if (actualValue != nil) {
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;
if (actualValue != nil) {
XCTAssertGreaterThanOrEqual([actualValue shortValue], 700);
}
}
{
id actualValue = value;
if (actualValue != nil) {
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;
if (actualValue != nil) {
XCTAssertGreaterThanOrEqual([actualValue shortValue], 700);
}
}
{
id actualValue = value;
if (actualValue != nil) {
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;
if (actualValue != nil) {
XCTAssertGreaterThanOrEqual([actualValue shortValue], 1600);
}
}
{
id actualValue = value;
if (actualValue != nil) {
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;
if (actualValue != nil) {
XCTAssertGreaterThanOrEqual([actualValue shortValue], 1600);
}
}
{
id actualValue = value;
if (actualValue != nil) {
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;
if (actualValue != nil) {
XCTAssertGreaterThanOrEqual([actualValue unsignedCharValue], 0);
}
}
{
id actualValue = value;
if (actualValue != nil) {
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;
if (actualValue != nil) {
XCTAssertGreaterThanOrEqual([actualValue unsignedCharValue], 0);
}
}
{
id actualValue = value;
if (actualValue != nil) {
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);
if (err.domain == MatterInteractionErrorDomain && err.code == MatterInteractionErrorCodeUnsupportedAttribute) {
[expectation fulfill];
return;
}
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);
if (err.domain == MatterInteractionErrorDomain && err.code == MatterInteractionErrorCodeUnsupportedAttribute) {
[expectation fulfill];
return;
}
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
if (actualValue != nil) {
XCTAssertGreaterThanOrEqual([actualValue charValue], 0);
}
}
{
id actualValue = value;
if (actualValue != nil) {
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);
if (err.domain == MatterInteractionErrorDomain
&& err.code == MatterInteractionErrorCodeUnsupportedAttribute) {
[expectation fulfill];
return;
}
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);
if (err.domain == MatterInteractionErrorDomain && err.code == MatterInteractionErrorCodeUnsupportedAttribute) {
[expectation fulfill];
return;
}
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);
if (err.domain == MatterInteractionErrorDomain && err.code == MatterInteractionErrorCodeUnsupportedAttribute) {
[expectation fulfill];
return;
}
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
if (actualValue != nil) {
XCTAssertGreaterThanOrEqual([actualValue unsignedCharValue], 0);
}
}
{
id actualValue = value;
if (actualValue != nil) {
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);
if (err.domain == MatterInteractionErrorDomain
&& err.code == MatterInteractionErrorCodeUnsupportedAttribute) {
[expectation fulfill];
return;
}
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);
if (err.domain == MatterInteractionErrorDomain && err.code == MatterInteractionErrorCodeUnsupportedAttribute) {
[expectation fulfill];
return;
}
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);
if (err.domain == MatterInteractionErrorDomain && err.code == MatterInteractionErrorCodeUnsupportedAttribute) {
[expectation fulfill];
return;
}
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);
if (err.domain == MatterInteractionErrorDomain
&& err.code == MatterInteractionErrorCodeUnsupportedAttribute) {
[expectation fulfill];
return;
}
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);
if (err.domain == MatterInteractionErrorDomain && err.code == MatterInteractionErrorCodeUnsupportedAttribute) {
[expectation fulfill];
return;
}
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);
if (err.domain == MatterInteractionErrorDomain
&& err.code == MatterInteractionErrorCodeUnsupportedAttribute) {
[expectation fulfill];
return;
}
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, 305414945);
[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);
}
{
id actualValue = value;
if (actualValue != nil) {
XCTAssertGreaterThanOrEqual([actualValue shortValue], 1600);
}
}
{
id actualValue = value;
if (actualValue != nil) {
XCTAssertLessThanOrEqual([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);
}
{
id actualValue = value;
if (actualValue != nil) {
XCTAssertGreaterThanOrEqual([actualValue shortValue], 700);
}
}
{
id actualValue = value;
if (actualValue != nil) {
XCTAssertLessThanOrEqual([actualValue shortValue], 3000);
}
}
[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);
}
{
id actualValue = value;
if (actualValue != nil) {
XCTAssertGreaterThanOrEqual([actualValue shortValue], 700);
}
}
{
id actualValue = value;
if (actualValue != nil) {
XCTAssertLessThanOrEqual([actualValue shortValue], 3000);
}
}
[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);
}
{
id actualValue = value;
if (actualValue != nil) {
XCTAssertGreaterThanOrEqual([actualValue shortValue], 700);
}
}
{
id actualValue = value;
if (actualValue != nil) {
XCTAssertLessThanOrEqual([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);
}
{
id actualValue = value;
if (actualValue != nil) {
XCTAssertGreaterThanOrEqual([actualValue shortValue], 1600);
}
}
{
id actualValue = value;
if (actualValue != nil) {
XCTAssertLessThanOrEqual([actualValue shortValue], 3200);
}
}
[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);
}
{
id actualValue = value;
if (actualValue != nil) {
XCTAssertGreaterThanOrEqual([actualValue shortValue], 1600);
}
}
{
id actualValue = value;
if (actualValue != nil) {
XCTAssertLessThanOrEqual([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);
}
{
id actualValue = value;
if (actualValue != nil) {
XCTAssertGreaterThanOrEqual([actualValue unsignedCharValue], 0);
}
}
{
id actualValue = value;
if (actualValue != nil) {
XCTAssertLessThanOrEqual([actualValue unsignedCharValue], 5);
}
}
[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, 305414945);
[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_1_1_000003_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Read the global attribute: AttributeList"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestThermostatUserInterfaceConfiguration * cluster =
[[CHIPTestThermostatUserInterfaceConfiguration alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeAttributeListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) {
NSLog(@"Read the global attribute: AttributeList Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
[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, 305414945);
[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, 305414945);
[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_DIAG_TH_NW_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, 305414945);
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_DIAG_TH_NW_1_1_000001_ResetCounts
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Sends ResetCounts command"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestThreadNetworkDiagnostics * cluster = [[CHIPTestThreadNetworkDiagnostics alloc] initWithDevice:device
endpoint:0
queue:queue];
XCTAssertNotNil(cluster);
[cluster resetCountsWithCompletionHandler:^(NSError * _Nullable err) {
NSLog(@"Sends ResetCounts command Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_DIAG_TH_NW_1_1_000002_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Read the Overruncount attribute"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestThreadNetworkDiagnostics * cluster = [[CHIPTestThreadNetworkDiagnostics alloc] initWithDevice:device
endpoint:0
queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeOverrunCountWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"Read the Overruncount attribute Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertEqual([actualValue unsignedLongLongValue], 0ULL);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_WIFIDIAG_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, 305414945);
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_WIFIDIAG_1_1_000001_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Reads NetworkInterface structure attribute from DUT"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestGeneralDiagnostics * cluster = [[CHIPTestGeneralDiagnostics alloc] initWithDevice:device endpoint:0 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeNetworkInterfacesWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) {
NSLog(@"Reads NetworkInterface structure attribute from DUT Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_WIFIDIAG_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, 305414945);
[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, 305414945);
[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;
if (actualValue != nil) {
XCTAssertGreaterThanOrEqual([actualValue unsignedShortValue], 5U);
}
}
{
id actualValue = value;
if (actualValue != nil) {
XCTAssertLessThanOrEqual([actualValue unsignedShortValue], 200U);
}
}
[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;
if (actualValue != nil) {
XCTAssertNotEqual([actualValue unsignedShortValue], 201U);
}
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_WNCV_1_1_000004_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Read the global attribute: AttributeList"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestWindowCovering * cluster = [[CHIPTestWindowCovering alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeAttributeListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) {
NSLog(@"Read the global attribute: AttributeList Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_WNCV_1_1_000005_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;
if (actualValue != nil) {
XCTAssertGreaterThanOrEqual([actualValue unsignedIntValue], 0UL);
}
}
{
id actualValue = value;
if (actualValue != nil) {
XCTAssertLessThanOrEqual([actualValue unsignedIntValue], 32768UL);
}
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_WNCV_1_1_000006_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_000007_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;
if (actualValue != nil) {
XCTAssertNotEqual([actualValue unsignedIntValue], 32769UL);
}
}
[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, 305414945);
[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;
if (actualValue != nil) {
XCTAssertGreaterThanOrEqual([actualValue unsignedCharValue], 0);
}
}
{
id actualValue = value;
if (actualValue != nil) {
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;
if (actualValue != nil) {
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;
if (actualValue != nil) {
XCTAssertGreaterThanOrEqual([actualValue unsignedCharValue], 0);
}
}
{
id actualValue = value;
if (actualValue != nil) {
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;
if (actualValue != nil) {
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;
if (actualValue != nil) {
XCTAssertGreaterThanOrEqual([actualValue unsignedCharValue], 0);
}
}
{
id actualValue = value;
if (actualValue != nil) {
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;
if (actualValue != nil) {
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;
if (actualValue != nil) {
XCTAssertGreaterThanOrEqual([actualValue unsignedCharValue], 0);
}
}
{
id actualValue = value;
if (actualValue != nil) {
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;
if (actualValue != nil) {
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;
if (actualValue != nil) {
XCTAssertGreaterThanOrEqual([actualValue unsignedCharValue], 0);
}
}
{
id actualValue = value;
if (actualValue != nil) {
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;
if (actualValue != nil) {
XCTAssertGreaterThanOrEqual([actualValue unsignedShortValue], 0U);
}
}
{
id actualValue = value;
if (actualValue != nil) {
XCTAssertLessThanOrEqual([actualValue unsignedShortValue], 10000U);
}
}
[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;
if (actualValue != nil) {
XCTAssertNotEqual([actualValue unsignedShortValue], 20000U);
}
}
[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;
if (actualValue != nil) {
XCTAssertGreaterThanOrEqual([actualValue unsignedShortValue], 0U);
}
}
{
id actualValue = value;
if (actualValue != nil) {
XCTAssertLessThanOrEqual([actualValue unsignedShortValue], 10000U);
}
}
[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;
if (actualValue != nil) {
XCTAssertNotEqual([actualValue unsignedShortValue], 20000U);
}
}
[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;
if (actualValue != nil) {
XCTAssertGreaterThanOrEqual([actualValue unsignedShortValue], 0U);
}
}
{
id actualValue = value;
if (actualValue != nil) {
XCTAssertLessThanOrEqual([actualValue unsignedShortValue], 10000U);
}
}
[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;
if (actualValue != nil) {
XCTAssertNotEqual([actualValue unsignedShortValue], 20000U);
}
}
[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;
if (actualValue != nil) {
XCTAssertGreaterThanOrEqual([actualValue unsignedShortValue], 0U);
}
}
{
id actualValue = value;
if (actualValue != nil) {
XCTAssertLessThanOrEqual([actualValue unsignedShortValue], 10000U);
}
}
[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;
if (actualValue != nil) {
XCTAssertNotEqual([actualValue unsignedShortValue], 20000U);
}
}
[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;
if (actualValue != nil) {
XCTAssertGreaterThanOrEqual([actualValue unsignedShortValue], 0U);
}
}
{
id actualValue = value;
if (actualValue != nil) {
XCTAssertLessThanOrEqual([actualValue unsignedShortValue], 65535U);
}
}
[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;
if (actualValue != nil) {
XCTAssertGreaterThanOrEqual([actualValue unsignedShortValue], 0U);
}
}
{
id actualValue = value;
if (actualValue != nil) {
XCTAssertLessThanOrEqual([actualValue unsignedShortValue], 65535U);
}
}
[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;
if (actualValue != nil) {
XCTAssertGreaterThanOrEqual([actualValue unsignedShortValue], 0U);
}
}
{
id actualValue = value;
if (actualValue != nil) {
XCTAssertLessThanOrEqual([actualValue unsignedShortValue], 65535U);
}
}
[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;
if (actualValue != nil) {
XCTAssertGreaterThanOrEqual([actualValue unsignedShortValue], 0U);
}
}
{
id actualValue = value;
if (actualValue != nil) {
XCTAssertLessThanOrEqual([actualValue unsignedShortValue], 65535U);
}
}
[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;
if (actualValue != nil) {
XCTAssertGreaterThanOrEqual([actualValue unsignedShortValue], 0U);
}
}
{
id actualValue = value;
if (actualValue != nil) {
XCTAssertLessThanOrEqual([actualValue unsignedShortValue], 65535U);
}
}
[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;
if (actualValue != nil) {
XCTAssertGreaterThanOrEqual([actualValue unsignedShortValue], 0U);
}
}
{
id actualValue = value;
if (actualValue != nil) {
XCTAssertLessThanOrEqual([actualValue unsignedShortValue], 65535U);
}
}
[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;
if (actualValue != nil) {
XCTAssertGreaterThanOrEqual([actualValue unsignedShortValue], 0U);
}
}
{
id actualValue = value;
if (actualValue != nil) {
XCTAssertLessThanOrEqual([actualValue unsignedShortValue], 65535U);
}
}
[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;
if (actualValue != nil) {
XCTAssertGreaterThanOrEqual([actualValue unsignedShortValue], 0U);
}
}
{
id actualValue = value;
if (actualValue != nil) {
XCTAssertLessThanOrEqual([actualValue unsignedShortValue], 65535U);
}
}
[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;
if (actualValue != nil) {
XCTAssertGreaterThanOrEqual([actualValue unsignedShortValue], 0U);
}
}
{
id actualValue = value;
if (actualValue != nil) {
XCTAssertLessThanOrEqual([actualValue unsignedShortValue], 2047U);
}
}
[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;
if (actualValue != nil) {
XCTAssertNotEqual([actualValue unsignedShortValue], 4096U);
}
}
[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;
if (actualValue != nil) {
XCTAssertGreaterThanOrEqual([actualValue unsignedShortValue], 0U);
}
}
{
id actualValue = value;
if (actualValue != nil) {
XCTAssertLessThanOrEqual([actualValue unsignedShortValue], 65535U);
}
}
[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;
if (actualValue != nil) {
XCTAssertGreaterThanOrEqual([actualValue unsignedShortValue], 0U);
}
}
{
id actualValue = value;
if (actualValue != nil) {
XCTAssertLessThanOrEqual([actualValue unsignedShortValue], 65535U);
}
}
[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;
if (actualValue != nil) {
XCTAssertGreaterThanOrEqual([actualValue unsignedShortValue], 0U);
}
}
{
id actualValue = value;
if (actualValue != nil) {
XCTAssertLessThanOrEqual([actualValue unsignedShortValue], 65535U);
}
}
[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;
if (actualValue != nil) {
XCTAssertGreaterThanOrEqual([actualValue unsignedShortValue], 0U);
}
}
{
id actualValue = value;
if (actualValue != nil) {
XCTAssertLessThanOrEqual([actualValue unsignedShortValue], 65535U);
}
}
[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;
if (actualValue != nil) {
XCTAssertGreaterThanOrEqual([actualValue unsignedCharValue], 0);
}
}
{
id actualValue = value;
if (actualValue != nil) {
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;
if (actualValue != nil) {
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;
if (actualValue != nil) {
XCTAssertGreaterThanOrEqual([actualValue unsignedCharValue], 0);
}
}
{
id actualValue = value;
if (actualValue != nil) {
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;
if (actualValue != nil) {
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, 305414945);
[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, 305414945);
[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;
if (actualValue != nil) {
XCTAssertGreaterThanOrEqual([actualValue unsignedCharValue], 0);
}
}
{
id actualValue = value;
if (actualValue != nil) {
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, 305414945);
[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;
if (actualValue != nil) {
XCTAssertGreaterThanOrEqual([actualValue unsignedCharValue], 0);
}
}
{
id actualValue = value;
if (actualValue != nil) {
XCTAssertLessThanOrEqual([actualValue unsignedCharValue], 23);
}
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_WNCV_3_4_000000_WaitForCommissionee
{
XCTestExpectation * expectation = [self expectationWithDescription:@"0: Wait for the commissioned device to be retrieved"];
dispatch_queue_t queue = dispatch_get_main_queue();
WaitForCommissionee(expectation, queue, 305414945);
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_WNCV_3_4_000001_DownOrClose
{
XCTestExpectation * expectation =
[self expectationWithDescription:@"1a: TH sends DownOrClose command to preposition the DUT in the opposite direction"];
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 sends DownOrClose command to preposition the DUT in the opposite direction Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_WNCV_3_4_000002_WaitForMs
{
XCTestExpectation * expectation =
[self expectationWithDescription:@"1b: TH Waits for fastMotionDuration seconds movement(s) on the device"];
dispatch_queue_t queue = dispatch_get_main_queue();
WaitForMs(expectation, queue, 3000);
[self waitForExpectationsWithTimeout:(3000 / 1000) + kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_WNCV_3_4_000003_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_4_000004_WaitForMs
{
XCTestExpectation * expectation =
[self expectationWithDescription:@"2b: TH Waits for fullMotionDuration seconds movement(s) on the device"];
dispatch_queue_t queue = dispatch_get_main_queue();
WaitForMs(expectation, queue, 6000);
[self waitForExpectationsWithTimeout:(6000 / 1000) + kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_WNCV_3_4_000005_ReadAttribute
{
XCTestExpectation * expectation =
[self expectationWithDescription:@"3a: If (PA & LF) TH reads CurrentPositionLiftPercent100ths 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
readAttributeCurrentPositionLiftPercent100thsWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"3a: If (PA & LF) TH reads CurrentPositionLiftPercent100ths attribute from DUT Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertFalse(actualValue == nil);
XCTAssertEqual([actualValue unsignedShortValue], 0U);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_WNCV_3_4_000006_ReadAttribute
{
XCTestExpectation * expectation =
[self expectationWithDescription:@"3b: If (PA & LF) TH reads CurrentPositionLiftPercentage optional 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
readAttributeCurrentPositionLiftPercentageWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"3b: If (PA & LF) TH reads CurrentPositionLiftPercentage optional attribute from DUT Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertFalse(actualValue == nil);
XCTAssertEqual([actualValue unsignedCharValue], 0);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_WNCV_3_4_000007_ReadAttribute
{
XCTestExpectation * expectation =
[self expectationWithDescription:@"3c: If (PA & TL) TH reads CurrentPositionTiltPercent100ths 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
readAttributeCurrentPositionTiltPercent100thsWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"3c: If (PA & TL) TH reads CurrentPositionTiltPercent100ths attribute from DUT Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertFalse(actualValue == nil);
XCTAssertEqual([actualValue unsignedShortValue], 0U);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_WNCV_3_4_000008_ReadAttribute
{
XCTestExpectation * expectation =
[self expectationWithDescription:@"3d: If (PA & TL) TH reads CurrentPositionTiltPercentage optional 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
readAttributeCurrentPositionTiltPercentageWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"3d: If (PA & TL) TH reads CurrentPositionTiltPercentage optional attribute from DUT Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertFalse(actualValue == nil);
XCTAssertEqual([actualValue unsignedCharValue], 0);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_WNCV_3_5_000000_WaitForCommissionee
{
XCTestExpectation * expectation = [self expectationWithDescription:@"0: Wait for the commissioned device to be retrieved"];
dispatch_queue_t queue = dispatch_get_main_queue();
WaitForCommissionee(expectation, queue, 305414945);
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_WNCV_3_5_000001_UpOrOpen
{
XCTestExpectation * expectation =
[self expectationWithDescription:@"1a: TH sends UpOrOpen command to preposition the DUT in the opposite direction"];
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 sends UpOrOpen command to preposition the DUT in the opposite direction Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_WNCV_3_5_000002_WaitForMs
{
XCTestExpectation * expectation =
[self expectationWithDescription:@"1b: TH Waits for fastMotionDuration seconds movement(s) on the device"];
dispatch_queue_t queue = dispatch_get_main_queue();
WaitForMs(expectation, queue, 3000);
[self waitForExpectationsWithTimeout:(3000 / 1000) + kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_WNCV_3_5_000003_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_5_000004_WaitForMs
{
XCTestExpectation * expectation =
[self expectationWithDescription:@"2b: TH Waits for fullMotionDuration seconds movement(s) on the device"];
dispatch_queue_t queue = dispatch_get_main_queue();
WaitForMs(expectation, queue, 6000);
[self waitForExpectationsWithTimeout:(6000 / 1000) + kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_WNCV_3_5_000005_ReadAttribute
{
XCTestExpectation * expectation =
[self expectationWithDescription:@"3a: If (PA & LF) TH reads CurrentPositionLiftPercent100ths 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
readAttributeCurrentPositionLiftPercent100thsWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"3a: If (PA & LF) TH reads CurrentPositionLiftPercent100ths attribute from DUT Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertFalse(actualValue == nil);
XCTAssertEqual([actualValue unsignedShortValue], 10000U);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_WNCV_3_5_000006_ReadAttribute
{
XCTestExpectation * expectation =
[self expectationWithDescription:@"3b: If (PA & LF) TH reads CurrentPositionLiftPercentage optional 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
readAttributeCurrentPositionLiftPercentageWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"3b: If (PA & LF) TH reads CurrentPositionLiftPercentage optional attribute from DUT Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertFalse(actualValue == nil);
XCTAssertEqual([actualValue unsignedCharValue], 100);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_WNCV_3_5_000007_ReadAttribute
{
XCTestExpectation * expectation =
[self expectationWithDescription:@"3c: If (PA & TL) TH reads CurrentPositionTiltPercent100ths 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
readAttributeCurrentPositionTiltPercent100thsWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"3c: If (PA & TL) TH reads CurrentPositionTiltPercent100ths attribute from DUT Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertFalse(actualValue == nil);
XCTAssertEqual([actualValue unsignedShortValue], 10000U);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_WNCV_3_5_000008_ReadAttribute
{
XCTestExpectation * expectation =
[self expectationWithDescription:@"3d: If (PA & TL) TH reads CurrentPositionTiltPercentage optional 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
readAttributeCurrentPositionTiltPercentageWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"3d: If (PA & TL) TH reads CurrentPositionTiltPercentage optional attribute from DUT Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertFalse(actualValue == nil);
XCTAssertEqual([actualValue unsignedCharValue], 100);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_WNCV_4_3_000000_WaitForCommissionee
{
XCTestExpectation * expectation = [self expectationWithDescription:@"0: Wait for the commissioned device to be retrieved"];
dispatch_queue_t queue = dispatch_get_main_queue();
WaitForCommissionee(expectation, queue, 305414945);
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
NSNumber * _Nullable attrCurrentPositionLiftPercent100ths;
- (void)testSendClusterTest_TC_WNCV_4_3_000001_ReadAttribute
{
XCTestExpectation * expectation =
[self expectationWithDescription:@"1a: If (PA_LF & LF) TH reads CurrentPositionLiftPercent100ths 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
readAttributeCurrentPositionLiftPercent100thsWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"1a: If (PA_LF & LF) TH reads CurrentPositionLiftPercent100ths from DUT Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
if (actualValue != nil) {
XCTAssertGreaterThanOrEqual([actualValue unsignedShortValue], 0U);
}
}
{
id actualValue = value;
if (actualValue != nil) {
XCTAssertLessThanOrEqual([actualValue unsignedShortValue], 10000U);
}
}
{
id actualValue = value;
attrCurrentPositionLiftPercent100ths = actualValue;
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
NSNumber * _Nullable attrCurrentPositionLiftPercentage;
- (void)testSendClusterTest_TC_WNCV_4_3_000002_ReadAttribute
{
XCTestExpectation * expectation =
[self expectationWithDescription:@"1b: If (PA_LF & LF) TH reads CurrentPositionLiftPercentage 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
readAttributeCurrentPositionLiftPercentageWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"1b: If (PA_LF & LF) TH reads CurrentPositionLiftPercentage from DUT Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
if (actualValue != nil) {
XCTAssertGreaterThanOrEqual([actualValue unsignedCharValue], 0);
}
}
{
id actualValue = value;
if (actualValue != nil) {
XCTAssertLessThanOrEqual([actualValue unsignedCharValue], 100);
}
}
{
id actualValue = value;
attrCurrentPositionLiftPercentage = actualValue;
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_WNCV_4_3_000003_GoToLiftPercentage
{
XCTestExpectation * expectation =
[self expectationWithDescription:@"2b: TH sends GoToLiftPercentage command with BadParam 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);
__auto_type * params = [[CHIPWindowCoveringClusterGoToLiftPercentageParams alloc] init];
params.liftPercentageValue = [NSNumber numberWithUnsignedChar:63];
params.liftPercent100thsValue = [NSNumber numberWithUnsignedShort:12288U];
[cluster goToLiftPercentageWithParams:params
completionHandler:^(NSError * _Nullable err) {
NSLog(@"2b: TH sends GoToLiftPercentage command with BadParam to DUT Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], EMBER_ZCL_STATUS_CONSTRAINT_ERROR);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_WNCV_4_3_000004_GoToLiftPercentage
{
XCTestExpectation * expectation =
[self expectationWithDescription:@"3a: TH sends GoToLiftPercentage command with 10001 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);
__auto_type * params = [[CHIPWindowCoveringClusterGoToLiftPercentageParams alloc] init];
params.liftPercentageValue = [NSNumber numberWithUnsignedChar:100];
params.liftPercent100thsValue = [NSNumber numberWithUnsignedShort:10001U];
[cluster goToLiftPercentageWithParams:params
completionHandler:^(NSError * _Nullable err) {
NSLog(@"3a: TH sends GoToLiftPercentage command with 10001 to DUT Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], EMBER_ZCL_STATUS_CONSTRAINT_ERROR);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_WNCV_4_3_000005_GoToLiftPercentage
{
XCTestExpectation * expectation =
[self expectationWithDescription:@"4a: TH sends GoToLiftPercentage command with 0xFFFF 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);
__auto_type * params = [[CHIPWindowCoveringClusterGoToLiftPercentageParams alloc] init];
params.liftPercentageValue = [NSNumber numberWithUnsignedChar:255];
params.liftPercent100thsValue = [NSNumber numberWithUnsignedShort:65535U];
[cluster goToLiftPercentageWithParams:params
completionHandler:^(NSError * _Nullable err) {
NSLog(@"4a: TH sends GoToLiftPercentage command with 0xFFFF to DUT Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], EMBER_ZCL_STATUS_CONSTRAINT_ERROR);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_WNCV_4_4_000000_WaitForCommissionee
{
XCTestExpectation * expectation = [self expectationWithDescription:@"0: Wait for the commissioned device to be retrieved"];
dispatch_queue_t queue = dispatch_get_main_queue();
WaitForCommissionee(expectation, queue, 305414945);
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
NSNumber * _Nullable attrCurrentPositionTiltPercent100ths;
- (void)testSendClusterTest_TC_WNCV_4_4_000001_ReadAttribute
{
XCTestExpectation * expectation =
[self expectationWithDescription:@"1a: If (PA_TL & TL) TH reads CurrentPositionTiltPercent100ths 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
readAttributeCurrentPositionTiltPercent100thsWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"1a: If (PA_TL & TL) TH reads CurrentPositionTiltPercent100ths from DUT Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
if (actualValue != nil) {
XCTAssertGreaterThanOrEqual([actualValue unsignedShortValue], 0U);
}
}
{
id actualValue = value;
if (actualValue != nil) {
XCTAssertLessThanOrEqual([actualValue unsignedShortValue], 10000U);
}
}
{
id actualValue = value;
attrCurrentPositionTiltPercent100ths = actualValue;
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
NSNumber * _Nullable attrCurrentPositionTiltPercentage;
- (void)testSendClusterTest_TC_WNCV_4_4_000002_ReadAttribute
{
XCTestExpectation * expectation =
[self expectationWithDescription:@"1b: If (PA_TL & TL) TH reads CurrentPositionTiltPercentage 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
readAttributeCurrentPositionTiltPercentageWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"1b: If (PA_TL & TL) TH reads CurrentPositionTiltPercentage from DUT Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
if (actualValue != nil) {
XCTAssertGreaterThanOrEqual([actualValue unsignedCharValue], 0);
}
}
{
id actualValue = value;
if (actualValue != nil) {
XCTAssertLessThanOrEqual([actualValue unsignedCharValue], 100);
}
}
{
id actualValue = value;
attrCurrentPositionTiltPercentage = actualValue;
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_WNCV_4_4_000003_GoToTiltPercentage
{
XCTestExpectation * expectation =
[self expectationWithDescription:@"2b: TH sends GoToTiltPercentage command with BadParam 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);
__auto_type * params = [[CHIPWindowCoveringClusterGoToTiltPercentageParams alloc] init];
params.tiltPercentageValue = [NSNumber numberWithUnsignedChar:63];
params.tiltPercent100thsValue = [NSNumber numberWithUnsignedShort:12288U];
[cluster goToTiltPercentageWithParams:params
completionHandler:^(NSError * _Nullable err) {
NSLog(@"2b: TH sends GoToTiltPercentage command with BadParam to DUT Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], EMBER_ZCL_STATUS_CONSTRAINT_ERROR);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_WNCV_4_4_000004_GoToTiltPercentage
{
XCTestExpectation * expectation =
[self expectationWithDescription:@"3a: TH sends GoToTiltPercentage command with 10001 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);
__auto_type * params = [[CHIPWindowCoveringClusterGoToTiltPercentageParams alloc] init];
params.tiltPercentageValue = [NSNumber numberWithUnsignedChar:100];
params.tiltPercent100thsValue = [NSNumber numberWithUnsignedShort:10001U];
[cluster goToTiltPercentageWithParams:params
completionHandler:^(NSError * _Nullable err) {
NSLog(@"3a: TH sends GoToTiltPercentage command with 10001 to DUT Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], EMBER_ZCL_STATUS_CONSTRAINT_ERROR);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_WNCV_4_4_000005_GoToTiltPercentage
{
XCTestExpectation * expectation =
[self expectationWithDescription:@"4a: TH sends GoToTiltPercentage command with 0xFFFF 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);
__auto_type * params = [[CHIPWindowCoveringClusterGoToTiltPercentageParams alloc] init];
params.tiltPercentageValue = [NSNumber numberWithUnsignedChar:255];
params.tiltPercent100thsValue = [NSNumber numberWithUnsignedShort:65535U];
[cluster goToTiltPercentageWithParams:params
completionHandler:^(NSError * _Nullable err) {
NSLog(@"4a: TH sends GoToTiltPercentage command with 0xFFFF to DUT Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], EMBER_ZCL_STATUS_CONSTRAINT_ERROR);
[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, 305414945);
[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 with weird chars"];
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:"\x0d\x0a\xff\x22\xa0" length:5];
[cluster writeAttributeOctetStringWithValue:octetStringArgument
completionHandler:^(NSError * _Nullable err) {
NSLog(@"Write attribute OCTET_STRING with weird chars 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 with weird chars"];
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 weird chars Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertTrue([actualValue isEqualToData:[[NSData alloc] initWithBytes:"\x0d\x0a\xff\x22\xa0" length:5]]);
}
[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:"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_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:"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_000115_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_000116_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_000117_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_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:"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_000119_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_000120_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_000121_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_000122_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_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 - 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_000125_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_000126_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_000127_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_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 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_000130_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_000131_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute LIST_LONG_OCTET_STRING (for chunked read)"];
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 (for chunked read) 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_000132_WriteAttribute
{
XCTestExpectation * expectation =
[self expectationWithDescription:@"Write attribute LIST_LONG_OCTET_STRING (for chunked write)"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
id listLongOctetStringArgument;
{
NSMutableArray * temp_0 = [[NSMutableArray alloc] init];
temp_0[0] = [[NSData alloc]
initWithBytes:"0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef01234567"
"89abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef"
"0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef01234567"
"89abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef"
"0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef"
length:512];
temp_0[1] = [[NSData alloc]
initWithBytes:"0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef01234567"
"89abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef"
"0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef01234567"
"89abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef"
"0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef"
length:512];
temp_0[2] = [[NSData alloc]
initWithBytes:"0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef01234567"
"89abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef"
"0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef01234567"
"89abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef"
"0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef"
length:512];
temp_0[3] = [[NSData alloc]
initWithBytes:"0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef01234567"
"89abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef"
"0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef01234567"
"89abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef"
"0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef"
length:512];
temp_0[4] = [[NSData alloc]
initWithBytes:"0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef01234567"
"89abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef"
"0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef01234567"
"89abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef"
"0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef"
length:512];
listLongOctetStringArgument = temp_0;
}
[cluster writeAttributeListLongOctetStringWithValue:listLongOctetStringArgument
completionHandler:^(NSError * _Nullable err) {
NSLog(@"Write attribute LIST_LONG_OCTET_STRING (for chunked write) Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTestCluster_000133_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute LIST_LONG_OCTET_STRING (for chunked read)"];
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 (for chunked read) Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertEqual([actualValue count], 5);
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]]);
XCTAssertTrue([actualValue[4]
isEqualToData:
[[NSData alloc]
initWithBytes:"0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789ab"
"cdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef01234567"
"89abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123"
"456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef"
"0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789ab"
"cdef0123456789abcdef0123456789abcdef0123456789abcdef"
length:512]]);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTestCluster_000134_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_000135_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_000136_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_000137_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_000138_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_000139_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_000140_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_000141_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_000142_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_000143_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_000144_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.domain == MatterInteractionErrorDomain && err.code == MatterInteractionErrorCodeUnsupportedAttribute) {
[expectation fulfill];
return;
}
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertEqual([actualValue boolValue], 0);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTestCluster_000145_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.domain == MatterInteractionErrorDomain
&& err.code == MatterInteractionErrorCodeUnsupportedAttribute) {
[expectation fulfill];
return;
}
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTestCluster_000146_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);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], EMBER_ZCL_STATUS_UNSUPPORTED_ENDPOINT);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTestCluster_000147_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);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], EMBER_ZCL_STATUS_UNSUPPORTED_CLUSTER);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTestCluster_000148_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_000149_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_000150_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_000151_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_000152_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_000153_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_000154_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_000155_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_000156_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_000157_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_000158_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_000159_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_000160_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_000161_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_000162_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_000163_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_000164_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_000165_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_000166_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_000167_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_000168_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_000169_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_000170_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_000171_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_000172_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_000173_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_000174_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_000175_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_000176_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Read list of structs containing nullables and optionals"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster
readAttributeListNullablesAndOptionalsStructWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) {
NSLog(@"Read list of structs containing nullables and optionals Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertEqual([actualValue count], 1);
XCTAssertTrue(((CHIPTestClusterClusterNullablesAndOptionalsStruct *) actualValue[0]).nullableInt == nil);
XCTAssertTrue(((CHIPTestClusterClusterNullablesAndOptionalsStruct *) actualValue[0]).nullableString == nil);
XCTAssertTrue(((CHIPTestClusterClusterNullablesAndOptionalsStruct *) actualValue[0]).nullableStruct == nil);
XCTAssertTrue(((CHIPTestClusterClusterNullablesAndOptionalsStruct *) actualValue[0]).nullableList == nil);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTestCluster_000177_WriteAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Write list of structs containing nullables and optionals"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
id listNullablesAndOptionalsStructArgument;
{
NSMutableArray * temp_0 = [[NSMutableArray alloc] init];
temp_0[0] = [[CHIPTestClusterClusterNullablesAndOptionalsStruct alloc] init];
((CHIPTestClusterClusterNullablesAndOptionalsStruct *) temp_0[0]).nullableInt = nil;
((CHIPTestClusterClusterNullablesAndOptionalsStruct *) temp_0[0]).nullableString = nil;
((CHIPTestClusterClusterNullablesAndOptionalsStruct *) temp_0[0]).nullableStruct = nil;
{
NSMutableArray * temp_3 = [[NSMutableArray alloc] init];
temp_3[0] = [NSNumber numberWithUnsignedChar:1];
temp_3[1] = [NSNumber numberWithUnsignedChar:2];
((CHIPTestClusterClusterNullablesAndOptionalsStruct *) temp_0[0]).nullableList = temp_3;
}
listNullablesAndOptionalsStructArgument = temp_0;
}
[cluster
writeAttributeListNullablesAndOptionalsStructWithValue:listNullablesAndOptionalsStructArgument
completionHandler:^(NSError * _Nullable err) {
NSLog(@"Write list of structs containing nullables and optionals Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTestCluster_000178_ReadAttribute
{
XCTestExpectation * expectation =
[self expectationWithDescription:@"Read list of structs containing nullables and optionals after writing"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster
readAttributeListNullablesAndOptionalsStructWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) {
NSLog(@"Read list of structs containing nullables and optionals after writing Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertEqual([actualValue count], 1);
XCTAssertTrue(((CHIPTestClusterClusterNullablesAndOptionalsStruct *) actualValue[0]).nullableInt == nil);
XCTAssertTrue(((CHIPTestClusterClusterNullablesAndOptionalsStruct *) actualValue[0]).nullableString == nil);
XCTAssertTrue(((CHIPTestClusterClusterNullablesAndOptionalsStruct *) actualValue[0]).nullableStruct == nil);
XCTAssertFalse(((CHIPTestClusterClusterNullablesAndOptionalsStruct *) actualValue[0]).nullableList == nil);
XCTAssertEqual([((CHIPTestClusterClusterNullablesAndOptionalsStruct *) actualValue[0]).nullableList count], 2);
XCTAssertEqual(
[((CHIPTestClusterClusterNullablesAndOptionalsStruct *) actualValue[0]).nullableList[0] unsignedCharValue], 1);
XCTAssertEqual(
[((CHIPTestClusterClusterNullablesAndOptionalsStruct *) actualValue[0]).nullableList[1] unsignedCharValue], 2);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTestCluster_000179_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_000180_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_000181_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_000182_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_000183_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_000184_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_000185_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_000186_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_000187_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_000188_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_000189_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_000190_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_000191_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_000192_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_000193_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_000194_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_000195_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_000196_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_000197_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_000198_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_000199_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_000200_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_000201_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_000202_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_000203_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_000204_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_000205_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_000206_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_000207_WriteAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Write attribute NULLABLE_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 nullableInt8uArgument;
nullableInt8uArgument = [NSNumber numberWithUnsignedChar:0];
[cluster writeAttributeNullableInt8uWithValue:nullableInt8uArgument
completionHandler:^(NSError * _Nullable err) {
NSLog(@"Write attribute NULLABLE_INT8U Min Value Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTestCluster_000208_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute NULLABLE_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 readAttributeNullableInt8uWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"Read attribute NULLABLE_INT8U Min Value Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertFalse(actualValue == nil);
XCTAssertEqual([actualValue unsignedCharValue], 0);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTestCluster_000209_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_000210_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_000211_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_000212_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_000213_ReadAttribute
{
XCTestExpectation * expectation =
[self expectationWithDescription:@"Read attribute NULLABLE_INT8U unchanged Value with constraint"];
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 with constraint Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertFalse(actualValue == nil);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTestCluster_000214_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_000215_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_000216_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute NULLABLE_INT8U null Value & range"];
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 & range Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
if (actualValue != nil) {
XCTAssertGreaterThanOrEqual([actualValue unsignedCharValue], 0);
}
}
{
id actualValue = value;
if (actualValue != nil) {
XCTAssertLessThanOrEqual([actualValue unsignedCharValue], 254);
}
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTestCluster_000217_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute NULLABLE_INT8U null Value & not"];
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 & not Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
if (actualValue != nil) {
XCTAssertNotEqual([actualValue unsignedCharValue], 254);
}
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTestCluster_000218_WriteAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Write attribute NULLABLE_INT8U 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:128];
[cluster writeAttributeNullableInt8uWithValue:nullableInt8uArgument
completionHandler:^(NSError * _Nullable err) {
NSLog(@"Write attribute NULLABLE_INT8U 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_INT8U Value in range"];
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 Value in range Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
if (actualValue != nil) {
XCTAssertGreaterThanOrEqual([actualValue unsignedCharValue], 0);
}
}
{
id actualValue = value;
if (actualValue != nil) {
XCTAssertLessThanOrEqual([actualValue unsignedCharValue], 254);
}
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTestCluster_000220_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute NULLABLE_INT8U notValue OK"];
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 notValue OK Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
if (actualValue != nil) {
XCTAssertNotEqual([actualValue unsignedCharValue], 129);
}
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTestCluster_000221_WriteAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Write attribute NULLABLE_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 nullableInt16uArgument;
nullableInt16uArgument = [NSNumber numberWithUnsignedShort:0U];
[cluster writeAttributeNullableInt16uWithValue:nullableInt16uArgument
completionHandler:^(NSError * _Nullable err) {
NSLog(@"Write attribute NULLABLE_INT16U Min Value Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTestCluster_000222_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute NULLABLE_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 readAttributeNullableInt16uWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"Read attribute NULLABLE_INT16U Min Value Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertFalse(actualValue == nil);
XCTAssertEqual([actualValue unsignedShortValue], 0U);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTestCluster_000223_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_000224_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_000225_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_000226_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_000227_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_000228_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_000229_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute NULLABLE_INT16U null Value & range"];
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 & range Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
if (actualValue != nil) {
XCTAssertGreaterThanOrEqual([actualValue unsignedShortValue], 0U);
}
}
{
id actualValue = value;
if (actualValue != nil) {
XCTAssertLessThanOrEqual([actualValue unsignedShortValue], 65534U);
}
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTestCluster_000230_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute NULLABLE_INT16U null Value & not"];
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 & not Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
if (actualValue != nil) {
XCTAssertNotEqual([actualValue unsignedShortValue], 65534U);
}
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTestCluster_000231_WriteAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Write attribute NULLABLE_INT16U 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:32000U];
[cluster writeAttributeNullableInt16uWithValue:nullableInt16uArgument
completionHandler:^(NSError * _Nullable err) {
NSLog(@"Write attribute NULLABLE_INT16U Value Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTestCluster_000232_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute NULLABLE_INT16U Value in range"];
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 Value in range Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
if (actualValue != nil) {
XCTAssertGreaterThanOrEqual([actualValue unsignedShortValue], 0U);
}
}
{
id actualValue = value;
if (actualValue != nil) {
XCTAssertLessThanOrEqual([actualValue unsignedShortValue], 65534U);
}
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTestCluster_000233_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute NULLABLE_INT16U notValue OK"];
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 notValue OK Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
if (actualValue != nil) {
XCTAssertNotEqual([actualValue unsignedShortValue], 32001U);
}
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTestCluster_000234_WriteAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Write attribute NULLABLE_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 nullableInt32uArgument;
nullableInt32uArgument = [NSNumber numberWithUnsignedInt:0UL];
[cluster writeAttributeNullableInt32uWithValue:nullableInt32uArgument
completionHandler:^(NSError * _Nullable err) {
NSLog(@"Write attribute NULLABLE_INT32U Min 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_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 readAttributeNullableInt32uWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"Read attribute NULLABLE_INT32U Min Value Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertFalse(actualValue == nil);
XCTAssertEqual([actualValue unsignedIntValue], 0UL);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTestCluster_000236_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_000237_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_000238_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_000239_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_000240_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_000241_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_000242_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute NULLABLE_INT32U null Value & range"];
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 & range Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
if (actualValue != nil) {
XCTAssertGreaterThanOrEqual([actualValue unsignedIntValue], 0UL);
}
}
{
id actualValue = value;
if (actualValue != nil) {
XCTAssertLessThanOrEqual([actualValue unsignedIntValue], 4294967294UL);
}
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTestCluster_000243_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute NULLABLE_INT32U null Value & not"];
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 & not Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
if (actualValue != nil) {
XCTAssertNotEqual([actualValue unsignedIntValue], 4294967294UL);
}
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTestCluster_000244_WriteAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Write attribute NULLABLE_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 nullableInt32uArgument;
nullableInt32uArgument = [NSNumber numberWithUnsignedInt:2147483647UL];
[cluster writeAttributeNullableInt32uWithValue:nullableInt32uArgument
completionHandler:^(NSError * _Nullable err) {
NSLog(@"Write attribute NULLABLE_INT32U Value Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTestCluster_000245_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute NULLABLE_INT32U Value in range"];
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 Value in range Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
if (actualValue != nil) {
XCTAssertGreaterThanOrEqual([actualValue unsignedIntValue], 0UL);
}
}
{
id actualValue = value;
if (actualValue != nil) {
XCTAssertLessThanOrEqual([actualValue unsignedIntValue], 4294967294UL);
}
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTestCluster_000246_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute NULLABLE_INT32U notValue OK"];
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 notValue OK Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
if (actualValue != nil) {
XCTAssertNotEqual([actualValue unsignedIntValue], 2147483648UL);
}
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTestCluster_000247_WriteAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Write attribute NULLABLE_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 nullableInt64uArgument;
nullableInt64uArgument = [NSNumber numberWithUnsignedLongLong:0ULL];
[cluster writeAttributeNullableInt64uWithValue:nullableInt64uArgument
completionHandler:^(NSError * _Nullable err) {
NSLog(@"Write attribute NULLABLE_INT64U Min Value Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTestCluster_000248_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute NULLABLE_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 readAttributeNullableInt64uWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"Read attribute NULLABLE_INT64U Min Value Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertFalse(actualValue == nil);
XCTAssertEqual([actualValue unsignedLongLongValue], 0ULL);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTestCluster_000249_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_000250_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_000251_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_000252_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_000253_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_000254_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_000255_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute NULLABLE_INT64U null Value & range"];
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 & range Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
if (actualValue != nil) {
XCTAssertGreaterThanOrEqual([actualValue unsignedLongLongValue], 0ULL);
}
}
{
id actualValue = value;
if (actualValue != nil) {
XCTAssertLessThanOrEqual([actualValue unsignedLongLongValue], 18446744073709551614ULL);
}
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTestCluster_000256_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute NULLABLE_INT64U null Value & not"];
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 & not Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
if (actualValue != nil) {
XCTAssertNotEqual([actualValue unsignedLongLongValue], 18446744073709551614ULL);
}
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTestCluster_000257_WriteAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Write attribute NULLABLE_INT64U 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:18000000000000000000ULL];
[cluster writeAttributeNullableInt64uWithValue:nullableInt64uArgument
completionHandler:^(NSError * _Nullable err) {
NSLog(@"Write attribute NULLABLE_INT64U Value Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTestCluster_000258_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute NULLABLE_INT64U Value in range"];
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 Value in range Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
if (actualValue != nil) {
XCTAssertGreaterThanOrEqual([actualValue unsignedLongLongValue], 0ULL);
}
}
{
id actualValue = value;
if (actualValue != nil) {
XCTAssertLessThanOrEqual([actualValue unsignedLongLongValue], 18446744073709551614ULL);
}
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTestCluster_000259_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute NULLABLE_INT64U notValue OK"];
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 notValue OK Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
if (actualValue != nil) {
XCTAssertNotEqual([actualValue unsignedLongLongValue], 18000000000000000001ULL);
}
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTestCluster_000260_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_000261_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_000262_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_000263_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_000264_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_000265_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_000266_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute NULLABLE_INT8S null Value & range"];
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 & range Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
if (actualValue != nil) {
XCTAssertGreaterThanOrEqual([actualValue charValue], -127);
}
}
{
id actualValue = value;
if (actualValue != nil) {
XCTAssertLessThanOrEqual([actualValue charValue], 127);
}
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTestCluster_000267_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute NULLABLE_INT8S null Value & not"];
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 & not Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
if (actualValue != nil) {
XCTAssertNotEqual([actualValue charValue], -127);
}
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTestCluster_000268_WriteAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Write attribute NULLABLE_INT8S 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 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_INT8S Value in range"];
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 Value in range Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
if (actualValue != nil) {
XCTAssertGreaterThanOrEqual([actualValue charValue], -127);
}
}
{
id actualValue = value;
if (actualValue != nil) {
XCTAssertLessThanOrEqual([actualValue charValue], 127);
}
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTestCluster_000270_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute NULLABLE_INT8S notValue OK"];
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 notValue OK Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
if (actualValue != nil) {
XCTAssertNotEqual([actualValue charValue], -126);
}
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTestCluster_000271_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_000272_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_000273_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_000274_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_000275_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_000276_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_000277_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute NULLABLE_INT16S null Value & range"];
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 & range Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
if (actualValue != nil) {
XCTAssertGreaterThanOrEqual([actualValue shortValue], -32767);
}
}
{
id actualValue = value;
if (actualValue != nil) {
XCTAssertLessThanOrEqual([actualValue shortValue], 32767);
}
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTestCluster_000278_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute NULLABLE_INT16S null Value & not"];
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 & not Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
if (actualValue != nil) {
XCTAssertNotEqual([actualValue shortValue], -32767);
}
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTestCluster_000279_WriteAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Write attribute NULLABLE_INT16S 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 Value Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTestCluster_000280_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute NULLABLE_INT16S Value in range"];
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 Value in range Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
if (actualValue != nil) {
XCTAssertGreaterThanOrEqual([actualValue shortValue], -32767);
}
}
{
id actualValue = value;
if (actualValue != nil) {
XCTAssertLessThanOrEqual([actualValue shortValue], 32767);
}
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTestCluster_000281_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute NULLABLE_INT16S notValue OK"];
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 notValue OK Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
if (actualValue != nil) {
XCTAssertNotEqual([actualValue shortValue], -32766);
}
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTestCluster_000282_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_000283_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_000284_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_000285_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_000286_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_000287_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_000288_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute NULLABLE_INT32S null Value & range"];
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 & range Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
if (actualValue != nil) {
XCTAssertGreaterThanOrEqual([actualValue intValue], -2147483647L);
}
}
{
id actualValue = value;
if (actualValue != nil) {
XCTAssertLessThanOrEqual([actualValue intValue], 2147483647L);
}
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTestCluster_000289_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute NULLABLE_INT32S null Value & not"];
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 & not Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
if (actualValue != nil) {
XCTAssertNotEqual([actualValue intValue], -2147483647L);
}
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTestCluster_000290_WriteAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Write attribute NULLABLE_INT32S 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 Value 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_INT32S Value in range"];
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 Value in range Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
if (actualValue != nil) {
XCTAssertGreaterThanOrEqual([actualValue intValue], -2147483647L);
}
}
{
id actualValue = value;
if (actualValue != nil) {
XCTAssertLessThanOrEqual([actualValue intValue], 2147483647L);
}
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTestCluster_000292_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute NULLABLE_INT32S notValue OK"];
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 notValue OK Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
if (actualValue != nil) {
XCTAssertNotEqual([actualValue intValue], -2147483646L);
}
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTestCluster_000293_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_000294_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_000295_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_000296_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_000297_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_000298_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_000299_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute NULLABLE_INT64S null Value & range"];
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 & range Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
if (actualValue != nil) {
XCTAssertGreaterThanOrEqual([actualValue longLongValue], -9223372036854775807LL);
}
}
{
id actualValue = value;
if (actualValue != nil) {
XCTAssertLessThanOrEqual([actualValue longLongValue], 9223372036854775807LL);
}
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTestCluster_000300_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute NULLABLE_INT64S null Value & not"];
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 & not Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
if (actualValue != nil) {
XCTAssertNotEqual([actualValue longLongValue], -9223372036854775807LL);
}
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTestCluster_000301_WriteAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Write attribute NULLABLE_INT64S 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 Value Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTestCluster_000302_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute NULLABLE_INT64S Value in range"];
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 Value in range Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
if (actualValue != nil) {
XCTAssertGreaterThanOrEqual([actualValue longLongValue], -9223372036854775807LL);
}
}
{
id actualValue = value;
if (actualValue != nil) {
XCTAssertLessThanOrEqual([actualValue longLongValue], 9223372036854775807LL);
}
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTestCluster_000303_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute NULLABLE_INT64S notValue OK"];
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 notValue OK Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
if (actualValue != nil) {
XCTAssertNotEqual([actualValue longLongValue], -9223372036854775806LL);
}
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTestCluster_000304_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_000305_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_000306_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_000307_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_000308_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_000309_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_000310_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_000311_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_000312_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_000313_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_000314_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_000315_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_000316_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_000317_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_000318_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_000319_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_000320_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_000321_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_000322_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_000323_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_000324_WriteAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Write attribute NULLABLE_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 nullableEnum8Argument;
nullableEnum8Argument = [NSNumber numberWithUnsignedChar:0];
[cluster writeAttributeNullableEnum8WithValue:nullableEnum8Argument
completionHandler:^(NSError * _Nullable err) {
NSLog(@"Write attribute NULLABLE_ENUM8 Min Value Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTestCluster_000325_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute NULLABLE_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 readAttributeNullableEnum8WithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"Read attribute NULLABLE_ENUM8 Min Value Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertFalse(actualValue == nil);
XCTAssertEqual([actualValue unsignedCharValue], 0);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTestCluster_000326_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_000327_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_000328_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_000329_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_000330_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_000331_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_000332_WriteAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Write attribute NULLABLE_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 nullableEnum16Argument;
nullableEnum16Argument = [NSNumber numberWithUnsignedShort:0U];
[cluster writeAttributeNullableEnum16WithValue:nullableEnum16Argument
completionHandler:^(NSError * _Nullable err) {
NSLog(@"Write attribute NULLABLE_ENUM16 Min Value Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTestCluster_000333_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute NULLABLE_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 readAttributeNullableEnum16WithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"Read attribute NULLABLE_ENUM16 Min Value Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertFalse(actualValue == nil);
XCTAssertEqual([actualValue unsignedShortValue], 0U);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTestCluster_000334_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_000335_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_000336_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_000337_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_000338_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_000339_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_000340_WriteAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Write attribute NULLABLE_SIMPLE_ENUM 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 nullableEnumAttrArgument;
nullableEnumAttrArgument = [NSNumber numberWithUnsignedChar:0];
[cluster writeAttributeNullableEnumAttrWithValue:nullableEnumAttrArgument
completionHandler:^(NSError * _Nullable err) {
NSLog(@"Write attribute NULLABLE_SIMPLE_ENUM Min Value Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTestCluster_000341_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute NULLABLE_SIMPLE_ENUM 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 readAttributeNullableEnumAttrWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"Read attribute NULLABLE_SIMPLE_ENUM Min Value Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertFalse(actualValue == nil);
XCTAssertEqual([actualValue unsignedCharValue], 0);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTestCluster_000342_WriteAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Write attribute NULLABLE_SIMPLE_ENUM 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 nullableEnumAttrArgument;
nullableEnumAttrArgument = [NSNumber numberWithUnsignedChar:254];
[cluster writeAttributeNullableEnumAttrWithValue:nullableEnumAttrArgument
completionHandler:^(NSError * _Nullable err) {
NSLog(@"Write attribute NULLABLE_SIMPLE_ENUM Max Value Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTestCluster_000343_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute NULLABLE_SIMPLE_ENUM 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 readAttributeNullableEnumAttrWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"Read attribute NULLABLE_SIMPLE_ENUM 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_000344_WriteAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Write attribute NULLABLE_SIMPLE_ENUM 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 nullableEnumAttrArgument;
nullableEnumAttrArgument = [NSNumber numberWithUnsignedChar:255];
[cluster
writeAttributeNullableEnumAttrWithValue:nullableEnumAttrArgument
completionHandler:^(NSError * _Nullable err) {
NSLog(@"Write attribute NULLABLE_SIMPLE_ENUM Invalid Value Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], EMBER_ZCL_STATUS_CONSTRAINT_ERROR);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTestCluster_000345_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute NULLABLE_SIMPLE_ENUM 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 readAttributeNullableEnumAttrWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"Read attribute NULLABLE_SIMPLE_ENUM 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_000346_WriteAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Write attribute NULLABLE_SIMPLE_ENUM 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 nullableEnumAttrArgument;
nullableEnumAttrArgument = nil;
[cluster writeAttributeNullableEnumAttrWithValue:nullableEnumAttrArgument
completionHandler:^(NSError * _Nullable err) {
NSLog(@"Write attribute NULLABLE_SIMPLE_ENUM null Value Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTestCluster_000347_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute NULLABLE_SIMPLE_ENUM 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 readAttributeNullableEnumAttrWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"Read attribute NULLABLE_SIMPLE_ENUM null Value Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertTrue(actualValue == nil);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTestCluster_000348_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_000349_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_000350_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_000351_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_000352_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_000353_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_000354_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_000355_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_000356_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_000357_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_000358_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_000359_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_000360_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_000361_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_000362_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);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], EMBER_ZCL_STATUS_UNSUPPORTED_ENDPOINT);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTestCluster_000363_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);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], EMBER_ZCL_STATUS_UNSUPPORTED_CLUSTER);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTestCluster_000364_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_000365_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];
}
bool testSendClusterTestCluster_000366_WaitForReport_Fulfilled = false;
ResponseHandler test_TestCluster_list_int8u_Reported = nil;
- (void)testSendClusterTestCluster_000366_WaitForReport
{
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
test_TestCluster_list_int8u_Reported = ^(NSArray * _Nullable value, NSError * _Nullable err) {
NSLog(@"Report: Subscribe to list attribute 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);
}
testSendClusterTestCluster_000366_WaitForReport_Fulfilled = true;
};
}
- (void)testSendClusterTestCluster_000367_SubscribeAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Subscribe to list attribute"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
uint16_t minIntervalArgument = 2U;
uint16_t maxIntervalArgument = 5U;
[cluster subscribeAttributeListInt8uWithMinInterval:@(minIntervalArgument)
maxInterval:@(maxIntervalArgument)
subscriptionEstablished:^{
XCTAssertEqual(testSendClusterTestCluster_000366_WaitForReport_Fulfilled, true);
[expectation fulfill];
}
reportHandler:^(NSArray * _Nullable value, NSError * _Nullable err) {
NSLog(@"Subscribe to list attribute Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
if (test_TestCluster_list_int8u_Reported != nil) {
ResponseHandler callback = test_TestCluster_list_int8u_Reported;
test_TestCluster_list_int8u_Reported = nil;
callback(value, err);
}
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTestCluster_000368_WriteAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Write subscribed-to list attribute"];
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:5];
temp_0[1] = [NSNumber numberWithUnsignedChar:6];
temp_0[2] = [NSNumber numberWithUnsignedChar:7];
temp_0[3] = [NSNumber numberWithUnsignedChar:8];
listInt8uArgument = temp_0;
}
[cluster writeAttributeListInt8uWithValue:listInt8uArgument
completionHandler:^(NSError * _Nullable err) {
NSLog(@"Write subscribed-to list attribute Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTestCluster_000369_WaitForReport
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Check for list attribute report"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
test_TestCluster_list_int8u_Reported = ^(NSArray * _Nullable value, NSError * _Nullable err) {
NSLog(@"Check for list attribute report Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertEqual([actualValue count], 4);
XCTAssertEqual([actualValue[0] unsignedCharValue], 5);
XCTAssertEqual([actualValue[1] unsignedCharValue], 6);
XCTAssertEqual([actualValue[2] unsignedCharValue], 7);
XCTAssertEqual([actualValue[3] unsignedCharValue], 8);
}
[expectation fulfill];
};
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTestCluster_000370_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Read range-restricted unsigned 8-bit integer"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeRangeRestrictedInt8uWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"Read range-restricted unsigned 8-bit integer Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertEqual([actualValue unsignedCharValue], 70);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTestCluster_000371_WriteAttribute
{
XCTestExpectation * expectation =
[self expectationWithDescription:@"Write min value to a range-restricted unsigned 8-bit integer"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
id rangeRestrictedInt8uArgument;
rangeRestrictedInt8uArgument = [NSNumber numberWithUnsignedChar:0];
[cluster writeAttributeRangeRestrictedInt8uWithValue:rangeRestrictedInt8uArgument
completionHandler:^(NSError * _Nullable err) {
NSLog(@"Write min value to a range-restricted unsigned 8-bit integer Error: %@", err);
XCTAssertEqual(
[CHIPErrorTestUtils errorToZCLErrorCode:err], EMBER_ZCL_STATUS_CONSTRAINT_ERROR);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTestCluster_000372_WriteAttribute
{
XCTestExpectation * expectation =
[self expectationWithDescription:@"Write just-below-range value to a range-restricted unsigned 8-bit integer"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
id rangeRestrictedInt8uArgument;
rangeRestrictedInt8uArgument = [NSNumber numberWithUnsignedChar:19];
[cluster
writeAttributeRangeRestrictedInt8uWithValue:rangeRestrictedInt8uArgument
completionHandler:^(NSError * _Nullable err) {
NSLog(@"Write just-below-range value to a range-restricted unsigned 8-bit integer Error: %@",
err);
XCTAssertEqual(
[CHIPErrorTestUtils errorToZCLErrorCode:err], EMBER_ZCL_STATUS_CONSTRAINT_ERROR);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTestCluster_000373_WriteAttribute
{
XCTestExpectation * expectation =
[self expectationWithDescription:@"Write just-above-range value to a range-restricted unsigned 8-bit integer"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
id rangeRestrictedInt8uArgument;
rangeRestrictedInt8uArgument = [NSNumber numberWithUnsignedChar:101];
[cluster
writeAttributeRangeRestrictedInt8uWithValue:rangeRestrictedInt8uArgument
completionHandler:^(NSError * _Nullable err) {
NSLog(@"Write just-above-range value to a range-restricted unsigned 8-bit integer Error: %@",
err);
XCTAssertEqual(
[CHIPErrorTestUtils errorToZCLErrorCode:err], EMBER_ZCL_STATUS_CONSTRAINT_ERROR);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTestCluster_000374_WriteAttribute
{
XCTestExpectation * expectation =
[self expectationWithDescription:@"Write max value to a range-restricted unsigned 8-bit integer"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
id rangeRestrictedInt8uArgument;
rangeRestrictedInt8uArgument = [NSNumber numberWithUnsignedChar:255];
[cluster writeAttributeRangeRestrictedInt8uWithValue:rangeRestrictedInt8uArgument
completionHandler:^(NSError * _Nullable err) {
NSLog(@"Write max value to a range-restricted unsigned 8-bit integer Error: %@", err);
XCTAssertEqual(
[CHIPErrorTestUtils errorToZCLErrorCode:err], EMBER_ZCL_STATUS_CONSTRAINT_ERROR);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTestCluster_000375_ReadAttribute
{
XCTestExpectation * expectation =
[self expectationWithDescription:@"Verify range-restricted unsigned 8-bit integer value has not changed"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeRangeRestrictedInt8uWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"Verify range-restricted unsigned 8-bit integer value has not changed Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertEqual([actualValue unsignedCharValue], 70);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTestCluster_000376_WriteAttribute
{
XCTestExpectation * expectation =
[self expectationWithDescription:@"Write min valid value to a range-restricted unsigned 8-bit integer"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
id rangeRestrictedInt8uArgument;
rangeRestrictedInt8uArgument = [NSNumber numberWithUnsignedChar:20];
[cluster
writeAttributeRangeRestrictedInt8uWithValue:rangeRestrictedInt8uArgument
completionHandler:^(NSError * _Nullable err) {
NSLog(@"Write min valid value to a range-restricted unsigned 8-bit integer Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTestCluster_000377_ReadAttribute
{
XCTestExpectation * expectation =
[self expectationWithDescription:@"Verify range-restricted unsigned 8-bit integer value is at min valid"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeRangeRestrictedInt8uWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"Verify range-restricted unsigned 8-bit integer value is at min valid Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertEqual([actualValue unsignedCharValue], 20);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTestCluster_000378_WriteAttribute
{
XCTestExpectation * expectation =
[self expectationWithDescription:@"Write max valid value to a range-restricted unsigned 8-bit integer"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
id rangeRestrictedInt8uArgument;
rangeRestrictedInt8uArgument = [NSNumber numberWithUnsignedChar:100];
[cluster
writeAttributeRangeRestrictedInt8uWithValue:rangeRestrictedInt8uArgument
completionHandler:^(NSError * _Nullable err) {
NSLog(@"Write max valid value to a range-restricted unsigned 8-bit integer Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTestCluster_000379_ReadAttribute
{
XCTestExpectation * expectation =
[self expectationWithDescription:@"Verify range-restricted unsigned 8-bit integer value is at max valid"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeRangeRestrictedInt8uWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"Verify range-restricted unsigned 8-bit integer value is at max valid Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertEqual([actualValue unsignedCharValue], 100);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTestCluster_000380_WriteAttribute
{
XCTestExpectation * expectation =
[self expectationWithDescription:@"Write middle valid value to a range-restricted unsigned 8-bit integer"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
id rangeRestrictedInt8uArgument;
rangeRestrictedInt8uArgument = [NSNumber numberWithUnsignedChar:50];
[cluster writeAttributeRangeRestrictedInt8uWithValue:rangeRestrictedInt8uArgument
completionHandler:^(NSError * _Nullable err) {
NSLog(@"Write middle valid value to a range-restricted unsigned 8-bit integer Error: %@",
err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTestCluster_000381_ReadAttribute
{
XCTestExpectation * expectation =
[self expectationWithDescription:@"Verify range-restricted unsigned 8-bit integer value is at mid valid"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeRangeRestrictedInt8uWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"Verify range-restricted unsigned 8-bit integer value is at mid valid Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertEqual([actualValue unsignedCharValue], 50);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTestCluster_000382_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Read range-restricted unsigned 16-bit integer"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeRangeRestrictedInt16uWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"Read range-restricted unsigned 16-bit integer Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertEqual([actualValue unsignedShortValue], 200U);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTestCluster_000383_WriteAttribute
{
XCTestExpectation * expectation =
[self expectationWithDescription:@"Write min value to a range-restricted unsigned 16-bit integer"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
id rangeRestrictedInt16uArgument;
rangeRestrictedInt16uArgument = [NSNumber numberWithUnsignedShort:0U];
[cluster writeAttributeRangeRestrictedInt16uWithValue:rangeRestrictedInt16uArgument
completionHandler:^(NSError * _Nullable err) {
NSLog(@"Write min value to a range-restricted unsigned 16-bit integer Error: %@", err);
XCTAssertEqual(
[CHIPErrorTestUtils errorToZCLErrorCode:err], EMBER_ZCL_STATUS_CONSTRAINT_ERROR);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTestCluster_000384_WriteAttribute
{
XCTestExpectation * expectation =
[self expectationWithDescription:@"Write just-below-range value to a range-restricted unsigned 16-bit integer"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
id rangeRestrictedInt16uArgument;
rangeRestrictedInt16uArgument = [NSNumber numberWithUnsignedShort:99U];
[cluster
writeAttributeRangeRestrictedInt16uWithValue:rangeRestrictedInt16uArgument
completionHandler:^(NSError * _Nullable err) {
NSLog(
@"Write just-below-range value to a range-restricted unsigned 16-bit integer Error: %@",
err);
XCTAssertEqual(
[CHIPErrorTestUtils errorToZCLErrorCode:err], EMBER_ZCL_STATUS_CONSTRAINT_ERROR);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTestCluster_000385_WriteAttribute
{
XCTestExpectation * expectation =
[self expectationWithDescription:@"Write just-above-range value to a range-restricted unsigned 16-bit integer"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
id rangeRestrictedInt16uArgument;
rangeRestrictedInt16uArgument = [NSNumber numberWithUnsignedShort:1001U];
[cluster
writeAttributeRangeRestrictedInt16uWithValue:rangeRestrictedInt16uArgument
completionHandler:^(NSError * _Nullable err) {
NSLog(
@"Write just-above-range value to a range-restricted unsigned 16-bit integer Error: %@",
err);
XCTAssertEqual(
[CHIPErrorTestUtils errorToZCLErrorCode:err], EMBER_ZCL_STATUS_CONSTRAINT_ERROR);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTestCluster_000386_WriteAttribute
{
XCTestExpectation * expectation =
[self expectationWithDescription:@"Write max value to a range-restricted unsigned 16-bit integer"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
id rangeRestrictedInt16uArgument;
rangeRestrictedInt16uArgument = [NSNumber numberWithUnsignedShort:65535U];
[cluster writeAttributeRangeRestrictedInt16uWithValue:rangeRestrictedInt16uArgument
completionHandler:^(NSError * _Nullable err) {
NSLog(@"Write max value to a range-restricted unsigned 16-bit integer Error: %@", err);
XCTAssertEqual(
[CHIPErrorTestUtils errorToZCLErrorCode:err], EMBER_ZCL_STATUS_CONSTRAINT_ERROR);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTestCluster_000387_ReadAttribute
{
XCTestExpectation * expectation =
[self expectationWithDescription:@"Verify range-restricted unsigned 16-bit integer value has not changed"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeRangeRestrictedInt16uWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"Verify range-restricted unsigned 16-bit integer value has not changed Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertEqual([actualValue unsignedShortValue], 200U);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTestCluster_000388_WriteAttribute
{
XCTestExpectation * expectation =
[self expectationWithDescription:@"Write min valid value to a range-restricted unsigned 16-bit integer"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
id rangeRestrictedInt16uArgument;
rangeRestrictedInt16uArgument = [NSNumber numberWithUnsignedShort:100U];
[cluster
writeAttributeRangeRestrictedInt16uWithValue:rangeRestrictedInt16uArgument
completionHandler:^(NSError * _Nullable err) {
NSLog(@"Write min valid value to a range-restricted unsigned 16-bit integer Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTestCluster_000389_ReadAttribute
{
XCTestExpectation * expectation =
[self expectationWithDescription:@"Verify range-restricted unsigned 16-bit integer value is at min valid"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeRangeRestrictedInt16uWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"Verify range-restricted unsigned 16-bit integer value is at min valid Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertEqual([actualValue unsignedShortValue], 100U);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTestCluster_000390_WriteAttribute
{
XCTestExpectation * expectation =
[self expectationWithDescription:@"Write max valid value to a range-restricted unsigned 16-bit integer"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
id rangeRestrictedInt16uArgument;
rangeRestrictedInt16uArgument = [NSNumber numberWithUnsignedShort:1000U];
[cluster
writeAttributeRangeRestrictedInt16uWithValue:rangeRestrictedInt16uArgument
completionHandler:^(NSError * _Nullable err) {
NSLog(@"Write max valid value to a range-restricted unsigned 16-bit integer Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTestCluster_000391_ReadAttribute
{
XCTestExpectation * expectation =
[self expectationWithDescription:@"Verify range-restricted unsigned 16-bit integer value is at max valid"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeRangeRestrictedInt16uWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"Verify range-restricted unsigned 16-bit integer value is at max valid Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertEqual([actualValue unsignedShortValue], 1000U);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTestCluster_000392_WriteAttribute
{
XCTestExpectation * expectation =
[self expectationWithDescription:@"Write middle valid value to a range-restricted unsigned 16-bit integer"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
id rangeRestrictedInt16uArgument;
rangeRestrictedInt16uArgument = [NSNumber numberWithUnsignedShort:500U];
[cluster
writeAttributeRangeRestrictedInt16uWithValue:rangeRestrictedInt16uArgument
completionHandler:^(NSError * _Nullable err) {
NSLog(@"Write middle valid value to a range-restricted unsigned 16-bit integer Error: %@",
err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTestCluster_000393_ReadAttribute
{
XCTestExpectation * expectation =
[self expectationWithDescription:@"Verify range-restricted unsigned 16-bit integer value is at mid valid"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeRangeRestrictedInt16uWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"Verify range-restricted unsigned 16-bit integer value is at mid valid Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertEqual([actualValue unsignedShortValue], 500U);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTestCluster_000394_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Read range-restricted signed 8-bit integer"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeRangeRestrictedInt8sWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"Read range-restricted signed 8-bit integer Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertEqual([actualValue charValue], -20);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTestCluster_000395_WriteAttribute
{
XCTestExpectation * expectation =
[self expectationWithDescription:@"Write min value to a range-restricted signed 8-bit integer"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
id rangeRestrictedInt8sArgument;
rangeRestrictedInt8sArgument = [NSNumber numberWithChar:-128];
[cluster writeAttributeRangeRestrictedInt8sWithValue:rangeRestrictedInt8sArgument
completionHandler:^(NSError * _Nullable err) {
NSLog(@"Write min value to a range-restricted signed 8-bit integer Error: %@", err);
XCTAssertEqual(
[CHIPErrorTestUtils errorToZCLErrorCode:err], EMBER_ZCL_STATUS_CONSTRAINT_ERROR);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTestCluster_000396_WriteAttribute
{
XCTestExpectation * expectation =
[self expectationWithDescription:@"Write just-below-range value to a range-restricted signed 8-bit integer"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
id rangeRestrictedInt8sArgument;
rangeRestrictedInt8sArgument = [NSNumber numberWithChar:-41];
[cluster
writeAttributeRangeRestrictedInt8sWithValue:rangeRestrictedInt8sArgument
completionHandler:^(NSError * _Nullable err) {
NSLog(@"Write just-below-range value to a range-restricted signed 8-bit integer Error: %@",
err);
XCTAssertEqual(
[CHIPErrorTestUtils errorToZCLErrorCode:err], EMBER_ZCL_STATUS_CONSTRAINT_ERROR);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTestCluster_000397_WriteAttribute
{
XCTestExpectation * expectation =
[self expectationWithDescription:@"Write just-above-range value to a range-restricted signed 8-bit integer"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
id rangeRestrictedInt8sArgument;
rangeRestrictedInt8sArgument = [NSNumber numberWithChar:51];
[cluster
writeAttributeRangeRestrictedInt8sWithValue:rangeRestrictedInt8sArgument
completionHandler:^(NSError * _Nullable err) {
NSLog(@"Write just-above-range value to a range-restricted signed 8-bit integer Error: %@",
err);
XCTAssertEqual(
[CHIPErrorTestUtils errorToZCLErrorCode:err], EMBER_ZCL_STATUS_CONSTRAINT_ERROR);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTestCluster_000398_WriteAttribute
{
XCTestExpectation * expectation =
[self expectationWithDescription:@"Write max value to a range-restricted signed 8-bit integer"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
id rangeRestrictedInt8sArgument;
rangeRestrictedInt8sArgument = [NSNumber numberWithChar:127];
[cluster writeAttributeRangeRestrictedInt8sWithValue:rangeRestrictedInt8sArgument
completionHandler:^(NSError * _Nullable err) {
NSLog(@"Write max value to a range-restricted signed 8-bit integer Error: %@", err);
XCTAssertEqual(
[CHIPErrorTestUtils errorToZCLErrorCode:err], EMBER_ZCL_STATUS_CONSTRAINT_ERROR);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTestCluster_000399_ReadAttribute
{
XCTestExpectation * expectation =
[self expectationWithDescription:@"Verify range-restricted signed 8-bit integer value has not changed"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeRangeRestrictedInt8sWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"Verify range-restricted signed 8-bit integer value has not changed Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertEqual([actualValue charValue], -20);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTestCluster_000400_WriteAttribute
{
XCTestExpectation * expectation =
[self expectationWithDescription:@"Write min valid value to a range-restricted signed 8-bit integer"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
id rangeRestrictedInt8sArgument;
rangeRestrictedInt8sArgument = [NSNumber numberWithChar:-40];
[cluster
writeAttributeRangeRestrictedInt8sWithValue:rangeRestrictedInt8sArgument
completionHandler:^(NSError * _Nullable err) {
NSLog(@"Write min valid value to a range-restricted signed 8-bit integer Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTestCluster_000401_ReadAttribute
{
XCTestExpectation * expectation =
[self expectationWithDescription:@"Verify range-restricted signed 8-bit integer value is at min valid"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeRangeRestrictedInt8sWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"Verify range-restricted signed 8-bit integer value is at min valid Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertEqual([actualValue charValue], -40);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTestCluster_000402_WriteAttribute
{
XCTestExpectation * expectation =
[self expectationWithDescription:@"Write max valid value to a range-restricted signed 8-bit integer"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
id rangeRestrictedInt8sArgument;
rangeRestrictedInt8sArgument = [NSNumber numberWithChar:50];
[cluster
writeAttributeRangeRestrictedInt8sWithValue:rangeRestrictedInt8sArgument
completionHandler:^(NSError * _Nullable err) {
NSLog(@"Write max valid value to a range-restricted signed 8-bit integer Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTestCluster_000403_ReadAttribute
{
XCTestExpectation * expectation =
[self expectationWithDescription:@"Verify range-restricted signed 8-bit integer value is at max valid"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeRangeRestrictedInt8sWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"Verify range-restricted signed 8-bit integer value is at max valid Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertEqual([actualValue charValue], 50);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTestCluster_000404_WriteAttribute
{
XCTestExpectation * expectation =
[self expectationWithDescription:@"Write middle valid value to a range-restricted signed 8-bit integer"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
id rangeRestrictedInt8sArgument;
rangeRestrictedInt8sArgument = [NSNumber numberWithChar:6];
[cluster
writeAttributeRangeRestrictedInt8sWithValue:rangeRestrictedInt8sArgument
completionHandler:^(NSError * _Nullable err) {
NSLog(@"Write middle valid value to a range-restricted signed 8-bit integer Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTestCluster_000405_ReadAttribute
{
XCTestExpectation * expectation =
[self expectationWithDescription:@"Verify range-restricted signed 8-bit integer value is at mid valid"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeRangeRestrictedInt8sWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"Verify range-restricted signed 8-bit integer value is at mid valid Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertEqual([actualValue charValue], 6);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTestCluster_000406_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Read range-restricted signed 16-bit integer"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeRangeRestrictedInt16sWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"Read range-restricted signed 16-bit integer Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertEqual([actualValue shortValue], -100);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTestCluster_000407_WriteAttribute
{
XCTestExpectation * expectation =
[self expectationWithDescription:@"Write min value to a range-restricted signed 16-bit integer"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
id rangeRestrictedInt16sArgument;
rangeRestrictedInt16sArgument = [NSNumber numberWithShort:-32768];
[cluster writeAttributeRangeRestrictedInt16sWithValue:rangeRestrictedInt16sArgument
completionHandler:^(NSError * _Nullable err) {
NSLog(@"Write min value to a range-restricted signed 16-bit integer Error: %@", err);
XCTAssertEqual(
[CHIPErrorTestUtils errorToZCLErrorCode:err], EMBER_ZCL_STATUS_CONSTRAINT_ERROR);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTestCluster_000408_WriteAttribute
{
XCTestExpectation * expectation =
[self expectationWithDescription:@"Write just-below-range value to a range-restricted signed 16-bit integer"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
id rangeRestrictedInt16sArgument;
rangeRestrictedInt16sArgument = [NSNumber numberWithShort:-151];
[cluster
writeAttributeRangeRestrictedInt16sWithValue:rangeRestrictedInt16sArgument
completionHandler:^(NSError * _Nullable err) {
NSLog(@"Write just-below-range value to a range-restricted signed 16-bit integer Error: %@",
err);
XCTAssertEqual(
[CHIPErrorTestUtils errorToZCLErrorCode:err], EMBER_ZCL_STATUS_CONSTRAINT_ERROR);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTestCluster_000409_WriteAttribute
{
XCTestExpectation * expectation =
[self expectationWithDescription:@"Write just-above-range value to a range-restricted signed 16-bit integer"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
id rangeRestrictedInt16sArgument;
rangeRestrictedInt16sArgument = [NSNumber numberWithShort:201];
[cluster
writeAttributeRangeRestrictedInt16sWithValue:rangeRestrictedInt16sArgument
completionHandler:^(NSError * _Nullable err) {
NSLog(@"Write just-above-range value to a range-restricted signed 16-bit integer Error: %@",
err);
XCTAssertEqual(
[CHIPErrorTestUtils errorToZCLErrorCode:err], EMBER_ZCL_STATUS_CONSTRAINT_ERROR);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTestCluster_000410_WriteAttribute
{
XCTestExpectation * expectation =
[self expectationWithDescription:@"Write max value to a range-restricted signed 16-bit integer"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
id rangeRestrictedInt16sArgument;
rangeRestrictedInt16sArgument = [NSNumber numberWithShort:32767];
[cluster writeAttributeRangeRestrictedInt16sWithValue:rangeRestrictedInt16sArgument
completionHandler:^(NSError * _Nullable err) {
NSLog(@"Write max value to a range-restricted signed 16-bit integer Error: %@", err);
XCTAssertEqual(
[CHIPErrorTestUtils errorToZCLErrorCode:err], EMBER_ZCL_STATUS_CONSTRAINT_ERROR);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTestCluster_000411_ReadAttribute
{
XCTestExpectation * expectation =
[self expectationWithDescription:@"Verify range-restricted signed 16-bit integer value has not changed"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeRangeRestrictedInt16sWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"Verify range-restricted signed 16-bit integer value has not changed Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertEqual([actualValue shortValue], -100);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTestCluster_000412_WriteAttribute
{
XCTestExpectation * expectation =
[self expectationWithDescription:@"Write min valid value to a range-restricted signed 16-bit integer"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
id rangeRestrictedInt16sArgument;
rangeRestrictedInt16sArgument = [NSNumber numberWithShort:-150];
[cluster
writeAttributeRangeRestrictedInt16sWithValue:rangeRestrictedInt16sArgument
completionHandler:^(NSError * _Nullable err) {
NSLog(@"Write min valid value to a range-restricted signed 16-bit integer Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTestCluster_000413_ReadAttribute
{
XCTestExpectation * expectation =
[self expectationWithDescription:@"Verify range-restricted signed 16-bit integer value is at min valid"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeRangeRestrictedInt16sWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"Verify range-restricted signed 16-bit integer value is at min valid Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertEqual([actualValue shortValue], -150);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTestCluster_000414_WriteAttribute
{
XCTestExpectation * expectation =
[self expectationWithDescription:@"Write max valid value to a range-restricted signed 16-bit integer"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
id rangeRestrictedInt16sArgument;
rangeRestrictedInt16sArgument = [NSNumber numberWithShort:200];
[cluster
writeAttributeRangeRestrictedInt16sWithValue:rangeRestrictedInt16sArgument
completionHandler:^(NSError * _Nullable err) {
NSLog(@"Write max valid value to a range-restricted signed 16-bit integer Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTestCluster_000415_ReadAttribute
{
XCTestExpectation * expectation =
[self expectationWithDescription:@"Verify range-restricted signed 16-bit integer value is at max valid"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeRangeRestrictedInt16sWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"Verify range-restricted signed 16-bit integer value is at max valid Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertEqual([actualValue shortValue], 200);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTestCluster_000416_WriteAttribute
{
XCTestExpectation * expectation =
[self expectationWithDescription:@"Write middle valid value to a range-restricted signed 16-bit integer"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
id rangeRestrictedInt16sArgument;
rangeRestrictedInt16sArgument = [NSNumber numberWithShort:7];
[cluster writeAttributeRangeRestrictedInt16sWithValue:rangeRestrictedInt16sArgument
completionHandler:^(NSError * _Nullable err) {
NSLog(@"Write middle valid value to a range-restricted signed 16-bit integer Error: %@",
err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTestCluster_000417_ReadAttribute
{
XCTestExpectation * expectation =
[self expectationWithDescription:@"Verify range-restricted signed 16-bit integer value is at mid valid"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeRangeRestrictedInt16sWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"Verify range-restricted signed 16-bit integer value is at mid valid Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertEqual([actualValue shortValue], 7);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTestCluster_000418_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Read nullable range-restricted unsigned 8-bit integer"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeNullableRangeRestrictedInt8uWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"Read nullable range-restricted unsigned 8-bit integer Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertFalse(actualValue == nil);
XCTAssertEqual([actualValue unsignedCharValue], 70);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTestCluster_000419_WriteAttribute
{
XCTestExpectation * expectation =
[self expectationWithDescription:@"Write min value to a nullable range-restricted unsigned 8-bit integer"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
id nullableRangeRestrictedInt8uArgument;
nullableRangeRestrictedInt8uArgument = [NSNumber numberWithUnsignedChar:0];
[cluster writeAttributeNullableRangeRestrictedInt8uWithValue:nullableRangeRestrictedInt8uArgument
completionHandler:^(NSError * _Nullable err) {
NSLog(@"Write min value to a nullable range-restricted unsigned 8-bit integer "
@"Error: %@",
err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err],
EMBER_ZCL_STATUS_CONSTRAINT_ERROR);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTestCluster_000420_WriteAttribute
{
XCTestExpectation * expectation =
[self expectationWithDescription:@"Write just-below-range value to a nullable range-restricted unsigned 8-bit integer"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
id nullableRangeRestrictedInt8uArgument;
nullableRangeRestrictedInt8uArgument = [NSNumber numberWithUnsignedChar:19];
[cluster writeAttributeNullableRangeRestrictedInt8uWithValue:nullableRangeRestrictedInt8uArgument
completionHandler:^(NSError * _Nullable err) {
NSLog(@"Write just-below-range value to a nullable range-restricted unsigned "
@"8-bit integer Error: %@",
err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err],
EMBER_ZCL_STATUS_CONSTRAINT_ERROR);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTestCluster_000421_WriteAttribute
{
XCTestExpectation * expectation =
[self expectationWithDescription:@"Write just-above-range value to a nullable range-restricted unsigned 8-bit integer"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
id nullableRangeRestrictedInt8uArgument;
nullableRangeRestrictedInt8uArgument = [NSNumber numberWithUnsignedChar:101];
[cluster writeAttributeNullableRangeRestrictedInt8uWithValue:nullableRangeRestrictedInt8uArgument
completionHandler:^(NSError * _Nullable err) {
NSLog(@"Write just-above-range value to a nullable range-restricted unsigned "
@"8-bit integer Error: %@",
err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err],
EMBER_ZCL_STATUS_CONSTRAINT_ERROR);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTestCluster_000422_WriteAttribute
{
XCTestExpectation * expectation =
[self expectationWithDescription:@"Write max value to a nullable range-restricted unsigned 8-bit integer"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
id nullableRangeRestrictedInt8uArgument;
nullableRangeRestrictedInt8uArgument = [NSNumber numberWithUnsignedChar:254];
[cluster writeAttributeNullableRangeRestrictedInt8uWithValue:nullableRangeRestrictedInt8uArgument
completionHandler:^(NSError * _Nullable err) {
NSLog(@"Write max value to a nullable range-restricted unsigned 8-bit integer "
@"Error: %@",
err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err],
EMBER_ZCL_STATUS_CONSTRAINT_ERROR);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTestCluster_000423_ReadAttribute
{
XCTestExpectation * expectation =
[self expectationWithDescription:@"Verify nullable range-restricted unsigned 8-bit integer value has not changed"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeNullableRangeRestrictedInt8uWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"Verify nullable range-restricted unsigned 8-bit integer value has not changed Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertFalse(actualValue == nil);
XCTAssertEqual([actualValue unsignedCharValue], 70);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTestCluster_000424_WriteAttribute
{
XCTestExpectation * expectation =
[self expectationWithDescription:@"Write min valid value to a nullable range-restricted unsigned 8-bit integer"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
id nullableRangeRestrictedInt8uArgument;
nullableRangeRestrictedInt8uArgument = [NSNumber numberWithUnsignedChar:20];
[cluster writeAttributeNullableRangeRestrictedInt8uWithValue:nullableRangeRestrictedInt8uArgument
completionHandler:^(NSError * _Nullable err) {
NSLog(@"Write min valid value to a nullable range-restricted unsigned 8-bit "
@"integer Error: %@",
err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTestCluster_000425_ReadAttribute
{
XCTestExpectation * expectation =
[self expectationWithDescription:@"Verify nullable range-restricted unsigned 8-bit integer value is at min valid"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeNullableRangeRestrictedInt8uWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"Verify nullable range-restricted unsigned 8-bit integer value is at min valid 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)testSendClusterTestCluster_000426_WriteAttribute
{
XCTestExpectation * expectation =
[self expectationWithDescription:@"Write max valid value to a nullable range-restricted unsigned 8-bit integer"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
id nullableRangeRestrictedInt8uArgument;
nullableRangeRestrictedInt8uArgument = [NSNumber numberWithUnsignedChar:100];
[cluster writeAttributeNullableRangeRestrictedInt8uWithValue:nullableRangeRestrictedInt8uArgument
completionHandler:^(NSError * _Nullable err) {
NSLog(@"Write max valid value to a nullable range-restricted unsigned 8-bit "
@"integer Error: %@",
err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTestCluster_000427_ReadAttribute
{
XCTestExpectation * expectation =
[self expectationWithDescription:@"Verify nullable range-restricted unsigned 8-bit integer value is at max valid"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeNullableRangeRestrictedInt8uWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"Verify nullable range-restricted unsigned 8-bit integer value is at max valid Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertFalse(actualValue == nil);
XCTAssertEqual([actualValue unsignedCharValue], 100);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTestCluster_000428_WriteAttribute
{
XCTestExpectation * expectation =
[self expectationWithDescription:@"Write middle valid value to a nullable range-restricted unsigned 8-bit integer"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
id nullableRangeRestrictedInt8uArgument;
nullableRangeRestrictedInt8uArgument = [NSNumber numberWithUnsignedChar:50];
[cluster writeAttributeNullableRangeRestrictedInt8uWithValue:nullableRangeRestrictedInt8uArgument
completionHandler:^(NSError * _Nullable err) {
NSLog(@"Write middle valid value to a nullable range-restricted unsigned 8-bit "
@"integer Error: %@",
err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTestCluster_000429_ReadAttribute
{
XCTestExpectation * expectation =
[self expectationWithDescription:@"Verify nullable range-restricted unsigned 8-bit integer value is at mid valid"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeNullableRangeRestrictedInt8uWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"Verify nullable range-restricted unsigned 8-bit integer value is at mid valid Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertFalse(actualValue == nil);
XCTAssertEqual([actualValue unsignedCharValue], 50);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTestCluster_000430_WriteAttribute
{
XCTestExpectation * expectation =
[self expectationWithDescription:@"Write null value to a nullable range-restricted unsigned 8-bit integer"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
id nullableRangeRestrictedInt8uArgument;
nullableRangeRestrictedInt8uArgument = nil;
[cluster writeAttributeNullableRangeRestrictedInt8uWithValue:nullableRangeRestrictedInt8uArgument
completionHandler:^(NSError * _Nullable err) {
NSLog(@"Write null value to a nullable range-restricted unsigned 8-bit integer "
@"Error: %@",
err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTestCluster_000431_ReadAttribute
{
XCTestExpectation * expectation =
[self expectationWithDescription:@"Verify nullable range-restricted unsigned 8-bit integer value is 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 readAttributeNullableRangeRestrictedInt8uWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"Verify nullable range-restricted unsigned 8-bit integer value is null Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertTrue(actualValue == nil);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTestCluster_000432_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Read nullable range-restricted unsigned 16-bit integer"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster
readAttributeNullableRangeRestrictedInt16uWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"Read nullable range-restricted unsigned 16-bit integer Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertFalse(actualValue == nil);
XCTAssertEqual([actualValue unsignedShortValue], 200U);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTestCluster_000433_WriteAttribute
{
XCTestExpectation * expectation =
[self expectationWithDescription:@"Write min value to a nullable range-restricted unsigned 16-bit integer"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
id nullableRangeRestrictedInt16uArgument;
nullableRangeRestrictedInt16uArgument = [NSNumber numberWithUnsignedShort:0U];
[cluster writeAttributeNullableRangeRestrictedInt16uWithValue:nullableRangeRestrictedInt16uArgument
completionHandler:^(NSError * _Nullable err) {
NSLog(@"Write min value to a nullable range-restricted unsigned 16-bit integer "
@"Error: %@",
err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err],
EMBER_ZCL_STATUS_CONSTRAINT_ERROR);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTestCluster_000434_WriteAttribute
{
XCTestExpectation * expectation =
[self expectationWithDescription:@"Write just-below-range value to a nullable range-restricted unsigned 16-bit integer"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
id nullableRangeRestrictedInt16uArgument;
nullableRangeRestrictedInt16uArgument = [NSNumber numberWithUnsignedShort:99U];
[cluster writeAttributeNullableRangeRestrictedInt16uWithValue:nullableRangeRestrictedInt16uArgument
completionHandler:^(NSError * _Nullable err) {
NSLog(@"Write just-below-range value to a nullable range-restricted unsigned "
@"16-bit integer Error: %@",
err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err],
EMBER_ZCL_STATUS_CONSTRAINT_ERROR);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTestCluster_000435_WriteAttribute
{
XCTestExpectation * expectation =
[self expectationWithDescription:@"Write just-above-range value to a nullable range-restricted unsigned 16-bit integer"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
id nullableRangeRestrictedInt16uArgument;
nullableRangeRestrictedInt16uArgument = [NSNumber numberWithUnsignedShort:1001U];
[cluster writeAttributeNullableRangeRestrictedInt16uWithValue:nullableRangeRestrictedInt16uArgument
completionHandler:^(NSError * _Nullable err) {
NSLog(@"Write just-above-range value to a nullable range-restricted unsigned "
@"16-bit integer Error: %@",
err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err],
EMBER_ZCL_STATUS_CONSTRAINT_ERROR);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTestCluster_000436_WriteAttribute
{
XCTestExpectation * expectation =
[self expectationWithDescription:@"Write max value to a nullable range-restricted unsigned 16-bit integer"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
id nullableRangeRestrictedInt16uArgument;
nullableRangeRestrictedInt16uArgument = [NSNumber numberWithUnsignedShort:65534U];
[cluster writeAttributeNullableRangeRestrictedInt16uWithValue:nullableRangeRestrictedInt16uArgument
completionHandler:^(NSError * _Nullable err) {
NSLog(@"Write max value to a nullable range-restricted unsigned 16-bit integer "
@"Error: %@",
err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err],
EMBER_ZCL_STATUS_CONSTRAINT_ERROR);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTestCluster_000437_ReadAttribute
{
XCTestExpectation * expectation =
[self expectationWithDescription:@"Verify nullable range-restricted unsigned 16-bit integer value has not changed"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster
readAttributeNullableRangeRestrictedInt16uWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"Verify nullable range-restricted unsigned 16-bit integer value has not changed Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertFalse(actualValue == nil);
XCTAssertEqual([actualValue unsignedShortValue], 200U);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTestCluster_000438_WriteAttribute
{
XCTestExpectation * expectation =
[self expectationWithDescription:@"Write min valid value to a nullable range-restricted unsigned 16-bit integer"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
id nullableRangeRestrictedInt16uArgument;
nullableRangeRestrictedInt16uArgument = [NSNumber numberWithUnsignedShort:100U];
[cluster writeAttributeNullableRangeRestrictedInt16uWithValue:nullableRangeRestrictedInt16uArgument
completionHandler:^(NSError * _Nullable err) {
NSLog(@"Write min valid value to a nullable range-restricted unsigned 16-bit "
@"integer Error: %@",
err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTestCluster_000439_ReadAttribute
{
XCTestExpectation * expectation =
[self expectationWithDescription:@"Verify nullable range-restricted unsigned 16-bit integer value is at min valid"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster
readAttributeNullableRangeRestrictedInt16uWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"Verify nullable range-restricted unsigned 16-bit integer value is at min valid Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertFalse(actualValue == nil);
XCTAssertEqual([actualValue unsignedShortValue], 100U);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTestCluster_000440_WriteAttribute
{
XCTestExpectation * expectation =
[self expectationWithDescription:@"Write max valid value to a nullable range-restricted unsigned 16-bit integer"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
id nullableRangeRestrictedInt16uArgument;
nullableRangeRestrictedInt16uArgument = [NSNumber numberWithUnsignedShort:1000U];
[cluster writeAttributeNullableRangeRestrictedInt16uWithValue:nullableRangeRestrictedInt16uArgument
completionHandler:^(NSError * _Nullable err) {
NSLog(@"Write max valid value to a nullable range-restricted unsigned 16-bit "
@"integer Error: %@",
err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTestCluster_000441_ReadAttribute
{
XCTestExpectation * expectation =
[self expectationWithDescription:@"Verify nullable range-restricted unsigned 16-bit integer value is at max valid"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster
readAttributeNullableRangeRestrictedInt16uWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"Verify nullable range-restricted unsigned 16-bit integer value is at max valid Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertFalse(actualValue == nil);
XCTAssertEqual([actualValue unsignedShortValue], 1000U);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTestCluster_000442_WriteAttribute
{
XCTestExpectation * expectation =
[self expectationWithDescription:@"Write middle valid value to a nullable range-restricted unsigned 16-bit integer"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
id nullableRangeRestrictedInt16uArgument;
nullableRangeRestrictedInt16uArgument = [NSNumber numberWithUnsignedShort:500U];
[cluster writeAttributeNullableRangeRestrictedInt16uWithValue:nullableRangeRestrictedInt16uArgument
completionHandler:^(NSError * _Nullable err) {
NSLog(@"Write middle valid value to a nullable range-restricted unsigned "
@"16-bit integer Error: %@",
err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTestCluster_000443_ReadAttribute
{
XCTestExpectation * expectation =
[self expectationWithDescription:@"Verify nullable range-restricted unsigned 16-bit integer value is at mid valid"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster
readAttributeNullableRangeRestrictedInt16uWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"Verify nullable range-restricted unsigned 16-bit integer value is at mid valid Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertFalse(actualValue == nil);
XCTAssertEqual([actualValue unsignedShortValue], 500U);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTestCluster_000444_WriteAttribute
{
XCTestExpectation * expectation =
[self expectationWithDescription:@"Write null value to a nullable range-restricted unsigned 16-bit integer"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
id nullableRangeRestrictedInt16uArgument;
nullableRangeRestrictedInt16uArgument = nil;
[cluster writeAttributeNullableRangeRestrictedInt16uWithValue:nullableRangeRestrictedInt16uArgument
completionHandler:^(NSError * _Nullable err) {
NSLog(@"Write null value to a nullable range-restricted unsigned 16-bit "
@"integer Error: %@",
err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTestCluster_000445_ReadAttribute
{
XCTestExpectation * expectation =
[self expectationWithDescription:@"Verify nullable range-restricted unsigned 16-bit integer value is 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
readAttributeNullableRangeRestrictedInt16uWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"Verify nullable range-restricted unsigned 16-bit integer value is null Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertTrue(actualValue == nil);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTestCluster_000446_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Read nullable range-restricted signed 8-bit integer"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeNullableRangeRestrictedInt8sWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"Read nullable range-restricted signed 8-bit integer Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertFalse(actualValue == nil);
XCTAssertEqual([actualValue charValue], -20);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTestCluster_000447_WriteAttribute
{
XCTestExpectation * expectation =
[self expectationWithDescription:@"Write min value to a nullable range-restricted signed 8-bit integer"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
id nullableRangeRestrictedInt8sArgument;
nullableRangeRestrictedInt8sArgument = [NSNumber numberWithChar:-127];
[cluster
writeAttributeNullableRangeRestrictedInt8sWithValue:nullableRangeRestrictedInt8sArgument
completionHandler:^(NSError * _Nullable err) {
NSLog(
@"Write min value to a nullable range-restricted signed 8-bit integer Error: %@",
err);
XCTAssertEqual(
[CHIPErrorTestUtils errorToZCLErrorCode:err], EMBER_ZCL_STATUS_CONSTRAINT_ERROR);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTestCluster_000448_WriteAttribute
{
XCTestExpectation * expectation =
[self expectationWithDescription:@"Write just-below-range value to a nullable range-restricted signed 8-bit integer"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
id nullableRangeRestrictedInt8sArgument;
nullableRangeRestrictedInt8sArgument = [NSNumber numberWithChar:-41];
[cluster writeAttributeNullableRangeRestrictedInt8sWithValue:nullableRangeRestrictedInt8sArgument
completionHandler:^(NSError * _Nullable err) {
NSLog(@"Write just-below-range value to a nullable range-restricted signed "
@"8-bit integer Error: %@",
err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err],
EMBER_ZCL_STATUS_CONSTRAINT_ERROR);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTestCluster_000449_WriteAttribute
{
XCTestExpectation * expectation =
[self expectationWithDescription:@"Write just-above-range value to a nullable range-restricted signed 8-bit integer"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
id nullableRangeRestrictedInt8sArgument;
nullableRangeRestrictedInt8sArgument = [NSNumber numberWithChar:51];
[cluster writeAttributeNullableRangeRestrictedInt8sWithValue:nullableRangeRestrictedInt8sArgument
completionHandler:^(NSError * _Nullable err) {
NSLog(@"Write just-above-range value to a nullable range-restricted signed "
@"8-bit integer Error: %@",
err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err],
EMBER_ZCL_STATUS_CONSTRAINT_ERROR);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTestCluster_000450_WriteAttribute
{
XCTestExpectation * expectation =
[self expectationWithDescription:@"Write max value to a nullable range-restricted signed 8-bit integer"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
id nullableRangeRestrictedInt8sArgument;
nullableRangeRestrictedInt8sArgument = [NSNumber numberWithChar:127];
[cluster
writeAttributeNullableRangeRestrictedInt8sWithValue:nullableRangeRestrictedInt8sArgument
completionHandler:^(NSError * _Nullable err) {
NSLog(
@"Write max value to a nullable range-restricted signed 8-bit integer Error: %@",
err);
XCTAssertEqual(
[CHIPErrorTestUtils errorToZCLErrorCode:err], EMBER_ZCL_STATUS_CONSTRAINT_ERROR);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTestCluster_000451_ReadAttribute
{
XCTestExpectation * expectation =
[self expectationWithDescription:@"Verify nullable range-restricted signed 8-bit integer value has not changed"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeNullableRangeRestrictedInt8sWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"Verify nullable range-restricted signed 8-bit integer value has not changed Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertFalse(actualValue == nil);
XCTAssertEqual([actualValue charValue], -20);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTestCluster_000452_WriteAttribute
{
XCTestExpectation * expectation =
[self expectationWithDescription:@"Write min valid value to a nullable range-restricted signed 8-bit integer"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
id nullableRangeRestrictedInt8sArgument;
nullableRangeRestrictedInt8sArgument = [NSNumber numberWithChar:-40];
[cluster writeAttributeNullableRangeRestrictedInt8sWithValue:nullableRangeRestrictedInt8sArgument
completionHandler:^(NSError * _Nullable err) {
NSLog(@"Write min valid value to a nullable range-restricted signed 8-bit "
@"integer Error: %@",
err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTestCluster_000453_ReadAttribute
{
XCTestExpectation * expectation =
[self expectationWithDescription:@"Verify nullable range-restricted signed 8-bit integer value is at min valid"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeNullableRangeRestrictedInt8sWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"Verify nullable range-restricted signed 8-bit integer value is at min valid Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertFalse(actualValue == nil);
XCTAssertEqual([actualValue charValue], -40);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTestCluster_000454_WriteAttribute
{
XCTestExpectation * expectation =
[self expectationWithDescription:@"Write max valid value to a nullable range-restricted signed 8-bit integer"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
id nullableRangeRestrictedInt8sArgument;
nullableRangeRestrictedInt8sArgument = [NSNumber numberWithChar:50];
[cluster writeAttributeNullableRangeRestrictedInt8sWithValue:nullableRangeRestrictedInt8sArgument
completionHandler:^(NSError * _Nullable err) {
NSLog(@"Write max valid value to a nullable range-restricted signed 8-bit "
@"integer Error: %@",
err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTestCluster_000455_ReadAttribute
{
XCTestExpectation * expectation =
[self expectationWithDescription:@"Verify nullable range-restricted signed 8-bit integer value is at max valid"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeNullableRangeRestrictedInt8sWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"Verify nullable range-restricted signed 8-bit integer value is at max valid Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertFalse(actualValue == nil);
XCTAssertEqual([actualValue charValue], 50);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTestCluster_000456_WriteAttribute
{
XCTestExpectation * expectation =
[self expectationWithDescription:@"Write middle valid value to a nullable range-restricted signed 8-bit integer"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
id nullableRangeRestrictedInt8sArgument;
nullableRangeRestrictedInt8sArgument = [NSNumber numberWithChar:6];
[cluster writeAttributeNullableRangeRestrictedInt8sWithValue:nullableRangeRestrictedInt8sArgument
completionHandler:^(NSError * _Nullable err) {
NSLog(@"Write middle valid value to a nullable range-restricted signed 8-bit "
@"integer Error: %@",
err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTestCluster_000457_ReadAttribute
{
XCTestExpectation * expectation =
[self expectationWithDescription:@"Verify nullable range-restricted signed 8-bit integer value is at mid valid"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeNullableRangeRestrictedInt8sWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"Verify nullable range-restricted signed 8-bit integer value is at mid valid Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertFalse(actualValue == nil);
XCTAssertEqual([actualValue charValue], 6);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTestCluster_000458_WriteAttribute
{
XCTestExpectation * expectation =
[self expectationWithDescription:@"Write null value to a nullable range-restricted signed 8-bit integer"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
id nullableRangeRestrictedInt8sArgument;
nullableRangeRestrictedInt8sArgument = nil;
[cluster
writeAttributeNullableRangeRestrictedInt8sWithValue:nullableRangeRestrictedInt8sArgument
completionHandler:^(NSError * _Nullable err) {
NSLog(
@"Write null value to a nullable range-restricted signed 8-bit integer Error: %@",
err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTestCluster_000459_ReadAttribute
{
XCTestExpectation * expectation =
[self expectationWithDescription:@"Verify nullable range-restricted signed 8-bit integer value is at 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 readAttributeNullableRangeRestrictedInt8sWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"Verify nullable range-restricted signed 8-bit integer value is at null Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertTrue(actualValue == nil);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTestCluster_000460_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Read nullable range-restricted signed 16-bit integer"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster
readAttributeNullableRangeRestrictedInt16sWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"Read nullable range-restricted signed 16-bit integer Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertFalse(actualValue == nil);
XCTAssertEqual([actualValue shortValue], -100);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTestCluster_000461_WriteAttribute
{
XCTestExpectation * expectation =
[self expectationWithDescription:@"Write min value to a nullable range-restricted signed 16-bit integer"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
id nullableRangeRestrictedInt16sArgument;
nullableRangeRestrictedInt16sArgument = [NSNumber numberWithShort:-32767];
[cluster writeAttributeNullableRangeRestrictedInt16sWithValue:nullableRangeRestrictedInt16sArgument
completionHandler:^(NSError * _Nullable err) {
NSLog(@"Write min value to a nullable range-restricted signed 16-bit integer "
@"Error: %@",
err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err],
EMBER_ZCL_STATUS_CONSTRAINT_ERROR);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTestCluster_000462_WriteAttribute
{
XCTestExpectation * expectation =
[self expectationWithDescription:@"Write just-below-range value to a nullable range-restricted signed 16-bit integer"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
id nullableRangeRestrictedInt16sArgument;
nullableRangeRestrictedInt16sArgument = [NSNumber numberWithShort:-151];
[cluster writeAttributeNullableRangeRestrictedInt16sWithValue:nullableRangeRestrictedInt16sArgument
completionHandler:^(NSError * _Nullable err) {
NSLog(@"Write just-below-range value to a nullable range-restricted signed "
@"16-bit integer Error: %@",
err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err],
EMBER_ZCL_STATUS_CONSTRAINT_ERROR);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTestCluster_000463_WriteAttribute
{
XCTestExpectation * expectation =
[self expectationWithDescription:@"Write just-above-range value to a nullable range-restricted signed 16-bit integer"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
id nullableRangeRestrictedInt16sArgument;
nullableRangeRestrictedInt16sArgument = [NSNumber numberWithShort:201];
[cluster writeAttributeNullableRangeRestrictedInt16sWithValue:nullableRangeRestrictedInt16sArgument
completionHandler:^(NSError * _Nullable err) {
NSLog(@"Write just-above-range value to a nullable range-restricted signed "
@"16-bit integer Error: %@",
err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err],
EMBER_ZCL_STATUS_CONSTRAINT_ERROR);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTestCluster_000464_WriteAttribute
{
XCTestExpectation * expectation =
[self expectationWithDescription:@"Write max value to a nullable range-restricted signed 16-bit integer"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
id nullableRangeRestrictedInt16sArgument;
nullableRangeRestrictedInt16sArgument = [NSNumber numberWithShort:32767];
[cluster writeAttributeNullableRangeRestrictedInt16sWithValue:nullableRangeRestrictedInt16sArgument
completionHandler:^(NSError * _Nullable err) {
NSLog(@"Write max value to a nullable range-restricted signed 16-bit integer "
@"Error: %@",
err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err],
EMBER_ZCL_STATUS_CONSTRAINT_ERROR);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTestCluster_000465_ReadAttribute
{
XCTestExpectation * expectation =
[self expectationWithDescription:@"Verify nullable range-restricted signed 16-bit integer value has not changed"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster
readAttributeNullableRangeRestrictedInt16sWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"Verify nullable range-restricted signed 16-bit integer value has not changed Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertFalse(actualValue == nil);
XCTAssertEqual([actualValue shortValue], -100);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTestCluster_000466_WriteAttribute
{
XCTestExpectation * expectation =
[self expectationWithDescription:@"Write min valid value to a nullable range-restricted signed 16-bit integer"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
id nullableRangeRestrictedInt16sArgument;
nullableRangeRestrictedInt16sArgument = [NSNumber numberWithShort:-150];
[cluster writeAttributeNullableRangeRestrictedInt16sWithValue:nullableRangeRestrictedInt16sArgument
completionHandler:^(NSError * _Nullable err) {
NSLog(@"Write min valid value to a nullable range-restricted signed 16-bit "
@"integer Error: %@",
err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTestCluster_000467_ReadAttribute
{
XCTestExpectation * expectation =
[self expectationWithDescription:@"Verify nullable range-restricted signed 16-bit integer value is at min valid"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster
readAttributeNullableRangeRestrictedInt16sWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"Verify nullable range-restricted signed 16-bit integer value is at min valid Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertFalse(actualValue == nil);
XCTAssertEqual([actualValue shortValue], -150);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTestCluster_000468_WriteAttribute
{
XCTestExpectation * expectation =
[self expectationWithDescription:@"Write max valid value to a nullable range-restricted signed 16-bit integer"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
id nullableRangeRestrictedInt16sArgument;
nullableRangeRestrictedInt16sArgument = [NSNumber numberWithShort:200];
[cluster writeAttributeNullableRangeRestrictedInt16sWithValue:nullableRangeRestrictedInt16sArgument
completionHandler:^(NSError * _Nullable err) {
NSLog(@"Write max valid value to a nullable range-restricted signed 16-bit "
@"integer Error: %@",
err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTestCluster_000469_ReadAttribute
{
XCTestExpectation * expectation =
[self expectationWithDescription:@"Verify nullable range-restricted signed 16-bit integer value is at max valid"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster
readAttributeNullableRangeRestrictedInt16sWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"Verify nullable range-restricted signed 16-bit integer value is at max valid Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertFalse(actualValue == nil);
XCTAssertEqual([actualValue shortValue], 200);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTestCluster_000470_WriteAttribute
{
XCTestExpectation * expectation =
[self expectationWithDescription:@"Write middle valid value to a nullable range-restricted signed 16-bit integer"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
id nullableRangeRestrictedInt16sArgument;
nullableRangeRestrictedInt16sArgument = [NSNumber numberWithShort:7];
[cluster writeAttributeNullableRangeRestrictedInt16sWithValue:nullableRangeRestrictedInt16sArgument
completionHandler:^(NSError * _Nullable err) {
NSLog(@"Write middle valid value to a nullable range-restricted signed 16-bit "
@"integer Error: %@",
err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTestCluster_000471_ReadAttribute
{
XCTestExpectation * expectation =
[self expectationWithDescription:@"Verify nullable range-restricted signed 16-bit integer value is at mid valid"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster
readAttributeNullableRangeRestrictedInt16sWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"Verify nullable range-restricted signed 16-bit integer value is at mid valid Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertFalse(actualValue == nil);
XCTAssertEqual([actualValue shortValue], 7);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTestCluster_000472_WriteAttribute
{
XCTestExpectation * expectation =
[self expectationWithDescription:@"Write null value to a nullable range-restricted signed 16-bit integer"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
id nullableRangeRestrictedInt16sArgument;
nullableRangeRestrictedInt16sArgument = nil;
[cluster writeAttributeNullableRangeRestrictedInt16sWithValue:nullableRangeRestrictedInt16sArgument
completionHandler:^(NSError * _Nullable err) {
NSLog(@"Write null value to a nullable range-restricted signed 16-bit integer "
@"Error: %@",
err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTestCluster_000473_ReadAttribute
{
XCTestExpectation * expectation =
[self expectationWithDescription:@"Verify nullable range-restricted signed 16-bit integer value is 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
readAttributeNullableRangeRestrictedInt16sWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"Verify nullable range-restricted signed 16-bit integer value is null Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertTrue(actualValue == nil);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTestCluster_000474_WriteAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Write attribute that returns general status on write"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
id generalErrorBooleanArgument;
generalErrorBooleanArgument = [NSNumber numberWithBool:false];
[cluster writeAttributeGeneralErrorBooleanWithValue:generalErrorBooleanArgument
completionHandler:^(NSError * _Nullable err) {
NSLog(@"Write attribute that returns general status on write Error: %@", err);
XCTAssertEqual(
[CHIPErrorTestUtils errorToZCLErrorCode:err], EMBER_ZCL_STATUS_INVALID_DATA_TYPE);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTestCluster_000475_WriteAttribute
{
XCTestExpectation * expectation =
[self expectationWithDescription:@"Write attribute that returns cluster-specific status on write"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
id clusterErrorBooleanArgument;
clusterErrorBooleanArgument = [NSNumber numberWithBool:false];
[cluster writeAttributeClusterErrorBooleanWithValue:clusterErrorBooleanArgument
completionHandler:^(NSError * _Nullable err) {
NSLog(@"Write attribute that returns cluster-specific status on write Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], EMBER_ZCL_STATUS_FAILURE);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTestCluster_000476_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute that returns general status on read"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeGeneralErrorBooleanWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"Read attribute that returns general status on read Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], EMBER_ZCL_STATUS_INVALID_DATA_TYPE);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTestCluster_000477_ReadAttribute
{
XCTestExpectation * expectation =
[self expectationWithDescription:@"read attribute that returns cluster-specific status on read"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeClusterErrorBooleanWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"read attribute that returns cluster-specific status on read Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], EMBER_ZCL_STATUS_FAILURE);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTestCluster_000478_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"read ClientGeneratedCommandList attribute"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeClientGeneratedCommandListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) {
NSLog(@"read ClientGeneratedCommandList attribute Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertEqual([actualValue count], 18);
XCTAssertEqual([actualValue[0] unsignedIntValue], 0UL);
XCTAssertEqual([actualValue[1] unsignedIntValue], 1UL);
XCTAssertEqual([actualValue[2] unsignedIntValue], 2UL);
XCTAssertEqual([actualValue[3] unsignedIntValue], 4UL);
XCTAssertEqual([actualValue[4] unsignedIntValue], 7UL);
XCTAssertEqual([actualValue[5] unsignedIntValue], 8UL);
XCTAssertEqual([actualValue[6] unsignedIntValue], 9UL);
XCTAssertEqual([actualValue[7] unsignedIntValue], 10UL);
XCTAssertEqual([actualValue[8] unsignedIntValue], 11UL);
XCTAssertEqual([actualValue[9] unsignedIntValue], 12UL);
XCTAssertEqual([actualValue[10] unsignedIntValue], 13UL);
XCTAssertEqual([actualValue[11] unsignedIntValue], 14UL);
XCTAssertEqual([actualValue[12] unsignedIntValue], 15UL);
XCTAssertEqual([actualValue[13] unsignedIntValue], 17UL);
XCTAssertEqual([actualValue[14] unsignedIntValue], 18UL);
XCTAssertEqual([actualValue[15] unsignedIntValue], 19UL);
XCTAssertEqual([actualValue[16] unsignedIntValue], 20UL);
XCTAssertEqual([actualValue[17] unsignedIntValue], 21UL);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTestCluster_000479_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"read ServerGeneratedCommandList attribute"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeServerGeneratedCommandListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) {
NSLog(@"read ServerGeneratedCommandList attribute Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertEqual([actualValue count], 8);
XCTAssertEqual([actualValue[0] unsignedIntValue], 0UL);
XCTAssertEqual([actualValue[1] unsignedIntValue], 1UL);
XCTAssertEqual([actualValue[2] unsignedIntValue], 4UL);
XCTAssertEqual([actualValue[3] unsignedIntValue], 5UL);
XCTAssertEqual([actualValue[4] unsignedIntValue], 6UL);
XCTAssertEqual([actualValue[5] unsignedIntValue], 9UL);
XCTAssertEqual([actualValue[6] unsignedIntValue], 10UL);
XCTAssertEqual([actualValue[7] unsignedIntValue], 11UL);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTestCluster_000480_WriteAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Write struct-typed attribute"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
id structAttrArgument;
structAttrArgument = [[CHIPTestClusterClusterSimpleStruct alloc] init];
((CHIPTestClusterClusterSimpleStruct *) structAttrArgument).a = [NSNumber numberWithUnsignedChar:5];
((CHIPTestClusterClusterSimpleStruct *) structAttrArgument).b = [NSNumber numberWithBool:true];
((CHIPTestClusterClusterSimpleStruct *) structAttrArgument).c = [NSNumber numberWithUnsignedChar:2];
((CHIPTestClusterClusterSimpleStruct *) structAttrArgument).d = [[NSData alloc] initWithBytes:"abc" length:3];
((CHIPTestClusterClusterSimpleStruct *) structAttrArgument).e = @"";
((CHIPTestClusterClusterSimpleStruct *) structAttrArgument).f = [NSNumber numberWithUnsignedChar:17];
((CHIPTestClusterClusterSimpleStruct *) structAttrArgument).g = [NSNumber numberWithFloat:1.5f];
((CHIPTestClusterClusterSimpleStruct *) structAttrArgument).h = [NSNumber numberWithDouble:3.14159265358979];
[cluster writeAttributeStructAttrWithValue:structAttrArgument
completionHandler:^(NSError * _Nullable err) {
NSLog(@"Write struct-typed attribute Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTestCluster_000481_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Read struct-typed attribute"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeStructAttrWithCompletionHandler:^(
CHIPTestClusterClusterSimpleStruct * _Nullable value, NSError * _Nullable err) {
NSLog(@"Read struct-typed attribute Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertEqual([((CHIPTestClusterClusterSimpleStruct *) actualValue).a unsignedCharValue], 5);
XCTAssertEqual([((CHIPTestClusterClusterSimpleStruct *) actualValue).b boolValue], true);
XCTAssertEqual([((CHIPTestClusterClusterSimpleStruct *) actualValue).c unsignedCharValue], 2);
XCTAssertTrue([((CHIPTestClusterClusterSimpleStruct *) actualValue).d isEqualToData:[[NSData alloc] initWithBytes:"abc"
length:3]]);
XCTAssertTrue([((CHIPTestClusterClusterSimpleStruct *) actualValue).e isEqualToString:@""]);
XCTAssertEqual([((CHIPTestClusterClusterSimpleStruct *) actualValue).f unsignedCharValue], 17);
XCTAssertEqual([((CHIPTestClusterClusterSimpleStruct *) actualValue).g floatValue], 1.5f);
XCTAssertEqual([((CHIPTestClusterClusterSimpleStruct *) actualValue).h doubleValue], 3.14159265358979);
}
[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, 305414945);
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
NSNumber * _Nonnull 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);
}
{
id actualValue = values.returnValue;
TestAddArgumentDefaultValue = actualValue;
}
[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;
XCTAssertEqualObjects(actualValue, 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 = [TestAddArgumentDefaultValue copy];
[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;
XCTAssertNotEqualObjects(actualValue, TestAddArgumentDefaultValue);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
NSNumber * _Nonnull 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);
}
{
id actualValue = value;
readAttributeBooleanDefaultValue = actualValue;
}
[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;
XCTAssertNotEqualObjects(actualValue, 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 = [readAttributeBooleanDefaultValue copy];
[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;
XCTAssertEqualObjects(actualValue, readAttributeBooleanDefaultValue);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
NSNumber * _Nonnull 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);
}
{
id actualValue = value;
readAttributeBitmap8DefaultValue = actualValue;
}
[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;
XCTAssertNotEqualObjects(actualValue, 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 = [readAttributeBitmap8DefaultValue copy];
[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;
XCTAssertEqualObjects(actualValue, readAttributeBitmap8DefaultValue);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
NSNumber * _Nonnull 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);
}
{
id actualValue = value;
readAttributeBitmap16DefaultValue = actualValue;
}
[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;
XCTAssertNotEqualObjects(actualValue, 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 = [readAttributeBitmap16DefaultValue copy];
[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;
XCTAssertEqualObjects(actualValue, readAttributeBitmap16DefaultValue);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
NSNumber * _Nonnull 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);
}
{
id actualValue = value;
readAttributeBitmap32DefaultValue = actualValue;
}
[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;
XCTAssertNotEqualObjects(actualValue, 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 = [readAttributeBitmap32DefaultValue copy];
[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;
XCTAssertEqualObjects(actualValue, readAttributeBitmap32DefaultValue);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
NSNumber * _Nonnull 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);
}
{
id actualValue = value;
readAttributeBitmap64DefaultValue = actualValue;
}
[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;
XCTAssertNotEqualObjects(actualValue, 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 = [readAttributeBitmap64DefaultValue copy];
[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;
XCTAssertEqualObjects(actualValue, readAttributeBitmap64DefaultValue);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
NSNumber * _Nonnull 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);
}
{
id actualValue = value;
readAttributeInt8uDefaultValue = actualValue;
}
[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;
XCTAssertNotEqualObjects(actualValue, 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 = [readAttributeInt8uDefaultValue copy];
[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;
XCTAssertEqualObjects(actualValue, readAttributeInt8uDefaultValue);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
NSNumber * _Nonnull 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);
}
{
id actualValue = value;
readAttributeInt16uDefaultValue = actualValue;
}
[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;
XCTAssertNotEqualObjects(actualValue, 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 = [readAttributeInt16uDefaultValue copy];
[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;
XCTAssertEqualObjects(actualValue, readAttributeInt16uDefaultValue);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
NSNumber * _Nonnull 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);
}
{
id actualValue = value;
readAttributeInt32uDefaultValue = actualValue;
}
[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;
XCTAssertNotEqualObjects(actualValue, 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 = [readAttributeInt32uDefaultValue copy];
[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;
XCTAssertEqualObjects(actualValue, readAttributeInt32uDefaultValue);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
NSNumber * _Nonnull 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);
}
{
id actualValue = value;
readAttributeInt64uDefaultValue = actualValue;
}
[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;
XCTAssertNotEqualObjects(actualValue, 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 = [readAttributeInt64uDefaultValue copy];
[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;
XCTAssertEqualObjects(actualValue, readAttributeInt64uDefaultValue);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
NSNumber * _Nonnull 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);
}
{
id actualValue = value;
readAttributeInt8sDefaultValue = actualValue;
}
[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;
XCTAssertNotEqualObjects(actualValue, 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 = [readAttributeInt8sDefaultValue copy];
[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;
XCTAssertEqualObjects(actualValue, readAttributeInt8sDefaultValue);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
NSNumber * _Nonnull 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);
}
{
id actualValue = value;
readAttributeInt16sDefaultValue = actualValue;
}
[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;
XCTAssertNotEqualObjects(actualValue, 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 = [readAttributeInt16sDefaultValue copy];
[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;
XCTAssertEqualObjects(actualValue, readAttributeInt16sDefaultValue);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
NSNumber * _Nonnull 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);
}
{
id actualValue = value;
readAttributeInt32sDefaultValue = actualValue;
}
[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;
XCTAssertNotEqualObjects(actualValue, 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 = [readAttributeInt32sDefaultValue copy];
[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;
XCTAssertEqualObjects(actualValue, readAttributeInt32sDefaultValue);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
NSNumber * _Nonnull 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);
}
{
id actualValue = value;
readAttributeInt64sDefaultValue = actualValue;
}
[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;
XCTAssertNotEqualObjects(actualValue, 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 = [readAttributeInt64sDefaultValue copy];
[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;
XCTAssertEqualObjects(actualValue, readAttributeInt64sDefaultValue);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
NSNumber * _Nonnull 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);
}
{
id actualValue = value;
readAttributeEnum8DefaultValue = actualValue;
}
[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;
XCTAssertNotEqualObjects(actualValue, 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 = [readAttributeEnum8DefaultValue copy];
[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;
XCTAssertEqualObjects(actualValue, readAttributeEnum8DefaultValue);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
NSNumber * _Nonnull 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);
}
{
id actualValue = value;
readAttributeEnum16DefaultValue = actualValue;
}
[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;
XCTAssertNotEqualObjects(actualValue, 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 = [readAttributeEnum16DefaultValue copy];
[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;
XCTAssertEqualObjects(actualValue, readAttributeEnum16DefaultValue);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
NSNumber * _Nonnull 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);
}
{
id actualValue = value;
readAttributeEpochUSDefaultValue = actualValue;
}
[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;
XCTAssertNotEqualObjects(actualValue, 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 = [readAttributeEpochUSDefaultValue copy];
[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;
XCTAssertEqualObjects(actualValue, readAttributeEpochUSDefaultValue);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
NSNumber * _Nonnull 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);
}
{
id actualValue = value;
readAttributeEpochSDefaultValue = actualValue;
}
[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;
XCTAssertNotEqualObjects(actualValue, 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 = [readAttributeEpochSDefaultValue copy];
[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;
XCTAssertEqualObjects(actualValue, readAttributeEpochSDefaultValue);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
NSNumber * _Nonnull 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);
}
{
id actualValue = value;
readAttributeVendorIdDefaultValue = actualValue;
}
[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;
XCTAssertNotEqualObjects(actualValue, 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 = [readAttributeVendorIdDefaultValue copy];
[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;
XCTAssertEqualObjects(actualValue, readAttributeVendorIdDefaultValue);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
NSString * _Nonnull readAttributeCharStringDefaultValue;
- (void)testSendClusterTestSaveAs_000094_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:@""]);
}
{
id actualValue = value;
readAttributeCharStringDefaultValue = actualValue;
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTestSaveAs_000095_ReadAttribute
{
XCTestExpectation * expectation =
[self expectationWithDescription:@"Read attribute char_string Default Value and compare to saved 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 and compare to saved value Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertEqualObjects(actualValue, readAttributeCharStringDefaultValue);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTestSaveAs_000096_WriteAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Write attribute char_string 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 charStringArgument;
charStringArgument = @"NotDefault";
[cluster writeAttributeCharStringWithValue:charStringArgument
completionHandler:^(NSError * _Nullable err) {
NSLog(@"Write attribute char_string Not Default Value Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
NSString * _Nonnull readAttributeCharStringNotDefaultValue;
- (void)testSendClusterTestSaveAs_000097_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute char_string 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 readAttributeCharStringWithCompletionHandler:^(NSString * _Nullable value, NSError * _Nullable err) {
NSLog(@"Read attribute char_string Not Default Value Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertTrue([actualValue isEqualToString:@"NotDefault"]);
}
{
id actualValue = value;
XCTAssertNotEqualObjects(actualValue, readAttributeCharStringDefaultValue);
}
{
id actualValue = value;
readAttributeCharStringNotDefaultValue = actualValue;
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTestSaveAs_000098_ReadAttribute
{
XCTestExpectation * expectation =
[self expectationWithDescription:@"Read attribute char_string Not Default Value and compare to saved 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 Not Default Value and compare to saved value Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertEqualObjects(actualValue, readAttributeCharStringNotDefaultValue);
}
{
id actualValue = value;
XCTAssertNotEqualObjects(actualValue, readAttributeCharStringDefaultValue);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTestSaveAs_000099_WriteAttribute
{
XCTestExpectation * expectation =
[self expectationWithDescription:@"Write attribute char_string Not Default Value from saved 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 = [readAttributeCharStringNotDefaultValue copy];
[cluster writeAttributeCharStringWithValue:charStringArgument
completionHandler:^(NSError * _Nullable err) {
NSLog(@"Write attribute char_string Not Default Value from saved value Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTestSaveAs_000100_ReadAttribute
{
XCTestExpectation * expectation =
[self expectationWithDescription:@"Read attribute char_string Not Default Value and compare to expected 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 Not Default Value and compare to expected value Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertTrue([actualValue isEqualToString:@"NotDefault"]);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTestSaveAs_000101_WriteAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Write 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);
id charStringArgument;
charStringArgument = [readAttributeCharStringDefaultValue copy];
[cluster writeAttributeCharStringWithValue:charStringArgument
completionHandler:^(NSError * _Nullable err) {
NSLog(@"Write attribute char_string Default Value Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
NSData * _Nonnull readAttributeOctetStringDefaultValue;
- (void)testSendClusterTestSaveAs_000102_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]]);
}
{
id actualValue = value;
readAttributeOctetStringDefaultValue = actualValue;
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTestSaveAs_000103_ReadAttribute
{
XCTestExpectation * expectation =
[self expectationWithDescription:@"Read attribute octet_string Default Value and compare to saved 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 and compare to saved value Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertEqualObjects(actualValue, readAttributeOctetStringDefaultValue);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTestSaveAs_000104_WriteAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Write attribute octet_string 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 octetStringArgument;
octetStringArgument = [[NSData alloc] initWithBytes:"NotDefault" length:10];
[cluster writeAttributeOctetStringWithValue:octetStringArgument
completionHandler:^(NSError * _Nullable err) {
NSLog(@"Write attribute octet_string Not Default Value Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
NSData * _Nonnull readAttributeOctetStringNotDefaultValue;
- (void)testSendClusterTestSaveAs_000105_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute octet_string 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 readAttributeOctetStringWithCompletionHandler:^(NSData * _Nullable value, NSError * _Nullable err) {
NSLog(@"Read attribute octet_string Not Default Value Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertTrue([actualValue isEqualToData:[[NSData alloc] initWithBytes:"NotDefault" length:10]]);
}
{
id actualValue = value;
XCTAssertNotEqualObjects(actualValue, readAttributeOctetStringDefaultValue);
}
{
id actualValue = value;
readAttributeOctetStringNotDefaultValue = actualValue;
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTestSaveAs_000106_ReadAttribute
{
XCTestExpectation * expectation =
[self expectationWithDescription:@"Read attribute octet_string Not Default Value and compare to saved 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 Not Default Value and compare to saved value Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertEqualObjects(actualValue, readAttributeOctetStringNotDefaultValue);
}
{
id actualValue = value;
XCTAssertNotEqualObjects(actualValue, readAttributeOctetStringDefaultValue);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTestSaveAs_000107_WriteAttribute
{
XCTestExpectation * expectation =
[self expectationWithDescription:@"Write attribute octet_string Not Default Value from saved 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 octetStringArgument;
octetStringArgument = [readAttributeOctetStringNotDefaultValue copy];
[cluster writeAttributeOctetStringWithValue:octetStringArgument
completionHandler:^(NSError * _Nullable err) {
NSLog(@"Write attribute octet_string Not Default Value from saved value Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTestSaveAs_000108_ReadAttribute
{
XCTestExpectation * expectation =
[self expectationWithDescription:@"Read attribute octet_string Not Default Value and compare to expected 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 Not Default Value and compare to expected value Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertTrue([actualValue isEqualToData:[[NSData alloc] initWithBytes:"NotDefault" length:10]]);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTestSaveAs_000109_WriteAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Write 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);
id octetStringArgument;
octetStringArgument = [readAttributeOctetStringDefaultValue copy];
[cluster writeAttributeOctetStringWithValue:octetStringArgument
completionHandler:^(NSError * _Nullable err) {
NSLog(@"Write attribute octet_string Default Value Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
[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, 305414945);
[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;
if (actualValue != nil) {
XCTAssertGreaterThanOrEqual([actualValue unsignedIntValue], 5UL);
}
}
[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;
if (actualValue != nil) {
XCTAssertLessThanOrEqual([actualValue unsignedIntValue], 5UL);
}
}
[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;
if (actualValue != nil) {
XCTAssertNotEqual([actualValue unsignedIntValue], 6UL);
}
}
[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"];
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 = @"lowercase";
[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_000012_ReadAttribute
{
XCTestExpectation * expectation =
[self expectationWithDescription:@"Read attribute CHAR_STRING Value isLowerCase/isUpperCase 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 isLowerCase/isUpperCase Constraints Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
BOOL isLowerCase = [actualValue isEqualToString:[actualValue lowercaseString]];
XCTAssertTrue(isLowerCase);
}
{
id actualValue = value;
BOOL isUpperCase = [actualValue isEqualToString:[actualValue uppercaseString]];
XCTAssertFalse(isUpperCase);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTestConstraints_000013_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 = @"UPPERCASE";
[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_000014_ReadAttribute
{
XCTestExpectation * expectation =
[self expectationWithDescription:@"Read attribute CHAR_STRING Value isLowerCase/isUpperCase 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 isLowerCase/isUpperCase Constraints Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
BOOL isLowerCase = [actualValue isEqualToString:[actualValue lowercaseString]];
XCTAssertFalse(isLowerCase);
}
{
id actualValue = value;
BOOL isUpperCase = [actualValue isEqualToString:[actualValue uppercaseString]];
XCTAssertTrue(isUpperCase);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTestConstraints_000015_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 = @"lowUPPER";
[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_000016_ReadAttribute
{
XCTestExpectation * expectation =
[self expectationWithDescription:@"Read attribute CHAR_STRING Value isLowerCase/isUpperCase 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 isLowerCase/isUpperCase Constraints Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
BOOL isLowerCase = [actualValue isEqualToString:[actualValue lowercaseString]];
XCTAssertFalse(isLowerCase);
}
{
id actualValue = value;
BOOL isUpperCase = [actualValue isEqualToString:[actualValue uppercaseString]];
XCTAssertFalse(isUpperCase);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTestConstraints_000017_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 = @"ABCDEF012V";
[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_000018_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute CHAR_STRING Value isHexString 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 isHexString Constraints Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
NSCharacterSet * chars = [[NSCharacterSet characterSetWithCharactersInString:@"0123456789ABCDEF"] invertedSet];
BOOL isHexString = (NSNotFound == [actualValue rangeOfCharacterFromSet:chars].location);
XCTAssertFalse(isHexString);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTestConstraints_000019_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 = @"ABCDEF0123";
[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_000020_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute CHAR_STRING Value isHexString 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 isHexString Constraints Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
NSCharacterSet * chars = [[NSCharacterSet characterSetWithCharactersInString:@"0123456789ABCDEF"] invertedSet];
BOOL isHexString = (NSNotFound == [actualValue rangeOfCharacterFromSet:chars].location);
XCTAssertTrue(isHexString);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTestConstraints_000021_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, 305414945);
[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:(100 / 1000) + 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, 305414945);
[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], 25);
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], 42UL);
XCTAssertEqual([actualValue[7] unsignedIntValue], 43UL);
XCTAssertEqual([actualValue[8] unsignedIntValue], 44UL);
XCTAssertEqual([actualValue[9] unsignedIntValue], 45UL);
XCTAssertEqual([actualValue[10] unsignedIntValue], 46UL);
XCTAssertEqual([actualValue[11] unsignedIntValue], 48UL);
XCTAssertEqual([actualValue[12] unsignedIntValue], 49UL);
XCTAssertEqual([actualValue[13] unsignedIntValue], 50UL);
XCTAssertEqual([actualValue[14] unsignedIntValue], 51UL);
XCTAssertEqual([actualValue[15] unsignedIntValue], 52UL);
XCTAssertEqual([actualValue[16] unsignedIntValue], 53UL);
XCTAssertEqual([actualValue[17] unsignedIntValue], 54UL);
XCTAssertEqual([actualValue[18] unsignedIntValue], 55UL);
XCTAssertEqual([actualValue[19] unsignedIntValue], 60UL);
XCTAssertEqual([actualValue[20] unsignedIntValue], 62UL);
XCTAssertEqual([actualValue[21] unsignedIntValue], 63UL);
XCTAssertEqual([actualValue[22] unsignedIntValue], 64UL);
XCTAssertEqual([actualValue[23] unsignedIntValue], 65UL);
XCTAssertEqual([actualValue[24] 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], 1);
XCTAssertEqual([actualValue[0] unsignedIntValue], 41UL);
}
[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, 305414945);
[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 = @"XX";
[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], 23);
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], 65528UL);
XCTAssertEqual([actualValue[20] unsignedIntValue], 65529UL);
XCTAssertEqual([actualValue[21] unsignedIntValue], 65531UL);
XCTAssertEqual([actualValue[22] 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, 305414945);
[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;
XCTAssertTrue(actualValue == nil);
}
{
id actualValue = values.groupList;
XCTAssertEqual([actualValue count], 1);
XCTAssertEqual([actualValue[0] unsignedShortValue], 1U);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTestGroupsCluster_000007_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_000008_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_000009_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_000010_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_000011_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_000012_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_000013_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;
XCTAssertTrue(actualValue == nil);
}
{
id actualValue = values.groupList;
XCTAssertEqual([actualValue count], 1);
XCTAssertEqual([actualValue[0] unsignedShortValue], 1U);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTestGroupsCluster_000014_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_000015_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_000016_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_000017_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_000018_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;
XCTAssertTrue(actualValue == nil);
}
{
id actualValue = values.groupList;
XCTAssertEqual([actualValue count], 0);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTestGroupKeyManagementCluster_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, 305414945);
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTestGroupKeyManagementCluster_000001_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Read maxGroupsPerFabric"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestGroupKeyManagement * cluster = [[CHIPTestGroupKeyManagement alloc] initWithDevice:device endpoint:0 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeMaxGroupsPerFabricWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"Read maxGroupsPerFabric Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
if (actualValue != nil) {
XCTAssertGreaterThanOrEqual([actualValue unsignedShortValue], 2U);
}
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTestGroupKeyManagementCluster_000002_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Read maxGroupKeysPerFabric"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestGroupKeyManagement * cluster = [[CHIPTestGroupKeyManagement alloc] initWithDevice:device endpoint:0 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeMaxGroupKeysPerFabricWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"Read maxGroupKeysPerFabric Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertEqual([actualValue unsignedShortValue], 2U);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTestGroupKeyManagementCluster_000003_AddGroup
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Add Group 1"];
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:257U];
params.groupName = @"Group #1";
[cluster addGroupWithParams:params
completionHandler:^(CHIPGroupsClusterAddGroupResponseParams * _Nullable values, NSError * _Nullable err) {
NSLog(@"Add Group 1 Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = values.status;
XCTAssertEqual([actualValue unsignedCharValue], 0);
}
{
id actualValue = values.groupId;
XCTAssertEqual([actualValue unsignedShortValue], 257U);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTestGroupKeyManagementCluster_000004_AddGroup
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Add Group 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 = [[CHIPGroupsClusterAddGroupParams alloc] init];
params.groupId = [NSNumber numberWithUnsignedShort:258U];
params.groupName = @"Group #2";
[cluster addGroupWithParams:params
completionHandler:^(CHIPGroupsClusterAddGroupResponseParams * _Nullable values, NSError * _Nullable err) {
NSLog(@"Add Group 2 Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = values.status;
XCTAssertEqual([actualValue unsignedCharValue], 0);
}
{
id actualValue = values.groupId;
XCTAssertEqual([actualValue unsignedShortValue], 258U);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTestGroupKeyManagementCluster_000005_KeySetWrite
{
XCTestExpectation * expectation = [self expectationWithDescription:@"KeySet Write 1"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestGroupKeyManagement * cluster = [[CHIPTestGroupKeyManagement alloc] initWithDevice:device endpoint:0 queue:queue];
XCTAssertNotNil(cluster);
__auto_type * params = [[CHIPGroupKeyManagementClusterKeySetWriteParams alloc] init];
params.groupKeySet = [[CHIPGroupKeyManagementClusterGroupKeySetStruct alloc] init];
((CHIPGroupKeyManagementClusterGroupKeySetStruct *) params.groupKeySet).groupKeySetID = [NSNumber numberWithUnsignedShort:417U];
((CHIPGroupKeyManagementClusterGroupKeySetStruct *) params.groupKeySet).groupKeySecurityPolicy =
[NSNumber numberWithUnsignedChar:0];
((CHIPGroupKeyManagementClusterGroupKeySetStruct *) params.groupKeySet).epochKey0 =
[[NSData alloc] initWithBytes:"\xa0\xa1\xa2\xa3\xa4\xa5\xa6\xa7\xa8\xa9\xaa\xab\xac\xad\xae\xaf" length:16];
((CHIPGroupKeyManagementClusterGroupKeySetStruct *) params.groupKeySet).epochStartTime0 =
[NSNumber numberWithUnsignedLongLong:1110000ULL];
((CHIPGroupKeyManagementClusterGroupKeySetStruct *) params.groupKeySet).epochKey1 =
[[NSData alloc] initWithBytes:"\xb0\xb1\xb2\xb3\xb4\xb5\xb6\xb7\xb8\xb9\xba\xbb\xbc\xbd\xbe\xbf" length:16];
((CHIPGroupKeyManagementClusterGroupKeySetStruct *) params.groupKeySet).epochStartTime1 =
[NSNumber numberWithUnsignedLongLong:1110001ULL];
((CHIPGroupKeyManagementClusterGroupKeySetStruct *) params.groupKeySet).epochKey2 =
[[NSData alloc] initWithBytes:"\xc0\xc1\xc2\xc3\xc4\xc5\xc6\xc7\xc8\xc9\xca\xcb\xcc\xcd\xce\xcf" length:16];
((CHIPGroupKeyManagementClusterGroupKeySetStruct *) params.groupKeySet).epochStartTime2 =
[NSNumber numberWithUnsignedLongLong:1110002ULL];
[cluster keySetWriteWithParams:params
completionHandler:^(NSError * _Nullable err) {
NSLog(@"KeySet Write 1 Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTestGroupKeyManagementCluster_000006_KeySetWrite
{
XCTestExpectation * expectation = [self expectationWithDescription:@"KeySet Write 2"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestGroupKeyManagement * cluster = [[CHIPTestGroupKeyManagement alloc] initWithDevice:device endpoint:0 queue:queue];
XCTAssertNotNil(cluster);
__auto_type * params = [[CHIPGroupKeyManagementClusterKeySetWriteParams alloc] init];
params.groupKeySet = [[CHIPGroupKeyManagementClusterGroupKeySetStruct alloc] init];
((CHIPGroupKeyManagementClusterGroupKeySetStruct *) params.groupKeySet).groupKeySetID = [NSNumber numberWithUnsignedShort:418U];
((CHIPGroupKeyManagementClusterGroupKeySetStruct *) params.groupKeySet).groupKeySecurityPolicy =
[NSNumber numberWithUnsignedChar:1];
((CHIPGroupKeyManagementClusterGroupKeySetStruct *) params.groupKeySet).epochKey0 =
[[NSData alloc] initWithBytes:"\xd0\xd1\xd2\xd3\xd4\xd5\xd6\xd7\xd8\xd9\xda\xdb\xdc\xdd\xde\xdf" length:16];
((CHIPGroupKeyManagementClusterGroupKeySetStruct *) params.groupKeySet).epochStartTime0 =
[NSNumber numberWithUnsignedLongLong:2110000ULL];
((CHIPGroupKeyManagementClusterGroupKeySetStruct *) params.groupKeySet).epochKey1 =
[[NSData alloc] initWithBytes:"\xe0\xe1\xe2\xe3\xe4\xe5\xe6\xe7\xe8\xe9\xea\xeb\xec\xed\xee\xef" length:16];
((CHIPGroupKeyManagementClusterGroupKeySetStruct *) params.groupKeySet).epochStartTime1 =
[NSNumber numberWithUnsignedLongLong:2110001ULL];
((CHIPGroupKeyManagementClusterGroupKeySetStruct *) params.groupKeySet).epochKey2 =
[[NSData alloc] initWithBytes:"\xf0\xf1\xf2\xf3\xf4\xf5\xf6\xf7\xf8\xf9\xfa\xfb\xfc\xfd\xfe\xff" length:16];
((CHIPGroupKeyManagementClusterGroupKeySetStruct *) params.groupKeySet).epochStartTime2 =
[NSNumber numberWithUnsignedLongLong:2110002ULL];
[cluster keySetWriteWithParams:params
completionHandler:^(NSError * _Nullable err) {
NSLog(@"KeySet Write 2 Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTestGroupKeyManagementCluster_000007_KeySetRead
{
XCTestExpectation * expectation = [self expectationWithDescription:@"KeySet Read"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestGroupKeyManagement * cluster = [[CHIPTestGroupKeyManagement alloc] initWithDevice:device endpoint:0 queue:queue];
XCTAssertNotNil(cluster);
__auto_type * params = [[CHIPGroupKeyManagementClusterKeySetReadParams alloc] init];
params.groupKeySetID = [NSNumber numberWithUnsignedShort:417U];
[cluster
keySetReadWithParams:params
completionHandler:^(CHIPGroupKeyManagementClusterKeySetReadResponseParams * _Nullable values, NSError * _Nullable err) {
NSLog(@"KeySet Read Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = values.groupKeySet;
XCTAssertEqual(
[((CHIPGroupKeyManagementClusterGroupKeySetStruct *) actualValue).groupKeySetID unsignedShortValue], 417U);
XCTAssertEqual(
[((CHIPGroupKeyManagementClusterGroupKeySetStruct *) actualValue).groupKeySecurityPolicy unsignedCharValue],
0);
XCTAssertTrue(((CHIPGroupKeyManagementClusterGroupKeySetStruct *) actualValue).epochKey0 == nil);
XCTAssertFalse(((CHIPGroupKeyManagementClusterGroupKeySetStruct *) actualValue).epochStartTime0 == nil);
XCTAssertEqual(
[((CHIPGroupKeyManagementClusterGroupKeySetStruct *) actualValue).epochStartTime0 unsignedLongLongValue],
1110000ULL);
XCTAssertTrue(((CHIPGroupKeyManagementClusterGroupKeySetStruct *) actualValue).epochKey1 == nil);
XCTAssertFalse(((CHIPGroupKeyManagementClusterGroupKeySetStruct *) actualValue).epochStartTime1 == nil);
XCTAssertEqual(
[((CHIPGroupKeyManagementClusterGroupKeySetStruct *) actualValue).epochStartTime1 unsignedLongLongValue],
1110001ULL);
XCTAssertTrue(((CHIPGroupKeyManagementClusterGroupKeySetStruct *) actualValue).epochKey2 == nil);
XCTAssertFalse(((CHIPGroupKeyManagementClusterGroupKeySetStruct *) actualValue).epochStartTime2 == nil);
XCTAssertEqual(
[((CHIPGroupKeyManagementClusterGroupKeySetStruct *) actualValue).epochStartTime2 unsignedLongLongValue],
1110002ULL);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTestGroupKeyManagementCluster_000008_WriteAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Write Group Keys"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestGroupKeyManagement * cluster = [[CHIPTestGroupKeyManagement alloc] initWithDevice:device endpoint:0 queue:queue];
XCTAssertNotNil(cluster);
id groupKeyMapArgument;
{
NSMutableArray * temp_0 = [[NSMutableArray alloc] init];
temp_0[0] = [[CHIPGroupKeyManagementClusterGroupKeyMapStruct alloc] init];
((CHIPGroupKeyManagementClusterGroupKeyMapStruct *) temp_0[0]).fabricIndex = [NSNumber numberWithUnsignedChar:1];
((CHIPGroupKeyManagementClusterGroupKeyMapStruct *) temp_0[0]).groupId = [NSNumber numberWithUnsignedShort:257U];
((CHIPGroupKeyManagementClusterGroupKeyMapStruct *) temp_0[0]).groupKeySetID = [NSNumber numberWithUnsignedShort:417U];
temp_0[1] = [[CHIPGroupKeyManagementClusterGroupKeyMapStruct alloc] init];
((CHIPGroupKeyManagementClusterGroupKeyMapStruct *) temp_0[1]).fabricIndex = [NSNumber numberWithUnsignedChar:1];
((CHIPGroupKeyManagementClusterGroupKeyMapStruct *) temp_0[1]).groupId = [NSNumber numberWithUnsignedShort:258U];
((CHIPGroupKeyManagementClusterGroupKeyMapStruct *) temp_0[1]).groupKeySetID = [NSNumber numberWithUnsignedShort:418U];
groupKeyMapArgument = temp_0;
}
[cluster writeAttributeGroupKeyMapWithValue:groupKeyMapArgument
completionHandler:^(NSError * _Nullable err) {
NSLog(@"Write Group Keys Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTestGroupKeyManagementCluster_000009_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Read Group Keys"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestGroupKeyManagement * cluster = [[CHIPTestGroupKeyManagement alloc] initWithDevice:device endpoint:0 queue:queue];
XCTAssertNotNil(cluster);
CHIPReadParams * params = [[CHIPReadParams alloc] init];
params.fabricFiltered = [NSNumber numberWithBool:true];
[cluster readAttributeGroupKeyMapWithParams:params
completionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) {
NSLog(@"Read Group Keys Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertEqual([actualValue count], 2);
XCTAssertEqual([((CHIPGroupKeyManagementClusterGroupKeyMapStruct *)
actualValue[0]).fabricIndex unsignedCharValue],
1);
XCTAssertEqual([((CHIPGroupKeyManagementClusterGroupKeyMapStruct *)
actualValue[0]).groupId unsignedShortValue],
257U);
XCTAssertEqual([((CHIPGroupKeyManagementClusterGroupKeyMapStruct *)
actualValue[0]).groupKeySetID unsignedShortValue],
417U);
XCTAssertEqual([((CHIPGroupKeyManagementClusterGroupKeyMapStruct *)
actualValue[1]).fabricIndex unsignedCharValue],
1);
XCTAssertEqual([((CHIPGroupKeyManagementClusterGroupKeyMapStruct *)
actualValue[1]).groupId unsignedShortValue],
258U);
XCTAssertEqual([((CHIPGroupKeyManagementClusterGroupKeyMapStruct *)
actualValue[1]).groupKeySetID unsignedShortValue],
418U);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTestGroupKeyManagementCluster_000010_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Read GroupTable"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestGroupKeyManagement * cluster = [[CHIPTestGroupKeyManagement alloc] initWithDevice:device endpoint:0 queue:queue];
XCTAssertNotNil(cluster);
CHIPReadParams * params = [[CHIPReadParams alloc] init];
params.fabricFiltered = [NSNumber numberWithBool:true];
[cluster readAttributeGroupTableWithParams:params
completionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) {
NSLog(@"Read GroupTable Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertEqual([actualValue count], 2);
XCTAssertEqual([((CHIPGroupKeyManagementClusterGroupInfoMapStruct *)
actualValue[0]).fabricIndex unsignedCharValue],
1);
XCTAssertEqual([((CHIPGroupKeyManagementClusterGroupInfoMapStruct *)
actualValue[0]).groupId unsignedShortValue],
257U);
XCTAssertTrue([((CHIPGroupKeyManagementClusterGroupInfoMapStruct *) actualValue[0]).groupName
isEqualToString:@"Group #1"]);
XCTAssertEqual([((CHIPGroupKeyManagementClusterGroupInfoMapStruct *)
actualValue[1]).fabricIndex unsignedCharValue],
1);
XCTAssertEqual([((CHIPGroupKeyManagementClusterGroupInfoMapStruct *)
actualValue[1]).groupId unsignedShortValue],
258U);
XCTAssertTrue([((CHIPGroupKeyManagementClusterGroupInfoMapStruct *) actualValue[1]).groupName
isEqualToString:@"Group #2"]);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTestGroupKeyManagementCluster_000011_KeySetRemove
{
XCTestExpectation * expectation = [self expectationWithDescription:@"KeySet Remove 1"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestGroupKeyManagement * cluster = [[CHIPTestGroupKeyManagement alloc] initWithDevice:device endpoint:0 queue:queue];
XCTAssertNotNil(cluster);
__auto_type * params = [[CHIPGroupKeyManagementClusterKeySetRemoveParams alloc] init];
params.groupKeySetID = [NSNumber numberWithUnsignedShort:417U];
[cluster keySetRemoveWithParams:params
completionHandler:^(NSError * _Nullable err) {
NSLog(@"KeySet Remove 1 Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTestGroupKeyManagementCluster_000012_KeySetRead
{
XCTestExpectation * expectation = [self expectationWithDescription:@"KeySet Read (removed)"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestGroupKeyManagement * cluster = [[CHIPTestGroupKeyManagement alloc] initWithDevice:device endpoint:0 queue:queue];
XCTAssertNotNil(cluster);
__auto_type * params = [[CHIPGroupKeyManagementClusterKeySetReadParams alloc] init];
params.groupKeySetID = [NSNumber numberWithUnsignedShort:417U];
[cluster
keySetReadWithParams:params
completionHandler:^(CHIPGroupKeyManagementClusterKeySetReadResponseParams * _Nullable values, NSError * _Nullable err) {
NSLog(@"KeySet Read (removed) Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], EMBER_ZCL_STATUS_NOT_FOUND);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTestGroupKeyManagementCluster_000013_KeySetRead
{
XCTestExpectation * expectation = [self expectationWithDescription:@"KeySet Read (not removed)"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestGroupKeyManagement * cluster = [[CHIPTestGroupKeyManagement alloc] initWithDevice:device endpoint:0 queue:queue];
XCTAssertNotNil(cluster);
__auto_type * params = [[CHIPGroupKeyManagementClusterKeySetReadParams alloc] init];
params.groupKeySetID = [NSNumber numberWithUnsignedShort:418U];
[cluster
keySetReadWithParams:params
completionHandler:^(CHIPGroupKeyManagementClusterKeySetReadResponseParams * _Nullable values, NSError * _Nullable err) {
NSLog(@"KeySet Read (not removed) Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = values.groupKeySet;
XCTAssertEqual(
[((CHIPGroupKeyManagementClusterGroupKeySetStruct *) actualValue).groupKeySetID unsignedShortValue], 418U);
XCTAssertEqual(
[((CHIPGroupKeyManagementClusterGroupKeySetStruct *) actualValue).groupKeySecurityPolicy unsignedCharValue],
1);
XCTAssertTrue(((CHIPGroupKeyManagementClusterGroupKeySetStruct *) actualValue).epochKey0 == nil);
XCTAssertFalse(((CHIPGroupKeyManagementClusterGroupKeySetStruct *) actualValue).epochStartTime0 == nil);
XCTAssertEqual(
[((CHIPGroupKeyManagementClusterGroupKeySetStruct *) actualValue).epochStartTime0 unsignedLongLongValue],
2110000ULL);
XCTAssertTrue(((CHIPGroupKeyManagementClusterGroupKeySetStruct *) actualValue).epochKey1 == nil);
XCTAssertFalse(((CHIPGroupKeyManagementClusterGroupKeySetStruct *) actualValue).epochStartTime1 == nil);
XCTAssertEqual(
[((CHIPGroupKeyManagementClusterGroupKeySetStruct *) actualValue).epochStartTime1 unsignedLongLongValue],
2110001ULL);
XCTAssertTrue(((CHIPGroupKeyManagementClusterGroupKeySetStruct *) actualValue).epochKey2 == nil);
XCTAssertFalse(((CHIPGroupKeyManagementClusterGroupKeySetStruct *) actualValue).epochStartTime2 == nil);
XCTAssertEqual(
[((CHIPGroupKeyManagementClusterGroupKeySetStruct *) actualValue).epochStartTime2 unsignedLongLongValue],
2110002ULL);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTestGroupKeyManagementCluster_000014_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)testSendClusterTestGroupKeyManagementCluster_000015_KeySetRemove
{
XCTestExpectation * expectation = [self expectationWithDescription:@"KeySet Remove 2"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestGroupKeyManagement * cluster = [[CHIPTestGroupKeyManagement alloc] initWithDevice:device endpoint:0 queue:queue];
XCTAssertNotNil(cluster);
__auto_type * params = [[CHIPGroupKeyManagementClusterKeySetRemoveParams alloc] init];
params.groupKeySetID = [NSNumber numberWithUnsignedShort:418U];
[cluster keySetRemoveWithParams:params
completionHandler:^(NSError * _Nullable err) {
NSLog(@"KeySet Remove 2 Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTestGroupKeyManagementCluster_000016_KeySetRead
{
XCTestExpectation * expectation = [self expectationWithDescription:@"KeySet Read (also removed)"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestGroupKeyManagement * cluster = [[CHIPTestGroupKeyManagement alloc] initWithDevice:device endpoint:0 queue:queue];
XCTAssertNotNil(cluster);
__auto_type * params = [[CHIPGroupKeyManagementClusterKeySetReadParams alloc] init];
params.groupKeySetID = [NSNumber numberWithUnsignedShort:418U];
[cluster
keySetReadWithParams:params
completionHandler:^(CHIPGroupKeyManagementClusterKeySetReadResponseParams * _Nullable values, NSError * _Nullable err) {
NSLog(@"KeySet Read (also removed) Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], EMBER_ZCL_STATUS_NOT_FOUND);
[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, 305414945);
[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)testSendClusterTestLogCommands_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, 305414945);
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTestLogCommands_000001_Log
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Log a simple message"];
dispatch_queue_t queue = dispatch_get_main_queue();
Log(expectation, queue, @"This is a simple message");
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTestLogCommands_000002_UserPrompt
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Do a simple user prompt message"];
dispatch_queue_t queue = dispatch_get_main_queue();
UserPrompt(expectation, queue, @"This is a simple message");
[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, 305414945);
[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;
if (actualValue != nil) {
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;
if (actualValue != nil) {
XCTAssertGreaterThanOrEqual([actualValue unsignedCharValue], 1);
}
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
NSNumber * _Nonnull ourFabricIndex;
- (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;
if (actualValue != nil) {
XCTAssertGreaterThanOrEqual([actualValue unsignedCharValue], 1);
}
}
{
id actualValue = value;
ourFabricIndex = actualValue;
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTestOperationalCredentialsCluster_000004_RemoveFabric
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Remove nonexistent fabric"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestOperationalCredentials * cluster = [[CHIPTestOperationalCredentials alloc] initWithDevice:device
endpoint:0
queue:queue];
XCTAssertNotNil(cluster);
__auto_type * params = [[CHIPOperationalCredentialsClusterRemoveFabricParams alloc] init];
params.fabricIndex = [NSNumber numberWithUnsignedChar:243];
[cluster
removeFabricWithParams:params
completionHandler:^(CHIPOperationalCredentialsClusterNOCResponseParams * _Nullable values, NSError * _Nullable err) {
NSLog(@"Remove nonexistent fabric Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = values.statusCode;
XCTAssertEqual([actualValue unsignedCharValue], 11);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTestOperationalCredentialsCluster_000005_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Read fabric list before setting label"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestOperationalCredentials * cluster = [[CHIPTestOperationalCredentials alloc] initWithDevice:device
endpoint:0
queue:queue];
XCTAssertNotNil(cluster);
CHIPReadParams * params = [[CHIPReadParams alloc] init];
params.fabricFiltered = [NSNumber numberWithBool:true];
[cluster readAttributeFabricsWithParams:params
completionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) {
NSLog(@"Read fabric list before setting label Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertEqual([actualValue count], 1);
XCTAssertEqualObjects(
((CHIPOperationalCredentialsClusterFabricDescriptor *) actualValue[0]).fabricIndex,
ourFabricIndex);
XCTAssertTrue([((CHIPOperationalCredentialsClusterFabricDescriptor *) actualValue[0]).label
isEqualToString:@""]);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTestOperationalCredentialsCluster_000006_UpdateFabricLabel
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Set the fabric label"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestOperationalCredentials * cluster = [[CHIPTestOperationalCredentials alloc] initWithDevice:device
endpoint:0
queue:queue];
XCTAssertNotNil(cluster);
__auto_type * params = [[CHIPOperationalCredentialsClusterUpdateFabricLabelParams alloc] init];
params.label = @"Batcave";
[cluster updateFabricLabelWithParams:params
completionHandler:^(
CHIPOperationalCredentialsClusterNOCResponseParams * _Nullable values, NSError * _Nullable err) {
NSLog(@"Set the fabric label Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = values.statusCode;
XCTAssertEqual([actualValue unsignedCharValue], 0);
}
{
id actualValue = values.fabricIndex;
XCTAssertEqualObjects(actualValue, ourFabricIndex);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTestOperationalCredentialsCluster_000007_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Read fabric list after setting label"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestOperationalCredentials * cluster = [[CHIPTestOperationalCredentials alloc] initWithDevice:device
endpoint:0
queue:queue];
XCTAssertNotNil(cluster);
CHIPReadParams * params = [[CHIPReadParams alloc] init];
params.fabricFiltered = [NSNumber numberWithBool:true];
[cluster readAttributeFabricsWithParams:params
completionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) {
NSLog(@"Read fabric list after setting label Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertEqual([actualValue count], 1);
XCTAssertEqualObjects(
((CHIPOperationalCredentialsClusterFabricDescriptor *) actualValue[0]).fabricIndex,
ourFabricIndex);
XCTAssertTrue([((CHIPOperationalCredentialsClusterFabricDescriptor *) actualValue[0]).label
isEqualToString:@"Batcave"]);
}
[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, 305414945);
[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)testSendClusterTestBinding_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, 305414945);
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTestBinding_000001_WriteAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Write empty binding table"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestBinding * cluster = [[CHIPTestBinding alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
id bindingArgument;
{
NSMutableArray * temp_0 = [[NSMutableArray alloc] init];
bindingArgument = temp_0;
}
[cluster writeAttributeBindingWithValue:bindingArgument
completionHandler:^(NSError * _Nullable err) {
NSLog(@"Write empty binding table Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTestBinding_000002_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Read empty binding table"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestBinding * cluster = [[CHIPTestBinding alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
CHIPReadParams * params = [[CHIPReadParams alloc] init];
params.fabricFiltered = [NSNumber numberWithBool:true];
[cluster readAttributeBindingWithParams:params
completionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) {
NSLog(@"Read empty binding table Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertEqual([actualValue count], 0);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTestBinding_000003_WriteAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Write invalid binding table"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestBinding * cluster = [[CHIPTestBinding alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
id bindingArgument;
{
NSMutableArray * temp_0 = [[NSMutableArray alloc] init];
temp_0[0] = [[CHIPBindingClusterTargetStruct alloc] init];
((CHIPBindingClusterTargetStruct *) temp_0[0]).fabricIndex = [NSNumber numberWithUnsignedChar:0];
temp_0[1] = [[CHIPBindingClusterTargetStruct alloc] init];
((CHIPBindingClusterTargetStruct *) temp_0[1]).fabricIndex = [NSNumber numberWithUnsignedChar:0];
((CHIPBindingClusterTargetStruct *) temp_0[1]).node = [NSNumber numberWithUnsignedLongLong:1ULL];
((CHIPBindingClusterTargetStruct *) temp_0[1]).group = [NSNumber numberWithUnsignedShort:1U];
((CHIPBindingClusterTargetStruct *) temp_0[1]).endpoint = [NSNumber numberWithUnsignedShort:1U];
((CHIPBindingClusterTargetStruct *) temp_0[1]).cluster = [NSNumber numberWithUnsignedInt:6UL];
bindingArgument = temp_0;
}
[cluster writeAttributeBindingWithValue:bindingArgument
completionHandler:^(NSError * _Nullable err) {
NSLog(@"Write invalid binding table Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], EMBER_ZCL_STATUS_CONSTRAINT_ERROR);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTestBinding_000004_WriteAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Write binding table"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestBinding * cluster = [[CHIPTestBinding alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
id bindingArgument;
{
NSMutableArray * temp_0 = [[NSMutableArray alloc] init];
temp_0[0] = [[CHIPBindingClusterTargetStruct alloc] init];
((CHIPBindingClusterTargetStruct *) temp_0[0]).fabricIndex = [NSNumber numberWithUnsignedChar:0];
((CHIPBindingClusterTargetStruct *) temp_0[0]).group = [NSNumber numberWithUnsignedShort:1U];
temp_0[1] = [[CHIPBindingClusterTargetStruct alloc] init];
((CHIPBindingClusterTargetStruct *) temp_0[1]).fabricIndex = [NSNumber numberWithUnsignedChar:0];
((CHIPBindingClusterTargetStruct *) temp_0[1]).node = [NSNumber numberWithUnsignedLongLong:1ULL];
((CHIPBindingClusterTargetStruct *) temp_0[1]).endpoint = [NSNumber numberWithUnsignedShort:1U];
((CHIPBindingClusterTargetStruct *) temp_0[1]).cluster = [NSNumber numberWithUnsignedInt:6UL];
temp_0[2] = [[CHIPBindingClusterTargetStruct alloc] init];
((CHIPBindingClusterTargetStruct *) temp_0[2]).fabricIndex = [NSNumber numberWithUnsignedChar:0];
((CHIPBindingClusterTargetStruct *) temp_0[2]).node = [NSNumber numberWithUnsignedLongLong:2ULL];
((CHIPBindingClusterTargetStruct *) temp_0[2]).endpoint = [NSNumber numberWithUnsignedShort:1U];
bindingArgument = temp_0;
}
[cluster writeAttributeBindingWithValue:bindingArgument
completionHandler:^(NSError * _Nullable err) {
NSLog(@"Write binding table Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTestBinding_000005_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Read binding table"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestBinding * cluster = [[CHIPTestBinding alloc] initWithDevice:device endpoint:1 queue:queue];
XCTAssertNotNil(cluster);
CHIPReadParams * params = [[CHIPReadParams alloc] init];
params.fabricFiltered = [NSNumber numberWithBool:true];
[cluster
readAttributeBindingWithParams:params
completionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) {
NSLog(@"Read binding table Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
{
id actualValue = value;
XCTAssertEqual([actualValue count], 3);
XCTAssertEqual([((CHIPBindingClusterTargetStruct *) actualValue[0]).fabricIndex unsignedCharValue], 1);
XCTAssertEqual([((CHIPBindingClusterTargetStruct *) actualValue[0]).group unsignedShortValue], 1U);
XCTAssertEqual([((CHIPBindingClusterTargetStruct *) actualValue[1]).fabricIndex unsignedCharValue], 1);
XCTAssertEqual([((CHIPBindingClusterTargetStruct *) actualValue[1]).node unsignedLongLongValue], 1ULL);
XCTAssertEqual([((CHIPBindingClusterTargetStruct *) actualValue[1]).endpoint unsignedShortValue], 1U);
XCTAssertEqual([((CHIPBindingClusterTargetStruct *) actualValue[1]).cluster unsignedIntValue], 6UL);
XCTAssertEqual([((CHIPBindingClusterTargetStruct *) actualValue[2]).fabricIndex unsignedCharValue], 1);
XCTAssertEqual([((CHIPBindingClusterTargetStruct *) actualValue[2]).node unsignedLongLongValue], 2ULL);
XCTAssertEqual([((CHIPBindingClusterTargetStruct *) actualValue[2]).endpoint unsignedShortValue], 1U);
}
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_SWDIAG_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, 305414945);
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_SWDIAG_1_1_000001_ReadAttribute
{
XCTestExpectation * expectation =
[self expectationWithDescription:@"Reads a list of ThreadMetrics struct non-global attribute from DUT."];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestSoftwareDiagnostics * cluster = [[CHIPTestSoftwareDiagnostics alloc] initWithDevice:device endpoint:0 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeThreadMetricsWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) {
NSLog(@"Reads a list of ThreadMetrics struct non-global attribute from DUT. Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_SWDIAG_1_1_000002_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:0 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.domain == MatterInteractionErrorDomain && err.code == MatterInteractionErrorCodeUnsupportedAttribute) {
[expectation fulfill];
return;
}
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_SWDIAG_1_1_000003_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:0 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.domain == MatterInteractionErrorDomain && err.code == MatterInteractionErrorCodeUnsupportedAttribute) {
[expectation fulfill];
return;
}
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_SWDIAG_1_1_000004_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:0 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.domain == MatterInteractionErrorDomain && err.code == MatterInteractionErrorCodeUnsupportedAttribute) {
[expectation fulfill];
return;
}
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_SWDIAG_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, 305414945);
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_SWDIAG_3_1_000001_ResetWatermarks
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Sends ResetWatermarks to DUT"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestSoftwareDiagnostics * cluster = [[CHIPTestSoftwareDiagnostics alloc] initWithDevice:device endpoint:0 queue:queue];
XCTAssertNotNil(cluster);
[cluster resetWatermarksWithCompletionHandler:^(NSError * _Nullable err) {
NSLog(@"Sends ResetWatermarks to DUT Error: %@", err);
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_SWDIAG_3_1_000002_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Reads CurrentHeapUsed attribute value from DUT"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestSoftwareDiagnostics * cluster = [[CHIPTestSoftwareDiagnostics alloc] initWithDevice:device endpoint:0 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeCurrentHeapUsedWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"Reads CurrentHeapUsed attribute value from DUT Error: %@", err);
if (err.domain == MatterInteractionErrorDomain && err.code == MatterInteractionErrorCodeUnsupportedAttribute) {
[expectation fulfill];
return;
}
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
- (void)testSendClusterTest_TC_SWDIAG_3_1_000003_ReadAttribute
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Reads CurrentHeapHighWaterMark attribute value from DUT"];
CHIPDevice * device = GetConnectedDevice();
dispatch_queue_t queue = dispatch_get_main_queue();
CHIPTestSoftwareDiagnostics * cluster = [[CHIPTestSoftwareDiagnostics alloc] initWithDevice:device endpoint:0 queue:queue];
XCTAssertNotNil(cluster);
[cluster readAttributeCurrentHeapHighWatermarkWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) {
NSLog(@"Reads CurrentHeapHighWaterMark attribute value from DUT Error: %@", err);
if (err.domain == MatterInteractionErrorDomain && err.code == MatterInteractionErrorCodeUnsupportedAttribute) {
[expectation fulfill];
return;
}
XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
[expectation fulfill];
}];
[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, 305414945);
[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 = 5U;
[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];
}
@end